From 7bdbdd7cb33f6ac8ca7e852ce2f6fa6d04744635 Mon Sep 17 00:00:00 2001 From: Dan Schulte Date: Tue, 27 Nov 2018 15:20:27 -0800 Subject: [PATCH] Delete networkManagement2/lib folder --- .../lib/models/addressSpace.js | 61 - .../lib/models/applicationGateway.js | 529 - ...icationGatewayAuthenticationCertificate.js | 99 - ...pplicationGatewayAutoscaleConfiguration.js | 56 - .../applicationGatewayAvailableSslOptions.js | 151 - ...onGatewayAvailableSslPredefinedPolicies.js | 67 - ...cationGatewayAvailableWafRuleSetsResult.js | 60 - .../applicationGatewayBackendAddress.js | 60 - .../applicationGatewayBackendAddressPool.js | 124 - .../models/applicationGatewayBackendHealth.js | 60 - ...icationGatewayBackendHealthHttpSettings.js | 117 - .../applicationGatewayBackendHealthPool.js | 82 - .../applicationGatewayBackendHealthServer.js | 336 - .../applicationGatewayBackendHttpSettings.js | 234 - .../applicationGatewayConnectionDraining.js | 67 - .../models/applicationGatewayCustomError.js | 62 - ...icationGatewayFirewallDisabledRuleGroup.js | 69 - .../applicationGatewayFirewallExclusion.js | 72 - .../models/applicationGatewayFirewallRule.js | 62 - .../applicationGatewayFirewallRuleGroup.js | 79 - .../applicationGatewayFirewallRuleSet.js | 136 - ...plicationGatewayFrontendIPConfiguration.js | 128 - .../models/applicationGatewayFrontendPort.js | 98 - .../applicationGatewayHeaderConfiguration.js | 60 - .../models/applicationGatewayHttpListener.js | 167 - .../applicationGatewayIPConfiguration.js | 103 - .../models/applicationGatewayListResult.js | 67 - .../lib/models/applicationGatewayPathRule.js | 149 - .../lib/models/applicationGatewayProbe.js | 180 - ...licationGatewayProbeHealthResponseMatch.js | 69 - ...applicationGatewayRedirectConfiguration.js | 178 - .../applicationGatewayRequestRoutingRule.js | 166 - .../models/applicationGatewayRewriteRule.js | 67 - .../applicationGatewayRewriteRuleActionSet.js | 78 - .../applicationGatewayRewriteRuleSet.js | 101 - .../lib/models/applicationGatewaySku.js | 72 - .../applicationGatewaySslCertificate.js | 127 - .../lib/models/applicationGatewaySslPolicy.js | 105 - .../applicationGatewaySslPredefinedPolicy.js | 89 - ...pplicationGatewayTrustedRootCertificate.js | 108 - .../models/applicationGatewayUrlPathMap.js | 152 - ...ewayWebApplicationFirewallConfiguration.js | 158 - .../lib/models/applicationSecurityGroup.js | 125 - .../applicationSecurityGroupListResult.js | 68 - .../lib/models/authorizationListResult.js | 68 - .../lib/models/availability.js | 68 - .../lib/models/availableDelegation.js | 94 - .../lib/models/availableDelegationsResult.js | 68 - .../lib/models/availableProvidersList.js | 60 - .../lib/models/availableProvidersListCity.js | 67 - .../models/availableProvidersListCountry.js | 83 - .../availableProvidersListParameters.js | 83 - .../lib/models/availableProvidersListState.js | 83 - .../lib/models/azureAsyncOperationResult.js | 75 - .../lib/models/azureFirewall.js | 180 - .../models/azureFirewallApplicationRule.js | 122 - .../azureFirewallApplicationRuleCollection.js | 125 - .../azureFirewallApplicationRuleProtocol.js | 66 - .../lib/models/azureFirewallFqdnTag.js | 121 - .../models/azureFirewallFqdnTagListResult.js | 67 - .../models/azureFirewallIPConfiguration.js | 116 - .../lib/models/azureFirewallListResult.js | 67 - .../lib/models/azureFirewallNatRCAction.js | 53 - .../lib/models/azureFirewallNatRule.js | 140 - .../models/azureFirewallNatRuleCollection.js | 125 - .../lib/models/azureFirewallNetworkRule.js | 121 - .../azureFirewallNetworkRuleCollection.js | 125 - .../lib/models/azureFirewallRCAction.js | 53 - .../lib/models/azureReachabilityReport.js | 82 - .../lib/models/azureReachabilityReportItem.js | 77 - .../azureReachabilityReportLatencyInfo.js | 65 - .../models/azureReachabilityReportLocation.js | 68 - .../azureReachabilityReportParameters.js | 104 - .../lib/models/bGPCommunity.js | 106 - .../lib/models/backendAddressPool.js | 131 - .../lib/models/bgpPeerStatus.js | 121 - .../lib/models/bgpPeerStatusListResult.js | 60 - .../lib/models/bgpServiceCommunity.js | 117 - .../models/bgpServiceCommunityListResult.js | 67 - .../lib/models/bgpSettings.js | 70 - .../lib/models/connectionMonitor.js | 115 - .../models/connectionMonitorDestination.js | 70 - .../lib/models/connectionMonitorListResult.js | 59 - .../lib/models/connectionMonitorParameters.js | 92 - .../models/connectionMonitorQueryResult.js | 69 - .../lib/models/connectionMonitorResult.js | 184 - .../lib/models/connectionMonitorSource.js | 61 - .../lib/models/connectionResetSharedKey.js | 57 - .../lib/models/connectionSharedKey.js | 63 - .../lib/models/connectionStateSnapshot.js | 136 - .../lib/models/connectivityDestination.js | 71 - .../lib/models/connectivityHop.js | 114 - .../lib/models/connectivityInformation.js | 117 - .../lib/models/connectivityIssue.js | 99 - .../lib/models/connectivityParameters.js | 98 - .../lib/models/connectivitySource.js | 62 - .../lib/models/container.js | 55 - .../lib/models/containerNetworkInterface.js | 146 - .../containerNetworkInterfaceConfiguration.js | 126 - ...ontainerNetworkInterfaceIpConfiguration.js | 81 - .../lib/models/ddosProtectionPlan.js | 149 - .../models/ddosProtectionPlanListResult.js | 68 - .../lib/models/delegation.js | 108 - .../lib/models/deviceProperties.js | 68 - .../lib/models/dhcpOptions.js | 61 - .../lib/models/dimension.js | 68 - .../lib/models/dnsNameAvailabilityResult.js | 52 - .../models/effectiveNetworkSecurityGroup.js | 109 - ...ffectiveNetworkSecurityGroupAssociation.js | 65 - ...effectiveNetworkSecurityGroupListResult.js | 69 - .../models/effectiveNetworkSecurityRule.js | 225 - .../lib/models/effectiveRoute.js | 116 - .../lib/models/effectiveRouteListResult.js | 69 - .../lib/models/endpointService.js | 53 - .../lib/models/endpointServiceResult.js | 73 - .../lib/models/endpointServicesListResult.js | 67 - .../lib/models/errorDetails.js | 67 - .../lib/models/errorModel.js | 91 - .../lib/models/errorResponse.js | 56 - .../models/evaluatedNetworkSecurityGroup.js | 92 - .../lib/models/expressRouteCircuit.js | 269 - .../lib/models/expressRouteCircuitArpTable.js | 76 - .../expressRouteCircuitAuthorization.js | 102 - .../models/expressRouteCircuitConnection.js | 135 - ...expressRouteCircuitConnectionListResult.js | 68 - .../models/expressRouteCircuitListResult.js | 67 - .../lib/models/expressRouteCircuitPeering.js | 321 - .../expressRouteCircuitPeeringConfig.js | 113 - .../models/expressRouteCircuitPeeringId.js | 52 - .../expressRouteCircuitPeeringListResult.js | 68 - .../models/expressRouteCircuitReference.js | 51 - .../models/expressRouteCircuitRoutesTable.js | 86 - .../expressRouteCircuitRoutesTableSummary.js | 87 - ...ssRouteCircuitServiceProviderProperties.js | 68 - .../lib/models/expressRouteCircuitSku.js | 72 - .../lib/models/expressRouteCircuitStats.js | 76 - .../expressRouteCircuitsArpTableListResult.js | 68 - ...pressRouteCircuitsRoutesTableListResult.js | 68 - ...uteCircuitsRoutesTableSummaryListResult.js | 68 - .../lib/models/expressRouteConnection.js | 104 - .../lib/models/expressRouteConnectionId.js | 53 - .../lib/models/expressRouteConnectionList.js | 60 - .../lib/models/expressRouteCrossConnection.js | 204 - .../expressRouteCrossConnectionListResult.js | 68 - .../expressRouteCrossConnectionPeering.js | 265 - .../expressRouteCrossConnectionPeeringList.js | 69 - ...sRouteCrossConnectionRoutesTableSummary.js | 80 - ...ConnectionsRoutesTableSummaryListResult.js | 70 - .../lib/models/expressRouteGateway.js | 161 - .../lib/models/expressRouteGatewayList.js | 60 - ...GatewayPropertiesAutoScaleConfiguration.js | 58 - ...yPropertiesAutoScaleConfigurationBounds.js | 62 - .../lib/models/expressRouteLink.js | 144 - .../lib/models/expressRouteLinkListResult.js | 68 - .../lib/models/expressRoutePort.js | 224 - .../lib/models/expressRoutePortListResult.js | 68 - .../lib/models/expressRoutePortsLocation.js | 140 - .../expressRoutePortsLocationBandwidths.js | 64 - .../expressRoutePortsLocationListResult.js | 68 - .../lib/models/expressRouteServiceProvider.js | 132 - ...ssRouteServiceProviderBandwidthsOffered.js | 60 - .../expressRouteServiceProviderListResult.js | 67 - .../lib/models/flowLogFormatParameters.js | 63 - .../lib/models/flowLogInformation.js | 124 - .../lib/models/flowLogStatusParameters.js | 54 - .../lib/models/frontendIPConfiguration.js | 425 - .../lib/models/gatewayRoute.js | 107 - .../lib/models/gatewayRouteListResult.js | 60 - .../models/getVpnSitesConfigurationRequest.js | 69 - .../lib/models/hTTPConfiguration.js | 83 - .../lib/models/hTTPHeader.js | 60 - .../lib/models/httpConfiguration.js | 83 - .../lib/models/hubVirtualNetworkConnection.js | 121 - .../lib/models/iPAddressAvailabilityResult.js | 68 - .../lib/models/iPConfiguration.js | 226 - .../lib/models/iPConfigurationProfile.js | 161 - .../lib/models/inboundNatPool.js | 166 - .../lib/models/inboundNatRule.js | 445 - .../lib/models/inboundNatRuleListResult.js | 68 - .../networkManagement2/lib/models/index.d.ts | 11150 ---- .../networkManagement2/lib/models/index.js | 363 - .../lib/models/interfaceEndpoint.js | 230 - .../lib/models/interfaceEndpointListResult.js | 68 - .../networkManagement2/lib/models/ipTag.js | 62 - .../lib/models/ipsecPolicy.js | 124 - .../ipv6ExpressRouteCircuitPeeringConfig.js | 114 - .../listHubVirtualNetworkConnectionsResult.js | 69 - .../lib/models/listP2SVpnGatewaysResult.js | 69 - .../listP2SVpnServerConfigurationsResult.js | 70 - .../lib/models/listVirtualHubsResult.js | 69 - .../lib/models/listVirtualWANsResult.js | 69 - .../lib/models/listVpnConnectionsResult.js | 70 - .../lib/models/listVpnGatewaysResult.js | 69 - .../lib/models/listVpnSitesResult.js | 69 - .../lib/models/loadBalancer.js | 260 - ...oadBalancerBackendAddressPoolListResult.js | 68 - ...lancerFrontendIPConfigurationListResult.js | 68 - .../lib/models/loadBalancerListResult.js | 68 - ...loadBalancerLoadBalancingRuleListResult.js | 68 - .../loadBalancerOutboundRuleListResult.js | 68 - .../lib/models/loadBalancerProbeListResult.js | 68 - .../lib/models/loadBalancerSku.js | 53 - .../lib/models/loadBalancingRule.js | 198 - .../lib/models/localNetworkGateway.js | 156 - .../models/localNetworkGatewayListResult.js | 68 - .../lib/models/logSpecification.js | 68 - .../lib/models/managedServiceIdentity.js | 98 - ...viceIdentityUserAssignedIdentitiesValue.js | 62 - .../lib/models/matchedRule.js | 61 - .../lib/models/metricSpecification.js | 176 - ...etworkConfigurationDiagnosticParameters.js | 81 - .../networkConfigurationDiagnosticProfile.js | 91 - .../networkConfigurationDiagnosticResponse.js | 62 - .../networkConfigurationDiagnosticResult.js | 81 - .../lib/models/networkInterface.js | 365 - .../lib/models/networkInterfaceAssociation.js | 69 - .../lib/models/networkInterfaceDnsSettings.js | 109 - .../models/networkInterfaceIPConfiguration.js | 431 - ...tworkInterfaceIPConfigurationListResult.js | 68 - .../lib/models/networkInterfaceListResult.js | 68 - .../networkInterfaceLoadBalancerListResult.js | 68 - .../networkInterfaceTapConfiguration.js | 765 - ...workInterfaceTapConfigurationListResult.js | 68 - .../lib/models/networkProfile.js | 155 - .../lib/models/networkProfileListResult.js | 67 - .../lib/models/networkSecurityGroup.js | 189 - .../models/networkSecurityGroupListResult.js | 67 - .../lib/models/networkSecurityGroupResult.js | 72 - .../networkSecurityRulesEvaluationResult.js | 97 - .../lib/models/networkWatcher.js | 112 - .../lib/models/networkWatcherListResult.js | 59 - .../lib/models/nextHopParameters.js | 79 - .../lib/models/nextHopResult.js | 73 - .../lib/models/operation.js | 90 - .../lib/models/operationDisplay.js | 78 - .../lib/models/operationListResult.js | 69 - ...ionPropertiesFormatServiceSpecification.js | 76 - .../lib/models/outboundRule.js | 148 - .../lib/models/p2SVpnGateway.js | 175 - .../lib/models/p2SVpnProfileParameters.js | 54 - ...ServerConfigRadiusClientRootCertificate.js | 93 - ...ServerConfigRadiusServerRootCertificate.js | 92 - ...ServerConfigVpnClientRevokedCertificate.js | 93 - ...VpnServerConfigVpnClientRootCertificate.js | 92 - .../lib/models/p2SVpnServerConfiguration.js | 243 - .../lib/models/packetCapture.js | 118 - .../lib/models/packetCaptureFilter.js | 101 - .../lib/models/packetCaptureListResult.js | 59 - .../lib/models/packetCaptureParameters.js | 118 - .../models/packetCaptureQueryStatusResult.js | 104 - .../lib/models/packetCaptureResult.js | 156 - .../models/packetCaptureStorageLocation.js | 74 - .../lib/models/patchRouteFilter.js | 144 - .../lib/models/patchRouteFilterRule.js | 120 - .../networkManagement2/lib/models/probe.js | 155 - .../lib/models/protocolConfiguration.js | 57 - .../lib/models/publicIPAddress.js | 331 - .../lib/models/publicIPAddressDnsSettings.js | 78 - .../lib/models/publicIPAddressListResult.js | 67 - .../lib/models/publicIPAddressSku.js | 53 - .../lib/models/publicIPPrefix.js | 207 - .../lib/models/publicIPPrefixListResult.js | 67 - .../lib/models/publicIPPrefixSku.js | 53 - .../models/queryTroubleshootingParameters.js | 53 - .../lib/models/referencedPublicIpAddress.js | 51 - .../networkManagement2/lib/models/resource.js | 97 - .../lib/models/resourceNavigationLink.js | 101 - .../lib/models/retentionPolicyParameters.js | 64 - .../networkManagement2/lib/models/route.js | 113 - .../lib/models/routeFilter.js | 147 - .../lib/models/routeFilterListResult.js | 67 - .../lib/models/routeFilterRule.js | 127 - .../lib/models/routeFilterRuleListResult.js | 67 - .../lib/models/routeListResult.js | 67 - .../lib/models/routeTable.js | 153 - .../lib/models/routeTableListResult.js | 67 - .../models/securityGroupNetworkInterface.js | 78 - .../lib/models/securityGroupViewParameters.js | 52 - .../lib/models/securityGroupViewResult.js | 61 - .../lib/models/securityRule.js | 271 - .../lib/models/securityRuleAssociations.js | 102 - .../lib/models/securityRuleListResult.js | 68 - .../lib/models/serviceAssociationLink.js | 101 - .../lib/models/serviceEndpointPolicy.js | 156 - .../models/serviceEndpointPolicyDefinition.js | 116 - ...rviceEndpointPolicyDefinitionListResult.js | 69 - .../models/serviceEndpointPolicyListResult.js | 68 - .../models/serviceEndpointPropertiesFormat.js | 76 - .../lib/models/subResource.js | 56 - .../networkManagement2/lib/models/subnet.js | 301 - .../lib/models/subnetAssociation.js | 69 - .../lib/models/subnetListResult.js | 68 - .../lib/models/tagsObject.js | 59 - .../networkManagement2/lib/models/topology.js | 89 - .../lib/models/topologyAssociation.js | 72 - .../lib/models/topologyParameters.js | 74 - .../lib/models/topologyResource.js | 85 - ...trafficAnalyticsConfigurationProperties.js | 86 - .../lib/models/trafficAnalyticsProperties.js | 67 - .../lib/models/trafficQuery.js | 91 - .../lib/models/troubleshootingDetails.js | 92 - .../lib/models/troubleshootingParameters.js | 70 - .../troubleshootingRecommendedActions.js | 78 - .../lib/models/troubleshootingResult.js | 84 - .../lib/models/tunnelConnectionHealth.js | 94 - .../networkManagement2/lib/models/usage.js | 90 - .../lib/models/usageName.js | 61 - .../lib/models/usagesListResult.js | 67 - .../models/verificationIPFlowParameters.js | 119 - .../lib/models/verificationIPFlowResult.js | 62 - .../lib/models/virtualHub.js | 192 - .../lib/models/virtualHubId.js | 54 - .../lib/models/virtualHubRoute.js | 67 - .../lib/models/virtualHubRouteTable.js | 60 - .../lib/models/virtualNetwork.js | 210 - ...irtualNetworkConnectionGatewayReference.js | 53 - .../lib/models/virtualNetworkGateway.js | 253 - .../models/virtualNetworkGatewayConnection.js | 471 - ...rtualNetworkGatewayConnectionListEntity.js | 303 - ...rtualNetworkGatewayConnectionListResult.js | 68 - .../virtualNetworkGatewayIPConfiguration.js | 115 - ...tualNetworkGatewayListConnectionsResult.js | 68 - .../models/virtualNetworkGatewayListResult.js | 68 - .../lib/models/virtualNetworkGatewaySku.js | 74 - .../lib/models/virtualNetworkListResult.js | 67 - .../models/virtualNetworkListUsageResult.js | 68 - .../lib/models/virtualNetworkPeering.js | 159 - .../models/virtualNetworkPeeringListResult.js | 68 - .../lib/models/virtualNetworkTap.js | 804 - .../lib/models/virtualNetworkTapListResult.js | 67 - .../lib/models/virtualNetworkUsage.js | 95 - .../lib/models/virtualNetworkUsageName.js | 63 - .../lib/models/virtualWAN.js | 208 - .../lib/models/virtualWanSecurityProvider.js | 69 - .../lib/models/virtualWanSecurityProviders.js | 60 - .../lib/models/vpnClientConfiguration.js | 141 - .../lib/models/vpnClientConnectionHealth.js | 89 - .../lib/models/vpnClientIPsecParameters.js | 122 - .../lib/models/vpnClientParameters.js | 92 - .../lib/models/vpnClientRevokedCertificate.js | 93 - .../lib/models/vpnClientRootCertificate.js | 92 - .../lib/models/vpnConnection.js | 195 - .../lib/models/vpnDeviceScriptParameters.js | 69 - .../lib/models/vpnGateway.js | 164 - .../lib/models/vpnProfileResponse.js | 52 - .../networkManagement2/lib/models/vpnSite.js | 187 - .../lib/models/vpnSiteId.js | 54 - .../lib/networkManagementClient.d.ts | 252 - .../lib/networkManagementClient.js | 625 - .../lib/operations/applicationGateways.js | 5576 -- .../operations/applicationSecurityGroups.js | 1985 - .../lib/operations/availableDelegations.js | 471 - .../operations/availableEndpointServices.js | 465 - .../availableResourceGroupDelegations.js | 481 - .../lib/operations/azureFirewallFqdnTags.js | 455 - .../lib/operations/azureFirewalls.js | 2060 - .../lib/operations/bgpServiceCommunities.js | 455 - .../lib/operations/connectionMonitors.js | 2753 - .../lib/operations/ddosProtectionPlans.js | 1952 - .../lib/operations/defaultSecurityRules.js | 724 - .../expressRouteCircuitAuthorizations.js | 1668 - .../expressRouteCircuitConnections.js | 1804 - .../operations/expressRouteCircuitPeerings.js | 2340 - .../lib/operations/expressRouteCircuits.js | 4567 -- .../lib/operations/expressRouteConnections.js | 1484 - .../expressRouteCrossConnectionPeerings.js | 2160 - .../expressRouteCrossConnections.js | 3510 -- .../lib/operations/expressRouteGateways.js | 1707 - .../lib/operations/expressRouteLinks.js | 727 - .../lib/operations/expressRoutePorts.js | 2514 - .../operations/expressRoutePortsLocations.js | 695 - .../expressRouteServiceProviders.js | 455 - .../hubVirtualNetworkConnections.js | 720 - .../lib/operations/inboundNatRules.js | 1831 - .../lib/operations/index.d.ts | 48529 ---------------- .../lib/operations/index.js | 83 - .../lib/operations/interfaceEndpoints.js | 2559 - .../loadBalancerBackendAddressPools.js | 715 - .../loadBalancerFrontendIPConfigurations.js | 724 - .../loadBalancerLoadBalancingRules.js | 715 - .../loadBalancerNetworkInterfaces.js | 475 - .../operations/loadBalancerOutboundRules.js | 715 - .../lib/operations/loadBalancerProbes.js | 715 - .../lib/operations/loadBalancers.js | 2689 - .../lib/operations/localNetworkGateways.js | 2181 - .../networkInterfaceIPConfigurations.js | 717 - .../networkInterfaceLoadBalancers.js | 475 - .../networkInterfaceTapConfigurations.js | 3714 -- .../lib/operations/networkInterfaces.js | 5646 -- .../lib/operations/networkProfiles.js | 1925 - .../lib/operations/networkSecurityGroups.js | 2536 - .../lib/operations/networkWatchers.js | 8021 --- .../lib/operations/operations.js | 447 - .../lib/operations/p2sVpnGateways.js | 3065 - .../operations/p2sVpnServerConfigurations.js | 1871 - .../lib/operations/packetCaptures.js | 2317 - .../lib/operations/publicIPAddresses.js | 3999 -- .../lib/operations/publicIPPrefixes.js | 2617 - .../lib/operations/routeFilterRules.js | 2152 - .../lib/operations/routeFilters.js | 2498 - .../lib/operations/routeTables.js | 2483 - .../lib/operations/routes.js | 1700 - .../lib/operations/securityRules.js | 1998 - .../lib/operations/serviceEndpointPolicies.js | 2476 - .../serviceEndpointPolicyDefinitions.js | 1710 - .../lib/operations/subnets.js | 2055 - .../lib/operations/usages.js | 467 - .../lib/operations/virtualHubs.js | 2603 - .../virtualNetworkGatewayConnections.js | 4265 -- .../lib/operations/virtualNetworkGateways.js | 8172 --- .../lib/operations/virtualNetworkPeerings.js | 1875 - .../lib/operations/virtualNetworkTaps.js | 4392 -- .../lib/operations/virtualNetworks.js | 3341 -- .../lib/operations/virtualWANs.js | 2567 - .../lib/operations/virtualWans.js | 2567 - .../lib/operations/vpnConnections.js | 1817 - .../lib/operations/vpnGateways.js | 2591 - .../lib/operations/vpnSites.js | 2699 - .../lib/operations/vpnSitesConfiguration.js | 473 - 419 files changed, 245925 deletions(-) delete mode 100644 lib/services/networkManagement2/lib/models/addressSpace.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGateway.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayAuthenticationCertificate.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayAutoscaleConfiguration.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayAvailableSslOptions.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayAvailableSslPredefinedPolicies.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayAvailableWafRuleSetsResult.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayBackendAddress.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayBackendAddressPool.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayBackendHealth.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthHttpSettings.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthPool.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthServer.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayBackendHttpSettings.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayConnectionDraining.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayCustomError.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayFirewallDisabledRuleGroup.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayFirewallExclusion.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayFirewallRule.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayFirewallRuleGroup.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayFirewallRuleSet.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayFrontendIPConfiguration.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayFrontendPort.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayHeaderConfiguration.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayHttpListener.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayIPConfiguration.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayPathRule.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayProbe.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayProbeHealthResponseMatch.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayRedirectConfiguration.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayRequestRoutingRule.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayRewriteRule.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayRewriteRuleActionSet.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayRewriteRuleSet.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewaySku.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewaySslCertificate.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewaySslPolicy.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewaySslPredefinedPolicy.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayTrustedRootCertificate.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayUrlPathMap.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationGatewayWebApplicationFirewallConfiguration.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationSecurityGroup.js delete mode 100644 lib/services/networkManagement2/lib/models/applicationSecurityGroupListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/authorizationListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/availability.js delete mode 100644 lib/services/networkManagement2/lib/models/availableDelegation.js delete mode 100644 lib/services/networkManagement2/lib/models/availableDelegationsResult.js delete mode 100644 lib/services/networkManagement2/lib/models/availableProvidersList.js delete mode 100644 lib/services/networkManagement2/lib/models/availableProvidersListCity.js delete mode 100644 lib/services/networkManagement2/lib/models/availableProvidersListCountry.js delete mode 100644 lib/services/networkManagement2/lib/models/availableProvidersListParameters.js delete mode 100644 lib/services/networkManagement2/lib/models/availableProvidersListState.js delete mode 100644 lib/services/networkManagement2/lib/models/azureAsyncOperationResult.js delete mode 100644 lib/services/networkManagement2/lib/models/azureFirewall.js delete mode 100644 lib/services/networkManagement2/lib/models/azureFirewallApplicationRule.js delete mode 100644 lib/services/networkManagement2/lib/models/azureFirewallApplicationRuleCollection.js delete mode 100644 lib/services/networkManagement2/lib/models/azureFirewallApplicationRuleProtocol.js delete mode 100644 lib/services/networkManagement2/lib/models/azureFirewallFqdnTag.js delete mode 100644 lib/services/networkManagement2/lib/models/azureFirewallFqdnTagListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/azureFirewallIPConfiguration.js delete mode 100644 lib/services/networkManagement2/lib/models/azureFirewallListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/azureFirewallNatRCAction.js delete mode 100644 lib/services/networkManagement2/lib/models/azureFirewallNatRule.js delete mode 100644 lib/services/networkManagement2/lib/models/azureFirewallNatRuleCollection.js delete mode 100644 lib/services/networkManagement2/lib/models/azureFirewallNetworkRule.js delete mode 100644 lib/services/networkManagement2/lib/models/azureFirewallNetworkRuleCollection.js delete mode 100644 lib/services/networkManagement2/lib/models/azureFirewallRCAction.js delete mode 100644 lib/services/networkManagement2/lib/models/azureReachabilityReport.js delete mode 100644 lib/services/networkManagement2/lib/models/azureReachabilityReportItem.js delete mode 100644 lib/services/networkManagement2/lib/models/azureReachabilityReportLatencyInfo.js delete mode 100644 lib/services/networkManagement2/lib/models/azureReachabilityReportLocation.js delete mode 100644 lib/services/networkManagement2/lib/models/azureReachabilityReportParameters.js delete mode 100644 lib/services/networkManagement2/lib/models/bGPCommunity.js delete mode 100644 lib/services/networkManagement2/lib/models/backendAddressPool.js delete mode 100644 lib/services/networkManagement2/lib/models/bgpPeerStatus.js delete mode 100644 lib/services/networkManagement2/lib/models/bgpPeerStatusListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/bgpServiceCommunity.js delete mode 100644 lib/services/networkManagement2/lib/models/bgpServiceCommunityListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/bgpSettings.js delete mode 100644 lib/services/networkManagement2/lib/models/connectionMonitor.js delete mode 100644 lib/services/networkManagement2/lib/models/connectionMonitorDestination.js delete mode 100644 lib/services/networkManagement2/lib/models/connectionMonitorListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/connectionMonitorParameters.js delete mode 100644 lib/services/networkManagement2/lib/models/connectionMonitorQueryResult.js delete mode 100644 lib/services/networkManagement2/lib/models/connectionMonitorResult.js delete mode 100644 lib/services/networkManagement2/lib/models/connectionMonitorSource.js delete mode 100644 lib/services/networkManagement2/lib/models/connectionResetSharedKey.js delete mode 100644 lib/services/networkManagement2/lib/models/connectionSharedKey.js delete mode 100644 lib/services/networkManagement2/lib/models/connectionStateSnapshot.js delete mode 100644 lib/services/networkManagement2/lib/models/connectivityDestination.js delete mode 100644 lib/services/networkManagement2/lib/models/connectivityHop.js delete mode 100644 lib/services/networkManagement2/lib/models/connectivityInformation.js delete mode 100644 lib/services/networkManagement2/lib/models/connectivityIssue.js delete mode 100644 lib/services/networkManagement2/lib/models/connectivityParameters.js delete mode 100644 lib/services/networkManagement2/lib/models/connectivitySource.js delete mode 100644 lib/services/networkManagement2/lib/models/container.js delete mode 100644 lib/services/networkManagement2/lib/models/containerNetworkInterface.js delete mode 100644 lib/services/networkManagement2/lib/models/containerNetworkInterfaceConfiguration.js delete mode 100644 lib/services/networkManagement2/lib/models/containerNetworkInterfaceIpConfiguration.js delete mode 100644 lib/services/networkManagement2/lib/models/ddosProtectionPlan.js delete mode 100644 lib/services/networkManagement2/lib/models/ddosProtectionPlanListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/delegation.js delete mode 100644 lib/services/networkManagement2/lib/models/deviceProperties.js delete mode 100644 lib/services/networkManagement2/lib/models/dhcpOptions.js delete mode 100644 lib/services/networkManagement2/lib/models/dimension.js delete mode 100644 lib/services/networkManagement2/lib/models/dnsNameAvailabilityResult.js delete mode 100644 lib/services/networkManagement2/lib/models/effectiveNetworkSecurityGroup.js delete mode 100644 lib/services/networkManagement2/lib/models/effectiveNetworkSecurityGroupAssociation.js delete mode 100644 lib/services/networkManagement2/lib/models/effectiveNetworkSecurityGroupListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/effectiveNetworkSecurityRule.js delete mode 100644 lib/services/networkManagement2/lib/models/effectiveRoute.js delete mode 100644 lib/services/networkManagement2/lib/models/effectiveRouteListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/endpointService.js delete mode 100644 lib/services/networkManagement2/lib/models/endpointServiceResult.js delete mode 100644 lib/services/networkManagement2/lib/models/endpointServicesListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/errorDetails.js delete mode 100644 lib/services/networkManagement2/lib/models/errorModel.js delete mode 100644 lib/services/networkManagement2/lib/models/errorResponse.js delete mode 100644 lib/services/networkManagement2/lib/models/evaluatedNetworkSecurityGroup.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteCircuit.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteCircuitArpTable.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteCircuitAuthorization.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteCircuitConnection.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteCircuitConnectionListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteCircuitListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteCircuitPeering.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteCircuitPeeringConfig.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteCircuitPeeringId.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteCircuitPeeringListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteCircuitReference.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteCircuitRoutesTable.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteCircuitRoutesTableSummary.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteCircuitServiceProviderProperties.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteCircuitSku.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteCircuitStats.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteCircuitsArpTableListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteCircuitsRoutesTableListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteCircuitsRoutesTableSummaryListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteConnection.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteConnectionId.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteConnectionList.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteCrossConnection.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteCrossConnectionListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteCrossConnectionPeering.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteCrossConnectionPeeringList.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteCrossConnectionRoutesTableSummary.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteCrossConnectionsRoutesTableSummaryListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteGateway.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteGatewayList.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteGatewayPropertiesAutoScaleConfiguration.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteGatewayPropertiesAutoScaleConfigurationBounds.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteLink.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteLinkListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRoutePort.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRoutePortListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRoutePortsLocation.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRoutePortsLocationBandwidths.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRoutePortsLocationListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteServiceProvider.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteServiceProviderBandwidthsOffered.js delete mode 100644 lib/services/networkManagement2/lib/models/expressRouteServiceProviderListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/flowLogFormatParameters.js delete mode 100644 lib/services/networkManagement2/lib/models/flowLogInformation.js delete mode 100644 lib/services/networkManagement2/lib/models/flowLogStatusParameters.js delete mode 100644 lib/services/networkManagement2/lib/models/frontendIPConfiguration.js delete mode 100644 lib/services/networkManagement2/lib/models/gatewayRoute.js delete mode 100644 lib/services/networkManagement2/lib/models/gatewayRouteListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/getVpnSitesConfigurationRequest.js delete mode 100644 lib/services/networkManagement2/lib/models/hTTPConfiguration.js delete mode 100644 lib/services/networkManagement2/lib/models/hTTPHeader.js delete mode 100644 lib/services/networkManagement2/lib/models/httpConfiguration.js delete mode 100644 lib/services/networkManagement2/lib/models/hubVirtualNetworkConnection.js delete mode 100644 lib/services/networkManagement2/lib/models/iPAddressAvailabilityResult.js delete mode 100644 lib/services/networkManagement2/lib/models/iPConfiguration.js delete mode 100644 lib/services/networkManagement2/lib/models/iPConfigurationProfile.js delete mode 100644 lib/services/networkManagement2/lib/models/inboundNatPool.js delete mode 100644 lib/services/networkManagement2/lib/models/inboundNatRule.js delete mode 100644 lib/services/networkManagement2/lib/models/inboundNatRuleListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/index.d.ts delete mode 100644 lib/services/networkManagement2/lib/models/index.js delete mode 100644 lib/services/networkManagement2/lib/models/interfaceEndpoint.js delete mode 100644 lib/services/networkManagement2/lib/models/interfaceEndpointListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/ipTag.js delete mode 100644 lib/services/networkManagement2/lib/models/ipsecPolicy.js delete mode 100644 lib/services/networkManagement2/lib/models/ipv6ExpressRouteCircuitPeeringConfig.js delete mode 100644 lib/services/networkManagement2/lib/models/listHubVirtualNetworkConnectionsResult.js delete mode 100644 lib/services/networkManagement2/lib/models/listP2SVpnGatewaysResult.js delete mode 100644 lib/services/networkManagement2/lib/models/listP2SVpnServerConfigurationsResult.js delete mode 100644 lib/services/networkManagement2/lib/models/listVirtualHubsResult.js delete mode 100644 lib/services/networkManagement2/lib/models/listVirtualWANsResult.js delete mode 100644 lib/services/networkManagement2/lib/models/listVpnConnectionsResult.js delete mode 100644 lib/services/networkManagement2/lib/models/listVpnGatewaysResult.js delete mode 100644 lib/services/networkManagement2/lib/models/listVpnSitesResult.js delete mode 100644 lib/services/networkManagement2/lib/models/loadBalancer.js delete mode 100644 lib/services/networkManagement2/lib/models/loadBalancerBackendAddressPoolListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/loadBalancerFrontendIPConfigurationListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/loadBalancerListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/loadBalancerLoadBalancingRuleListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/loadBalancerOutboundRuleListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/loadBalancerProbeListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/loadBalancerSku.js delete mode 100644 lib/services/networkManagement2/lib/models/loadBalancingRule.js delete mode 100644 lib/services/networkManagement2/lib/models/localNetworkGateway.js delete mode 100644 lib/services/networkManagement2/lib/models/localNetworkGatewayListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/logSpecification.js delete mode 100644 lib/services/networkManagement2/lib/models/managedServiceIdentity.js delete mode 100644 lib/services/networkManagement2/lib/models/managedServiceIdentityUserAssignedIdentitiesValue.js delete mode 100644 lib/services/networkManagement2/lib/models/matchedRule.js delete mode 100644 lib/services/networkManagement2/lib/models/metricSpecification.js delete mode 100644 lib/services/networkManagement2/lib/models/networkConfigurationDiagnosticParameters.js delete mode 100644 lib/services/networkManagement2/lib/models/networkConfigurationDiagnosticProfile.js delete mode 100644 lib/services/networkManagement2/lib/models/networkConfigurationDiagnosticResponse.js delete mode 100644 lib/services/networkManagement2/lib/models/networkConfigurationDiagnosticResult.js delete mode 100644 lib/services/networkManagement2/lib/models/networkInterface.js delete mode 100644 lib/services/networkManagement2/lib/models/networkInterfaceAssociation.js delete mode 100644 lib/services/networkManagement2/lib/models/networkInterfaceDnsSettings.js delete mode 100644 lib/services/networkManagement2/lib/models/networkInterfaceIPConfiguration.js delete mode 100644 lib/services/networkManagement2/lib/models/networkInterfaceIPConfigurationListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/networkInterfaceListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/networkInterfaceLoadBalancerListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/networkInterfaceTapConfiguration.js delete mode 100644 lib/services/networkManagement2/lib/models/networkInterfaceTapConfigurationListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/networkProfile.js delete mode 100644 lib/services/networkManagement2/lib/models/networkProfileListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/networkSecurityGroup.js delete mode 100644 lib/services/networkManagement2/lib/models/networkSecurityGroupListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/networkSecurityGroupResult.js delete mode 100644 lib/services/networkManagement2/lib/models/networkSecurityRulesEvaluationResult.js delete mode 100644 lib/services/networkManagement2/lib/models/networkWatcher.js delete mode 100644 lib/services/networkManagement2/lib/models/networkWatcherListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/nextHopParameters.js delete mode 100644 lib/services/networkManagement2/lib/models/nextHopResult.js delete mode 100644 lib/services/networkManagement2/lib/models/operation.js delete mode 100644 lib/services/networkManagement2/lib/models/operationDisplay.js delete mode 100644 lib/services/networkManagement2/lib/models/operationListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/operationPropertiesFormatServiceSpecification.js delete mode 100644 lib/services/networkManagement2/lib/models/outboundRule.js delete mode 100644 lib/services/networkManagement2/lib/models/p2SVpnGateway.js delete mode 100644 lib/services/networkManagement2/lib/models/p2SVpnProfileParameters.js delete mode 100644 lib/services/networkManagement2/lib/models/p2SVpnServerConfigRadiusClientRootCertificate.js delete mode 100644 lib/services/networkManagement2/lib/models/p2SVpnServerConfigRadiusServerRootCertificate.js delete mode 100644 lib/services/networkManagement2/lib/models/p2SVpnServerConfigVpnClientRevokedCertificate.js delete mode 100644 lib/services/networkManagement2/lib/models/p2SVpnServerConfigVpnClientRootCertificate.js delete mode 100644 lib/services/networkManagement2/lib/models/p2SVpnServerConfiguration.js delete mode 100644 lib/services/networkManagement2/lib/models/packetCapture.js delete mode 100644 lib/services/networkManagement2/lib/models/packetCaptureFilter.js delete mode 100644 lib/services/networkManagement2/lib/models/packetCaptureListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/packetCaptureParameters.js delete mode 100644 lib/services/networkManagement2/lib/models/packetCaptureQueryStatusResult.js delete mode 100644 lib/services/networkManagement2/lib/models/packetCaptureResult.js delete mode 100644 lib/services/networkManagement2/lib/models/packetCaptureStorageLocation.js delete mode 100644 lib/services/networkManagement2/lib/models/patchRouteFilter.js delete mode 100644 lib/services/networkManagement2/lib/models/patchRouteFilterRule.js delete mode 100644 lib/services/networkManagement2/lib/models/probe.js delete mode 100644 lib/services/networkManagement2/lib/models/protocolConfiguration.js delete mode 100644 lib/services/networkManagement2/lib/models/publicIPAddress.js delete mode 100644 lib/services/networkManagement2/lib/models/publicIPAddressDnsSettings.js delete mode 100644 lib/services/networkManagement2/lib/models/publicIPAddressListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/publicIPAddressSku.js delete mode 100644 lib/services/networkManagement2/lib/models/publicIPPrefix.js delete mode 100644 lib/services/networkManagement2/lib/models/publicIPPrefixListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/publicIPPrefixSku.js delete mode 100644 lib/services/networkManagement2/lib/models/queryTroubleshootingParameters.js delete mode 100644 lib/services/networkManagement2/lib/models/referencedPublicIpAddress.js delete mode 100644 lib/services/networkManagement2/lib/models/resource.js delete mode 100644 lib/services/networkManagement2/lib/models/resourceNavigationLink.js delete mode 100644 lib/services/networkManagement2/lib/models/retentionPolicyParameters.js delete mode 100644 lib/services/networkManagement2/lib/models/route.js delete mode 100644 lib/services/networkManagement2/lib/models/routeFilter.js delete mode 100644 lib/services/networkManagement2/lib/models/routeFilterListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/routeFilterRule.js delete mode 100644 lib/services/networkManagement2/lib/models/routeFilterRuleListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/routeListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/routeTable.js delete mode 100644 lib/services/networkManagement2/lib/models/routeTableListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/securityGroupNetworkInterface.js delete mode 100644 lib/services/networkManagement2/lib/models/securityGroupViewParameters.js delete mode 100644 lib/services/networkManagement2/lib/models/securityGroupViewResult.js delete mode 100644 lib/services/networkManagement2/lib/models/securityRule.js delete mode 100644 lib/services/networkManagement2/lib/models/securityRuleAssociations.js delete mode 100644 lib/services/networkManagement2/lib/models/securityRuleListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/serviceAssociationLink.js delete mode 100644 lib/services/networkManagement2/lib/models/serviceEndpointPolicy.js delete mode 100644 lib/services/networkManagement2/lib/models/serviceEndpointPolicyDefinition.js delete mode 100644 lib/services/networkManagement2/lib/models/serviceEndpointPolicyDefinitionListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/serviceEndpointPolicyListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/serviceEndpointPropertiesFormat.js delete mode 100644 lib/services/networkManagement2/lib/models/subResource.js delete mode 100644 lib/services/networkManagement2/lib/models/subnet.js delete mode 100644 lib/services/networkManagement2/lib/models/subnetAssociation.js delete mode 100644 lib/services/networkManagement2/lib/models/subnetListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/tagsObject.js delete mode 100644 lib/services/networkManagement2/lib/models/topology.js delete mode 100644 lib/services/networkManagement2/lib/models/topologyAssociation.js delete mode 100644 lib/services/networkManagement2/lib/models/topologyParameters.js delete mode 100644 lib/services/networkManagement2/lib/models/topologyResource.js delete mode 100644 lib/services/networkManagement2/lib/models/trafficAnalyticsConfigurationProperties.js delete mode 100644 lib/services/networkManagement2/lib/models/trafficAnalyticsProperties.js delete mode 100644 lib/services/networkManagement2/lib/models/trafficQuery.js delete mode 100644 lib/services/networkManagement2/lib/models/troubleshootingDetails.js delete mode 100644 lib/services/networkManagement2/lib/models/troubleshootingParameters.js delete mode 100644 lib/services/networkManagement2/lib/models/troubleshootingRecommendedActions.js delete mode 100644 lib/services/networkManagement2/lib/models/troubleshootingResult.js delete mode 100644 lib/services/networkManagement2/lib/models/tunnelConnectionHealth.js delete mode 100644 lib/services/networkManagement2/lib/models/usage.js delete mode 100644 lib/services/networkManagement2/lib/models/usageName.js delete mode 100644 lib/services/networkManagement2/lib/models/usagesListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/verificationIPFlowParameters.js delete mode 100644 lib/services/networkManagement2/lib/models/verificationIPFlowResult.js delete mode 100644 lib/services/networkManagement2/lib/models/virtualHub.js delete mode 100644 lib/services/networkManagement2/lib/models/virtualHubId.js delete mode 100644 lib/services/networkManagement2/lib/models/virtualHubRoute.js delete mode 100644 lib/services/networkManagement2/lib/models/virtualHubRouteTable.js delete mode 100644 lib/services/networkManagement2/lib/models/virtualNetwork.js delete mode 100644 lib/services/networkManagement2/lib/models/virtualNetworkConnectionGatewayReference.js delete mode 100644 lib/services/networkManagement2/lib/models/virtualNetworkGateway.js delete mode 100644 lib/services/networkManagement2/lib/models/virtualNetworkGatewayConnection.js delete mode 100644 lib/services/networkManagement2/lib/models/virtualNetworkGatewayConnectionListEntity.js delete mode 100644 lib/services/networkManagement2/lib/models/virtualNetworkGatewayConnectionListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/virtualNetworkGatewayIPConfiguration.js delete mode 100644 lib/services/networkManagement2/lib/models/virtualNetworkGatewayListConnectionsResult.js delete mode 100644 lib/services/networkManagement2/lib/models/virtualNetworkGatewayListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/virtualNetworkGatewaySku.js delete mode 100644 lib/services/networkManagement2/lib/models/virtualNetworkListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/virtualNetworkListUsageResult.js delete mode 100644 lib/services/networkManagement2/lib/models/virtualNetworkPeering.js delete mode 100644 lib/services/networkManagement2/lib/models/virtualNetworkPeeringListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/virtualNetworkTap.js delete mode 100644 lib/services/networkManagement2/lib/models/virtualNetworkTapListResult.js delete mode 100644 lib/services/networkManagement2/lib/models/virtualNetworkUsage.js delete mode 100644 lib/services/networkManagement2/lib/models/virtualNetworkUsageName.js delete mode 100644 lib/services/networkManagement2/lib/models/virtualWAN.js delete mode 100644 lib/services/networkManagement2/lib/models/virtualWanSecurityProvider.js delete mode 100644 lib/services/networkManagement2/lib/models/virtualWanSecurityProviders.js delete mode 100644 lib/services/networkManagement2/lib/models/vpnClientConfiguration.js delete mode 100644 lib/services/networkManagement2/lib/models/vpnClientConnectionHealth.js delete mode 100644 lib/services/networkManagement2/lib/models/vpnClientIPsecParameters.js delete mode 100644 lib/services/networkManagement2/lib/models/vpnClientParameters.js delete mode 100644 lib/services/networkManagement2/lib/models/vpnClientRevokedCertificate.js delete mode 100644 lib/services/networkManagement2/lib/models/vpnClientRootCertificate.js delete mode 100644 lib/services/networkManagement2/lib/models/vpnConnection.js delete mode 100644 lib/services/networkManagement2/lib/models/vpnDeviceScriptParameters.js delete mode 100644 lib/services/networkManagement2/lib/models/vpnGateway.js delete mode 100644 lib/services/networkManagement2/lib/models/vpnProfileResponse.js delete mode 100644 lib/services/networkManagement2/lib/models/vpnSite.js delete mode 100644 lib/services/networkManagement2/lib/models/vpnSiteId.js delete mode 100644 lib/services/networkManagement2/lib/networkManagementClient.d.ts delete mode 100644 lib/services/networkManagement2/lib/networkManagementClient.js delete mode 100644 lib/services/networkManagement2/lib/operations/applicationGateways.js delete mode 100644 lib/services/networkManagement2/lib/operations/applicationSecurityGroups.js delete mode 100644 lib/services/networkManagement2/lib/operations/availableDelegations.js delete mode 100644 lib/services/networkManagement2/lib/operations/availableEndpointServices.js delete mode 100644 lib/services/networkManagement2/lib/operations/availableResourceGroupDelegations.js delete mode 100644 lib/services/networkManagement2/lib/operations/azureFirewallFqdnTags.js delete mode 100644 lib/services/networkManagement2/lib/operations/azureFirewalls.js delete mode 100644 lib/services/networkManagement2/lib/operations/bgpServiceCommunities.js delete mode 100644 lib/services/networkManagement2/lib/operations/connectionMonitors.js delete mode 100644 lib/services/networkManagement2/lib/operations/ddosProtectionPlans.js delete mode 100644 lib/services/networkManagement2/lib/operations/defaultSecurityRules.js delete mode 100644 lib/services/networkManagement2/lib/operations/expressRouteCircuitAuthorizations.js delete mode 100644 lib/services/networkManagement2/lib/operations/expressRouteCircuitConnections.js delete mode 100644 lib/services/networkManagement2/lib/operations/expressRouteCircuitPeerings.js delete mode 100644 lib/services/networkManagement2/lib/operations/expressRouteCircuits.js delete mode 100644 lib/services/networkManagement2/lib/operations/expressRouteConnections.js delete mode 100644 lib/services/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js delete mode 100644 lib/services/networkManagement2/lib/operations/expressRouteCrossConnections.js delete mode 100644 lib/services/networkManagement2/lib/operations/expressRouteGateways.js delete mode 100644 lib/services/networkManagement2/lib/operations/expressRouteLinks.js delete mode 100644 lib/services/networkManagement2/lib/operations/expressRoutePorts.js delete mode 100644 lib/services/networkManagement2/lib/operations/expressRoutePortsLocations.js delete mode 100644 lib/services/networkManagement2/lib/operations/expressRouteServiceProviders.js delete mode 100644 lib/services/networkManagement2/lib/operations/hubVirtualNetworkConnections.js delete mode 100644 lib/services/networkManagement2/lib/operations/inboundNatRules.js delete mode 100644 lib/services/networkManagement2/lib/operations/index.d.ts delete mode 100644 lib/services/networkManagement2/lib/operations/index.js delete mode 100644 lib/services/networkManagement2/lib/operations/interfaceEndpoints.js delete mode 100644 lib/services/networkManagement2/lib/operations/loadBalancerBackendAddressPools.js delete mode 100644 lib/services/networkManagement2/lib/operations/loadBalancerFrontendIPConfigurations.js delete mode 100644 lib/services/networkManagement2/lib/operations/loadBalancerLoadBalancingRules.js delete mode 100644 lib/services/networkManagement2/lib/operations/loadBalancerNetworkInterfaces.js delete mode 100644 lib/services/networkManagement2/lib/operations/loadBalancerOutboundRules.js delete mode 100644 lib/services/networkManagement2/lib/operations/loadBalancerProbes.js delete mode 100644 lib/services/networkManagement2/lib/operations/loadBalancers.js delete mode 100644 lib/services/networkManagement2/lib/operations/localNetworkGateways.js delete mode 100644 lib/services/networkManagement2/lib/operations/networkInterfaceIPConfigurations.js delete mode 100644 lib/services/networkManagement2/lib/operations/networkInterfaceLoadBalancers.js delete mode 100644 lib/services/networkManagement2/lib/operations/networkInterfaceTapConfigurations.js delete mode 100644 lib/services/networkManagement2/lib/operations/networkInterfaces.js delete mode 100644 lib/services/networkManagement2/lib/operations/networkProfiles.js delete mode 100644 lib/services/networkManagement2/lib/operations/networkSecurityGroups.js delete mode 100644 lib/services/networkManagement2/lib/operations/networkWatchers.js delete mode 100644 lib/services/networkManagement2/lib/operations/operations.js delete mode 100644 lib/services/networkManagement2/lib/operations/p2sVpnGateways.js delete mode 100644 lib/services/networkManagement2/lib/operations/p2sVpnServerConfigurations.js delete mode 100644 lib/services/networkManagement2/lib/operations/packetCaptures.js delete mode 100644 lib/services/networkManagement2/lib/operations/publicIPAddresses.js delete mode 100644 lib/services/networkManagement2/lib/operations/publicIPPrefixes.js delete mode 100644 lib/services/networkManagement2/lib/operations/routeFilterRules.js delete mode 100644 lib/services/networkManagement2/lib/operations/routeFilters.js delete mode 100644 lib/services/networkManagement2/lib/operations/routeTables.js delete mode 100644 lib/services/networkManagement2/lib/operations/routes.js delete mode 100644 lib/services/networkManagement2/lib/operations/securityRules.js delete mode 100644 lib/services/networkManagement2/lib/operations/serviceEndpointPolicies.js delete mode 100644 lib/services/networkManagement2/lib/operations/serviceEndpointPolicyDefinitions.js delete mode 100644 lib/services/networkManagement2/lib/operations/subnets.js delete mode 100644 lib/services/networkManagement2/lib/operations/usages.js delete mode 100644 lib/services/networkManagement2/lib/operations/virtualHubs.js delete mode 100644 lib/services/networkManagement2/lib/operations/virtualNetworkGatewayConnections.js delete mode 100644 lib/services/networkManagement2/lib/operations/virtualNetworkGateways.js delete mode 100644 lib/services/networkManagement2/lib/operations/virtualNetworkPeerings.js delete mode 100644 lib/services/networkManagement2/lib/operations/virtualNetworkTaps.js delete mode 100644 lib/services/networkManagement2/lib/operations/virtualNetworks.js delete mode 100644 lib/services/networkManagement2/lib/operations/virtualWANs.js delete mode 100644 lib/services/networkManagement2/lib/operations/virtualWans.js delete mode 100644 lib/services/networkManagement2/lib/operations/vpnConnections.js delete mode 100644 lib/services/networkManagement2/lib/operations/vpnGateways.js delete mode 100644 lib/services/networkManagement2/lib/operations/vpnSites.js delete mode 100644 lib/services/networkManagement2/lib/operations/vpnSitesConfiguration.js diff --git a/lib/services/networkManagement2/lib/models/addressSpace.js b/lib/services/networkManagement2/lib/models/addressSpace.js deleted file mode 100644 index 7c4551453..000000000 --- a/lib/services/networkManagement2/lib/models/addressSpace.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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'; - -/** - * AddressSpace contains an array of IP address ranges that can be used by - * subnets of the virtual network. - * - */ -class AddressSpace { - /** - * Create a AddressSpace. - * @property {array} [addressPrefixes] A list of address blocks reserved for - * this virtual network in CIDR notation. - */ - constructor() { - } - - /** - * Defines the metadata of AddressSpace - * - * @returns {object} metadata of AddressSpace - * - */ - mapper() { - return { - required: false, - serializedName: 'AddressSpace', - type: { - name: 'Composite', - className: 'AddressSpace', - modelProperties: { - addressPrefixes: { - required: false, - serializedName: 'addressPrefixes', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - } - } - } - }; - } -} - -module.exports = AddressSpace; diff --git a/lib/services/networkManagement2/lib/models/applicationGateway.js b/lib/services/networkManagement2/lib/models/applicationGateway.js deleted file mode 100644 index 13f5cef0c..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGateway.js +++ /dev/null @@ -1,529 +0,0 @@ -/* - * 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'); - -/** - * Application gateway resource - * - * @extends models['Resource'] - */ -class ApplicationGateway extends models['Resource'] { - /** - * Create a ApplicationGateway. - * @property {object} [sku] SKU of the application gateway resource. - * @property {string} [sku.name] Name of an application gateway SKU. Possible - * values include: 'Standard_Small', 'Standard_Medium', 'Standard_Large', - * 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' - * @property {string} [sku.tier] Tier of an application gateway. Possible - * values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' - * @property {number} [sku.capacity] Capacity (instance count) of an - * application gateway. - * @property {object} [sslPolicy] SSL policy of the application gateway - * resource. - * @property {array} [sslPolicy.disabledSslProtocols] Ssl protocols to be - * disabled on application gateway. - * @property {string} [sslPolicy.policyType] Type of Ssl Policy. Possible - * values include: 'Predefined', 'Custom' - * @property {string} [sslPolicy.policyName] Name of Ssl predefined policy. - * Possible values include: 'AppGwSslPolicy20150501', - * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' - * @property {array} [sslPolicy.cipherSuites] Ssl cipher suites to be enabled - * in the specified order to application gateway. - * @property {string} [sslPolicy.minProtocolVersion] Minimum version of Ssl - * protocol to be supported on application gateway. Possible values include: - * 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' - * @property {string} [operationalState] Operational state of the application - * gateway resource. Possible values include: 'Stopped', 'Starting', - * 'Running', 'Stopping' - * @property {array} [gatewayIPConfigurations] Subnets of application the - * gateway resource. - * @property {array} [authenticationCertificates] Authentication certificates - * of the application gateway resource. - * @property {array} [trustedRootCertificates] Trusted Root certificates of - * the application gateway resource. - * @property {array} [sslCertificates] SSL certificates of the application - * gateway resource. - * @property {array} [frontendIPConfigurations] Frontend IP addresses of the - * application gateway resource. - * @property {array} [frontendPorts] Frontend ports of the application - * gateway resource. - * @property {array} [probes] Probes of the application gateway resource. - * @property {array} [backendAddressPools] Backend address pool of the - * application gateway resource. - * @property {array} [backendHttpSettingsCollection] Backend http settings of - * the application gateway resource. - * @property {array} [httpListeners] Http listeners of the application - * gateway resource. - * @property {array} [urlPathMaps] URL path map of the application gateway - * resource. - * @property {array} [requestRoutingRules] Request routing rules of the - * application gateway resource. - * @property {array} [rewriteRuleSets] Rewrite rules for the application - * gateway resource. - * @property {array} [redirectConfigurations] Redirect configurations of the - * application gateway resource. - * @property {object} [webApplicationFirewallConfiguration] Web application - * firewall configuration. - * @property {boolean} [webApplicationFirewallConfiguration.enabled] Whether - * the web application firewall is enabled or not. - * @property {string} [webApplicationFirewallConfiguration.firewallMode] Web - * application firewall mode. Possible values include: 'Detection', - * 'Prevention' - * @property {string} [webApplicationFirewallConfiguration.ruleSetType] The - * type of the web application firewall rule set. Possible values are: - * 'OWASP'. - * @property {string} [webApplicationFirewallConfiguration.ruleSetVersion] - * The version of the rule set type. - * @property {array} [webApplicationFirewallConfiguration.disabledRuleGroups] - * The disabled rule groups. - * @property {boolean} [webApplicationFirewallConfiguration.requestBodyCheck] - * Whether allow WAF to check request Body. - * @property {number} - * [webApplicationFirewallConfiguration.maxRequestBodySize] Maxium request - * body size for WAF. - * @property {number} - * [webApplicationFirewallConfiguration.maxRequestBodySizeInKb] Maxium - * request body size in Kb for WAF. - * @property {number} - * [webApplicationFirewallConfiguration.fileUploadLimitInMb] Maxium file - * upload size in Mb for WAF. - * @property {array} [webApplicationFirewallConfiguration.exclusions] The - * exclusion list. - * @property {boolean} [enableHttp2] Whether HTTP2 is enabled on the - * application gateway resource. - * @property {boolean} [enableFips] Whether FIPS is enabled on the - * application gateway resource. - * @property {object} [autoscaleConfiguration] Autoscale Configuration. - * @property {number} [autoscaleConfiguration.minCapacity] Lower bound on - * number of Application Gateway instances - * @property {string} [resourceGuid] Resource GUID property of the - * application gateway resource. - * @property {string} [provisioningState] Provisioning state of the - * application gateway resource. Possible values are: 'Updating', 'Deleting', - * and 'Failed'. - * @property {array} [customErrorConfigurations] Custom error configurations - * of the application gateway resource. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {array} [zones] A list of availability zones denoting where the - * resource needs to come from. - * @property {object} [identity] The identity of the application gateway, if - * configured. - * @property {string} [identity.principalId] The principal id of the system - * assigned identity. This property will only be provided for a system - * assigned identity. - * @property {string} [identity.tenantId] The tenant id of the system - * assigned identity. This property will only be provided for a system - * assigned identity. - * @property {string} [identity.type] The type of identity used for the - * resource. The type 'SystemAssigned, UserAssigned' includes both an - * implicitly created identity and a set of user assigned identities. The - * type 'None' will remove any identities from the virtual machine. Possible - * values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, - * UserAssigned', 'None' - * @property {object} [identity.userAssignedIdentities] The list of user - * identities associated with resource. The user identity dictionary key - * references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ApplicationGateway - * - * @returns {object} metadata of ApplicationGateway - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGateway', - type: { - name: 'Composite', - className: 'ApplicationGateway', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - sku: { - required: false, - serializedName: 'properties.sku', - type: { - name: 'Composite', - className: 'ApplicationGatewaySku' - } - }, - sslPolicy: { - required: false, - serializedName: 'properties.sslPolicy', - type: { - name: 'Composite', - className: 'ApplicationGatewaySslPolicy' - } - }, - operationalState: { - required: false, - readOnly: true, - serializedName: 'properties.operationalState', - type: { - name: 'String' - } - }, - gatewayIPConfigurations: { - required: false, - serializedName: 'properties.gatewayIPConfigurations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayIPConfigurationElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayIPConfiguration' - } - } - } - }, - authenticationCertificates: { - required: false, - serializedName: 'properties.authenticationCertificates', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayAuthenticationCertificateElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayAuthenticationCertificate' - } - } - } - }, - trustedRootCertificates: { - required: false, - serializedName: 'properties.trustedRootCertificates', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayTrustedRootCertificateElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayTrustedRootCertificate' - } - } - } - }, - sslCertificates: { - required: false, - serializedName: 'properties.sslCertificates', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewaySslCertificateElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewaySslCertificate' - } - } - } - }, - frontendIPConfigurations: { - required: false, - serializedName: 'properties.frontendIPConfigurations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayFrontendIPConfigurationElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayFrontendIPConfiguration' - } - } - } - }, - frontendPorts: { - required: false, - serializedName: 'properties.frontendPorts', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayFrontendPortElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayFrontendPort' - } - } - } - }, - probes: { - required: false, - serializedName: 'properties.probes', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayProbeElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayProbe' - } - } - } - }, - backendAddressPools: { - required: false, - serializedName: 'properties.backendAddressPools', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayBackendAddressPoolElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayBackendAddressPool' - } - } - } - }, - backendHttpSettingsCollection: { - required: false, - serializedName: 'properties.backendHttpSettingsCollection', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayBackendHttpSettingsElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayBackendHttpSettings' - } - } - } - }, - httpListeners: { - required: false, - serializedName: 'properties.httpListeners', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayHttpListenerElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayHttpListener' - } - } - } - }, - urlPathMaps: { - required: false, - serializedName: 'properties.urlPathMaps', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayUrlPathMapElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayUrlPathMap' - } - } - } - }, - requestRoutingRules: { - required: false, - serializedName: 'properties.requestRoutingRules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayRequestRoutingRuleElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayRequestRoutingRule' - } - } - } - }, - rewriteRuleSets: { - required: false, - serializedName: 'properties.rewriteRuleSets', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayRewriteRuleSetElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayRewriteRuleSet' - } - } - } - }, - redirectConfigurations: { - required: false, - serializedName: 'properties.redirectConfigurations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayRedirectConfigurationElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayRedirectConfiguration' - } - } - } - }, - webApplicationFirewallConfiguration: { - required: false, - serializedName: 'properties.webApplicationFirewallConfiguration', - type: { - name: 'Composite', - className: 'ApplicationGatewayWebApplicationFirewallConfiguration' - } - }, - enableHttp2: { - required: false, - serializedName: 'properties.enableHttp2', - type: { - name: 'Boolean' - } - }, - enableFips: { - required: false, - serializedName: 'properties.enableFips', - type: { - name: 'Boolean' - } - }, - autoscaleConfiguration: { - required: false, - serializedName: 'properties.autoscaleConfiguration', - type: { - name: 'Composite', - className: 'ApplicationGatewayAutoscaleConfiguration' - } - }, - resourceGuid: { - required: false, - serializedName: 'properties.resourceGuid', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - customErrorConfigurations: { - required: false, - serializedName: 'properties.customErrorConfigurations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayCustomErrorElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayCustomError' - } - } - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - }, - zones: { - required: false, - serializedName: 'zones', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - identity: { - required: false, - serializedName: 'identity', - type: { - name: 'Composite', - className: 'ManagedServiceIdentity' - } - } - } - } - }; - } -} - -module.exports = ApplicationGateway; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayAuthenticationCertificate.js b/lib/services/networkManagement2/lib/models/applicationGatewayAuthenticationCertificate.js deleted file mode 100644 index ae95640a1..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayAuthenticationCertificate.js +++ /dev/null @@ -1,99 +0,0 @@ -/* - * 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'); - -/** - * Authentication certificates of an application gateway. - * - * @extends models['SubResource'] - */ -class ApplicationGatewayAuthenticationCertificate extends models['SubResource'] { - /** - * Create a ApplicationGatewayAuthenticationCertificate. - * @property {string} [data] Certificate public data. - * @property {string} [provisioningState] Provisioning state of the - * authentication certificate resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [name] Name of the authentication certificate that is - * unique within an Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ApplicationGatewayAuthenticationCertificate - * - * @returns {object} metadata of ApplicationGatewayAuthenticationCertificate - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayAuthenticationCertificate', - type: { - name: 'Composite', - className: 'ApplicationGatewayAuthenticationCertificate', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - data: { - required: false, - serializedName: 'properties.data', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - }, - type: { - required: false, - serializedName: 'type', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayAuthenticationCertificate; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayAutoscaleConfiguration.js b/lib/services/networkManagement2/lib/models/applicationGatewayAutoscaleConfiguration.js deleted file mode 100644 index 8edff41c3..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayAutoscaleConfiguration.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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'; - -/** - * Application Gateway autoscale configuration. - * - */ -class ApplicationGatewayAutoscaleConfiguration { - /** - * Create a ApplicationGatewayAutoscaleConfiguration. - * @property {number} minCapacity Lower bound on number of Application - * Gateway instances - */ - constructor() { - } - - /** - * Defines the metadata of ApplicationGatewayAutoscaleConfiguration - * - * @returns {object} metadata of ApplicationGatewayAutoscaleConfiguration - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayAutoscaleConfiguration', - type: { - name: 'Composite', - className: 'ApplicationGatewayAutoscaleConfiguration', - modelProperties: { - minCapacity: { - required: true, - serializedName: 'minCapacity', - constraints: { - InclusiveMinimum: 2 - }, - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayAutoscaleConfiguration; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayAvailableSslOptions.js b/lib/services/networkManagement2/lib/models/applicationGatewayAvailableSslOptions.js deleted file mode 100644 index 333ec1364..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayAvailableSslOptions.js +++ /dev/null @@ -1,151 +0,0 @@ -/* - * 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'); - -/** - * Response for ApplicationGatewayAvailableSslOptions API service call. - * - * @extends models['Resource'] - */ -class ApplicationGatewayAvailableSslOptions extends models['Resource'] { - /** - * Create a ApplicationGatewayAvailableSslOptions. - * @property {array} [predefinedPolicies] List of available Ssl predefined - * policy. - * @property {string} [defaultPolicy] Name of the Ssl predefined policy - * applied by default to application gateway. Possible values include: - * 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', - * 'AppGwSslPolicy20170401S' - * @property {array} [availableCipherSuites] List of available Ssl cipher - * suites. - * @property {array} [availableProtocols] List of available Ssl protocols. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ApplicationGatewayAvailableSslOptions - * - * @returns {object} metadata of ApplicationGatewayAvailableSslOptions - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayAvailableSslOptions', - type: { - name: 'Composite', - className: 'ApplicationGatewayAvailableSslOptions', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - predefinedPolicies: { - required: false, - serializedName: 'properties.predefinedPolicies', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SubResourceElementType', - type: { - name: 'Composite', - className: 'SubResource' - } - } - } - }, - defaultPolicy: { - required: false, - serializedName: 'properties.defaultPolicy', - type: { - name: 'String' - } - }, - availableCipherSuites: { - required: false, - serializedName: 'properties.availableCipherSuites', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewaySslCipherSuiteElementType', - type: { - name: 'String' - } - } - } - }, - availableProtocols: { - required: false, - serializedName: 'properties.availableProtocols', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewaySslProtocolElementType', - type: { - name: 'String' - } - } - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayAvailableSslOptions; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayAvailableSslPredefinedPolicies.js b/lib/services/networkManagement2/lib/models/applicationGatewayAvailableSslPredefinedPolicies.js deleted file mode 100644 index 7642105f3..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayAvailableSslPredefinedPolicies.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 ApplicationGatewayAvailableSslOptions API service call. - */ -class ApplicationGatewayAvailableSslPredefinedPolicies extends Array { - /** - * Create a ApplicationGatewayAvailableSslPredefinedPolicies. - * @property {string} [nextLink] URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ApplicationGatewayAvailableSslPredefinedPolicies - * - * @returns {object} metadata of ApplicationGatewayAvailableSslPredefinedPolicies - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayAvailableSslPredefinedPolicies', - type: { - name: 'Composite', - className: 'ApplicationGatewayAvailableSslPredefinedPolicies', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewaySslPredefinedPolicyElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewaySslPredefinedPolicy' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayAvailableSslPredefinedPolicies; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayAvailableWafRuleSetsResult.js b/lib/services/networkManagement2/lib/models/applicationGatewayAvailableWafRuleSetsResult.js deleted file mode 100644 index 1de40eefb..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayAvailableWafRuleSetsResult.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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 ApplicationGatewayAvailableWafRuleSets API service call. - * - */ -class ApplicationGatewayAvailableWafRuleSetsResult { - /** - * Create a ApplicationGatewayAvailableWafRuleSetsResult. - * @property {array} [value] The list of application gateway rule sets. - */ - constructor() { - } - - /** - * Defines the metadata of ApplicationGatewayAvailableWafRuleSetsResult - * - * @returns {object} metadata of ApplicationGatewayAvailableWafRuleSetsResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayAvailableWafRuleSetsResult', - type: { - name: 'Composite', - className: 'ApplicationGatewayAvailableWafRuleSetsResult', - modelProperties: { - value: { - required: false, - serializedName: 'value', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayFirewallRuleSetElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayFirewallRuleSet' - } - } - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayAvailableWafRuleSetsResult; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayBackendAddress.js b/lib/services/networkManagement2/lib/models/applicationGatewayBackendAddress.js deleted file mode 100644 index 80857ebfc..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayBackendAddress.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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'; - -/** - * Backend address of an application gateway. - * - */ -class ApplicationGatewayBackendAddress { - /** - * Create a ApplicationGatewayBackendAddress. - * @property {string} [fqdn] Fully qualified domain name (FQDN). - * @property {string} [ipAddress] IP address - */ - constructor() { - } - - /** - * Defines the metadata of ApplicationGatewayBackendAddress - * - * @returns {object} metadata of ApplicationGatewayBackendAddress - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayBackendAddress', - type: { - name: 'Composite', - className: 'ApplicationGatewayBackendAddress', - modelProperties: { - fqdn: { - required: false, - serializedName: 'fqdn', - type: { - name: 'String' - } - }, - ipAddress: { - required: false, - serializedName: 'ipAddress', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayBackendAddress; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayBackendAddressPool.js b/lib/services/networkManagement2/lib/models/applicationGatewayBackendAddressPool.js deleted file mode 100644 index e21e4c292..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayBackendAddressPool.js +++ /dev/null @@ -1,124 +0,0 @@ -/* - * 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'); - -/** - * Backend Address Pool of an application gateway. - * - * @extends models['SubResource'] - */ -class ApplicationGatewayBackendAddressPool extends models['SubResource'] { - /** - * Create a ApplicationGatewayBackendAddressPool. - * @property {array} [backendIPConfigurations] Collection of references to - * IPs defined in network interfaces. - * @property {array} [backendAddresses] Backend addresses - * @property {string} [provisioningState] Provisioning state of the backend - * address pool resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [name] Name of the backend address pool that is unique - * within an Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ApplicationGatewayBackendAddressPool - * - * @returns {object} metadata of ApplicationGatewayBackendAddressPool - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayBackendAddressPool', - type: { - name: 'Composite', - className: 'ApplicationGatewayBackendAddressPool', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - backendIPConfigurations: { - required: false, - serializedName: 'properties.backendIPConfigurations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'NetworkInterfaceIPConfigurationElementType', - type: { - name: 'Composite', - className: 'NetworkInterfaceIPConfiguration' - } - } - } - }, - backendAddresses: { - required: false, - serializedName: 'properties.backendAddresses', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayBackendAddressElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayBackendAddress' - } - } - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - }, - type: { - required: false, - serializedName: 'type', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayBackendAddressPool; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealth.js b/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealth.js deleted file mode 100644 index f30fd6e3c..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealth.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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'; - -/** - * List of ApplicationGatewayBackendHealthPool resources. - * - */ -class ApplicationGatewayBackendHealth { - /** - * Create a ApplicationGatewayBackendHealth. - * @property {array} [backendAddressPools] - */ - constructor() { - } - - /** - * Defines the metadata of ApplicationGatewayBackendHealth - * - * @returns {object} metadata of ApplicationGatewayBackendHealth - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayBackendHealth', - type: { - name: 'Composite', - className: 'ApplicationGatewayBackendHealth', - modelProperties: { - backendAddressPools: { - required: false, - serializedName: 'backendAddressPools', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayBackendHealthPoolElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayBackendHealthPool' - } - } - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayBackendHealth; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthHttpSettings.js b/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthHttpSettings.js deleted file mode 100644 index 8ba9f04cb..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthHttpSettings.js +++ /dev/null @@ -1,117 +0,0 @@ -/* - * 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'; - -/** - * Application gateway BackendHealthHttp settings. - * - */ -class ApplicationGatewayBackendHealthHttpSettings { - /** - * Create a ApplicationGatewayBackendHealthHttpSettings. - * @property {object} [backendHttpSettings] Reference of an - * ApplicationGatewayBackendHttpSettings resource. - * @property {number} [backendHttpSettings.port] The destination port on the - * backend. - * @property {string} [backendHttpSettings.protocol] The protocol used to - * communicate with the backend. Possible values are 'Http' and 'Https'. - * Possible values include: 'Http', 'Https' - * @property {string} [backendHttpSettings.cookieBasedAffinity] Cookie based - * affinity. Possible values include: 'Enabled', 'Disabled' - * @property {number} [backendHttpSettings.requestTimeout] Request timeout in - * seconds. Application Gateway will fail the request if response is not - * received within RequestTimeout. Acceptable values are from 1 second to - * 86400 seconds. - * @property {object} [backendHttpSettings.probe] Probe resource of an - * application gateway. - * @property {string} [backendHttpSettings.probe.id] Resource ID. - * @property {array} [backendHttpSettings.authenticationCertificates] Array - * of references to application gateway authentication certificates. - * @property {array} [backendHttpSettings.trustedRootCertificates] Array of - * references to application gateway trusted root certificates. - * @property {object} [backendHttpSettings.connectionDraining] Connection - * draining of the backend http settings resource. - * @property {boolean} [backendHttpSettings.connectionDraining.enabled] - * Whether connection draining is enabled or not. - * @property {number} - * [backendHttpSettings.connectionDraining.drainTimeoutInSec] The number of - * seconds connection draining is active. Acceptable values are from 1 second - * to 3600 seconds. - * @property {string} [backendHttpSettings.hostName] Host header to be sent - * to the backend servers. - * @property {boolean} [backendHttpSettings.pickHostNameFromBackendAddress] - * Whether to pick host header should be picked from the host name of the - * backend server. Default value is false. - * @property {string} [backendHttpSettings.affinityCookieName] Cookie name to - * use for the affinity cookie. - * @property {boolean} [backendHttpSettings.probeEnabled] Whether the probe - * is enabled. Default value is false. - * @property {string} [backendHttpSettings.path] Path which should be used as - * a prefix for all HTTP requests. Null means no path will be prefixed. - * Default value is null. - * @property {string} [backendHttpSettings.provisioningState] Provisioning - * state of the backend http settings resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [backendHttpSettings.name] Name of the backend http - * settings that is unique within an Application Gateway. - * @property {string} [backendHttpSettings.etag] A unique read-only string - * that changes whenever the resource is updated. - * @property {string} [backendHttpSettings.type] Type of the resource. - * @property {array} [servers] List of ApplicationGatewayBackendHealthServer - * resources. - */ - constructor() { - } - - /** - * Defines the metadata of ApplicationGatewayBackendHealthHttpSettings - * - * @returns {object} metadata of ApplicationGatewayBackendHealthHttpSettings - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayBackendHealthHttpSettings', - type: { - name: 'Composite', - className: 'ApplicationGatewayBackendHealthHttpSettings', - modelProperties: { - backendHttpSettings: { - required: false, - serializedName: 'backendHttpSettings', - type: { - name: 'Composite', - className: 'ApplicationGatewayBackendHttpSettings' - } - }, - servers: { - required: false, - serializedName: 'servers', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayBackendHealthServerElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayBackendHealthServer' - } - } - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayBackendHealthHttpSettings; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthPool.js b/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthPool.js deleted file mode 100644 index ea1fec7ab..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthPool.js +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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'; - -/** - * Application gateway BackendHealth pool. - * - */ -class ApplicationGatewayBackendHealthPool { - /** - * Create a ApplicationGatewayBackendHealthPool. - * @property {object} [backendAddressPool] Reference of an - * ApplicationGatewayBackendAddressPool resource. - * @property {array} [backendAddressPool.backendIPConfigurations] Collection - * of references to IPs defined in network interfaces. - * @property {array} [backendAddressPool.backendAddresses] Backend addresses - * @property {string} [backendAddressPool.provisioningState] Provisioning - * state of the backend address pool resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [backendAddressPool.name] Name of the backend address - * pool that is unique within an Application Gateway. - * @property {string} [backendAddressPool.etag] A unique read-only string - * that changes whenever the resource is updated. - * @property {string} [backendAddressPool.type] Type of the resource. - * @property {array} [backendHttpSettingsCollection] List of - * ApplicationGatewayBackendHealthHttpSettings resources. - */ - constructor() { - } - - /** - * Defines the metadata of ApplicationGatewayBackendHealthPool - * - * @returns {object} metadata of ApplicationGatewayBackendHealthPool - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayBackendHealthPool', - type: { - name: 'Composite', - className: 'ApplicationGatewayBackendHealthPool', - modelProperties: { - backendAddressPool: { - required: false, - serializedName: 'backendAddressPool', - type: { - name: 'Composite', - className: 'ApplicationGatewayBackendAddressPool' - } - }, - backendHttpSettingsCollection: { - required: false, - serializedName: 'backendHttpSettingsCollection', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayBackendHealthHttpSettingsElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayBackendHealthHttpSettings' - } - } - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayBackendHealthPool; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthServer.js b/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthServer.js deleted file mode 100644 index a2831585f..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayBackendHealthServer.js +++ /dev/null @@ -1,336 +0,0 @@ -/* - * 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'; - -/** - * Application gateway backendhealth http settings. - * - */ -class ApplicationGatewayBackendHealthServer { - /** - * Create a ApplicationGatewayBackendHealthServer. - * @property {string} [address] IP address or FQDN of backend server. - * @property {object} [ipConfiguration] Reference of IP configuration of - * backend server. - * @property {array} [ipConfiguration.virtualNetworkTaps] The reference to - * Virtual Network Taps. - * @property {array} [ipConfiguration.applicationGatewayBackendAddressPools] - * The reference of ApplicationGatewayBackendAddressPool resource. - * @property {array} [ipConfiguration.loadBalancerBackendAddressPools] The - * reference of LoadBalancerBackendAddressPool resource. - * @property {array} [ipConfiguration.loadBalancerInboundNatRules] A list of - * references of LoadBalancerInboundNatRules. - * @property {string} [ipConfiguration.privateIPAddress] Private IP address - * of the IP configuration. - * @property {string} [ipConfiguration.privateIPAllocationMethod] Defines how - * a private IP address is assigned. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {string} [ipConfiguration.privateIPAddressVersion] Available - * from Api-Version 2016-03-30 onwards, it represents whether the specific - * ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible - * values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' - * @property {object} [ipConfiguration.subnet] Subnet bound to the IP - * configuration. - * @property {string} [ipConfiguration.subnet.addressPrefix] The address - * prefix for the subnet. - * @property {array} [ipConfiguration.subnet.addressPrefixes] List of - * address prefixes for the subnet. - * @property {object} [ipConfiguration.subnet.networkSecurityGroup] The - * reference of the NetworkSecurityGroup resource. - * @property {array} - * [ipConfiguration.subnet.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * @property {array} - * [ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * @property {array} - * [ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] A - * collection of references to network interfaces. - * @property {array} [ipConfiguration.subnet.networkSecurityGroup.subnets] A - * collection of references to subnets. - * @property {string} - * [ipConfiguration.subnet.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. - * @property {string} - * [ipConfiguration.subnet.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [ipConfiguration.subnet.networkSecurityGroup.etag] A - * unique read-only string that changes whenever the resource is updated. - * @property {object} [ipConfiguration.subnet.routeTable] The reference of - * the RouteTable resource. - * @property {array} [ipConfiguration.subnet.routeTable.routes] Collection of - * routes contained within a route table. - * @property {array} [ipConfiguration.subnet.routeTable.subnets] A collection - * of references to subnets. - * @property {boolean} - * [ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] Gets or - * sets whether to disable the routes learned by BGP on that route table. - * True means disable. - * @property {string} [ipConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [ipConfiguration.subnet.routeTable.etag] Gets a unique - * read-only string that changes whenever the resource is updated. - * @property {array} [ipConfiguration.subnet.serviceEndpoints] An array of - * service endpoints. - * @property {array} [ipConfiguration.subnet.serviceEndpointPolicies] An - * array of service endpoint policies. - * @property {array} [ipConfiguration.subnet.interfaceEndpoints] An array of - * references to interface endpoints - * @property {array} [ipConfiguration.subnet.ipConfigurations] Gets an array - * of references to the network interface IP configurations using subnet. - * @property {array} [ipConfiguration.subnet.ipConfigurationProfiles] Array - * of IP configuration profiles which reference this subnet. - * @property {array} [ipConfiguration.subnet.resourceNavigationLinks] Gets an - * array of references to the external resources using subnet. - * @property {array} [ipConfiguration.subnet.serviceAssociationLinks] Gets an - * array of references to services injecting into this subnet. - * @property {array} [ipConfiguration.subnet.delegations] Gets an array of - * references to the delegations on the subnet. - * @property {string} [ipConfiguration.subnet.purpose] A read-only string - * identifying the intention of use for this subnet based on delegations and - * other user-defined properties. - * @property {string} [ipConfiguration.subnet.provisioningState] The - * provisioning state of the resource. - * @property {string} [ipConfiguration.subnet.name] The name of the resource - * that is unique within a resource group. This name can be used to access - * the resource. - * @property {string} [ipConfiguration.subnet.etag] A unique read-only string - * that changes whenever the resource is updated. - * @property {boolean} [ipConfiguration.primary] Gets whether this is a - * primary customer address on the network interface. - * @property {object} [ipConfiguration.publicIPAddress] Public IP address - * bound to the IP configuration. - * @property {object} [ipConfiguration.publicIPAddress.sku] The public IP - * address SKU. - * @property {string} [ipConfiguration.publicIPAddress.sku.name] Name of a - * public IP address SKU. Possible values include: 'Basic', 'Standard' - * @property {string} - * [ipConfiguration.publicIPAddress.publicIPAllocationMethod] The public IP - * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' - * @property {string} - * [ipConfiguration.publicIPAddress.publicIPAddressVersion] The public IP - * address version. Possible values are: 'IPv4' and 'IPv6'. Possible values - * include: 'IPv4', 'IPv6' - * @property {object} [ipConfiguration.publicIPAddress.ipConfiguration] The - * IP configuration associated with the public IP address. - * @property {string} - * [ipConfiguration.publicIPAddress.ipConfiguration.privateIPAddress] The - * private IP address of the IP configuration. - * @property {string} - * [ipConfiguration.publicIPAddress.ipConfiguration.privateIPAllocationMethod] - * The private IP allocation method. Possible values are 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {object} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet] The reference of - * the subnet resource. - * @property {string} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefix] The - * address prefix for the subnet. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * @property {object} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] - * A collection of references to network interfaces. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.subnets] - * A collection of references to subnets. - * @property {string} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * @property {string} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable] The - * reference of the RouteTable resource. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.subnets] - * A collection of references to subnets. - * @property {boolean} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * @property {string} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.interfaceEndpoints] - * An array of references to interface endpoints - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurations] - * Gets an array of references to the network interface IP configurations - * using subnet. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurationProfiles] - * Array of IP configuration profiles which reference this subnet. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.delegations] Gets - * an array of references to the delegations on the subnet. - * @property {string} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.purpose] A - * read-only string identifying the intention of use for this subnet based on - * delegations and other user-defined properties. - * @property {string} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * @property {string} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.name] The name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. - * @property {string} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.etag] A unique - * read-only string that changes whenever the resource is updated. - * @property {object} - * [ipConfiguration.publicIPAddress.ipConfiguration.publicIPAddress] The - * reference of the public IP resource. - * @property {string} - * [ipConfiguration.publicIPAddress.ipConfiguration.provisioningState] Gets - * the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [ipConfiguration.publicIPAddress.ipConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * @property {string} [ipConfiguration.publicIPAddress.ipConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} [ipConfiguration.publicIPAddress.dnsSettings] The FQDN - * of the DNS record associated with the public IP address. - * @property {string} - * [ipConfiguration.publicIPAddress.dnsSettings.domainNameLabel] Gets or sets - * the Domain name label.The concatenation of the domain name label and the - * regionalized DNS zone make up the fully qualified domain name associated - * with the public IP address. If a domain name label is specified, an A DNS - * record is created for the public IP in the Microsoft Azure DNS system. - * @property {string} [ipConfiguration.publicIPAddress.dnsSettings.fqdn] Gets - * the FQDN, Fully qualified domain name of the A DNS record associated with - * the public IP. This is the concatenation of the domainNameLabel and the - * regionalized DNS zone. - * @property {string} - * [ipConfiguration.publicIPAddress.dnsSettings.reverseFqdn] Gets or Sets the - * Reverse FQDN. A user-visible, fully qualified domain name that resolves to - * this public IP address. If the reverseFqdn is specified, then a PTR DNS - * record is created pointing from the IP address in the in-addr.arpa domain - * to the reverse FQDN. - * @property {array} [ipConfiguration.publicIPAddress.ipTags] The list of - * tags associated with the public IP address. - * @property {string} [ipConfiguration.publicIPAddress.ipAddress] The IP - * address associated with the public IP address resource. - * @property {object} [ipConfiguration.publicIPAddress.publicIPPrefix] The - * Public IP Prefix this Public IP Address should be allocated from. - * @property {string} [ipConfiguration.publicIPAddress.publicIPPrefix.id] - * Resource ID. - * @property {number} [ipConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * @property {string} [ipConfiguration.publicIPAddress.resourceGuid] The - * resource GUID property of the public IP resource. - * @property {string} [ipConfiguration.publicIPAddress.provisioningState] The - * provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [ipConfiguration.publicIPAddress.etag] A unique - * read-only string that changes whenever the resource is updated. - * @property {array} [ipConfiguration.publicIPAddress.zones] A list of - * availability zones denoting the IP allocated for the resource needs to - * come from. - * @property {array} [ipConfiguration.applicationSecurityGroups] Application - * security groups in which the IP configuration is included. - * @property {string} [ipConfiguration.provisioningState] The provisioning - * state of the network interface IP configuration. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [ipConfiguration.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * @property {string} [ipConfiguration.etag] A unique read-only string that - * changes whenever the resource is updated. - * @property {string} [health] Health of backend server. Possible values - * include: 'Unknown', 'Up', 'Down', 'Partial', 'Draining' - */ - constructor() { - } - - /** - * Defines the metadata of ApplicationGatewayBackendHealthServer - * - * @returns {object} metadata of ApplicationGatewayBackendHealthServer - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayBackendHealthServer', - type: { - name: 'Composite', - className: 'ApplicationGatewayBackendHealthServer', - modelProperties: { - address: { - required: false, - serializedName: 'address', - type: { - name: 'String' - } - }, - ipConfiguration: { - required: false, - serializedName: 'ipConfiguration', - type: { - name: 'Composite', - className: 'NetworkInterfaceIPConfiguration' - } - }, - health: { - required: false, - serializedName: 'health', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayBackendHealthServer; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayBackendHttpSettings.js b/lib/services/networkManagement2/lib/models/applicationGatewayBackendHttpSettings.js deleted file mode 100644 index c0d0a1f42..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayBackendHttpSettings.js +++ /dev/null @@ -1,234 +0,0 @@ -/* - * 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'); - -/** - * Backend address pool settings of an application gateway. - * - * @extends models['SubResource'] - */ -class ApplicationGatewayBackendHttpSettings extends models['SubResource'] { - /** - * Create a ApplicationGatewayBackendHttpSettings. - * @property {number} [port] The destination port on the backend. - * @property {string} [protocol] The protocol used to communicate with the - * backend. Possible values are 'Http' and 'Https'. Possible values include: - * 'Http', 'Https' - * @property {string} [cookieBasedAffinity] Cookie based affinity. Possible - * values include: 'Enabled', 'Disabled' - * @property {number} [requestTimeout] Request timeout in seconds. - * Application Gateway will fail the request if response is not received - * within RequestTimeout. Acceptable values are from 1 second to 86400 - * seconds. - * @property {object} [probe] Probe resource of an application gateway. - * @property {string} [probe.id] Resource ID. - * @property {array} [authenticationCertificates] Array of references to - * application gateway authentication certificates. - * @property {array} [trustedRootCertificates] Array of references to - * application gateway trusted root certificates. - * @property {object} [connectionDraining] Connection draining of the backend - * http settings resource. - * @property {boolean} [connectionDraining.enabled] Whether connection - * draining is enabled or not. - * @property {number} [connectionDraining.drainTimeoutInSec] The number of - * seconds connection draining is active. Acceptable values are from 1 second - * to 3600 seconds. - * @property {string} [hostName] Host header to be sent to the backend - * servers. - * @property {boolean} [pickHostNameFromBackendAddress] Whether to pick host - * header should be picked from the host name of the backend server. Default - * value is false. - * @property {string} [affinityCookieName] Cookie name to use for the - * affinity cookie. - * @property {boolean} [probeEnabled] Whether the probe is enabled. Default - * value is false. - * @property {string} [path] Path which should be used as a prefix for all - * HTTP requests. Null means no path will be prefixed. Default value is null. - * @property {string} [provisioningState] Provisioning state of the backend - * http settings resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [name] Name of the backend http settings that is unique - * within an Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ApplicationGatewayBackendHttpSettings - * - * @returns {object} metadata of ApplicationGatewayBackendHttpSettings - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayBackendHttpSettings', - type: { - name: 'Composite', - className: 'ApplicationGatewayBackendHttpSettings', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - port: { - required: false, - serializedName: 'properties.port', - type: { - name: 'Number' - } - }, - protocol: { - required: false, - serializedName: 'properties.protocol', - type: { - name: 'String' - } - }, - cookieBasedAffinity: { - required: false, - serializedName: 'properties.cookieBasedAffinity', - type: { - name: 'String' - } - }, - requestTimeout: { - required: false, - serializedName: 'properties.requestTimeout', - type: { - name: 'Number' - } - }, - probe: { - required: false, - serializedName: 'properties.probe', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - authenticationCertificates: { - required: false, - serializedName: 'properties.authenticationCertificates', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SubResourceElementType', - type: { - name: 'Composite', - className: 'SubResource' - } - } - } - }, - trustedRootCertificates: { - required: false, - serializedName: 'properties.trustedRootCertificates', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SubResourceElementType', - type: { - name: 'Composite', - className: 'SubResource' - } - } - } - }, - connectionDraining: { - required: false, - serializedName: 'properties.connectionDraining', - type: { - name: 'Composite', - className: 'ApplicationGatewayConnectionDraining' - } - }, - hostName: { - required: false, - serializedName: 'properties.hostName', - type: { - name: 'String' - } - }, - pickHostNameFromBackendAddress: { - required: false, - serializedName: 'properties.pickHostNameFromBackendAddress', - type: { - name: 'Boolean' - } - }, - affinityCookieName: { - required: false, - serializedName: 'properties.affinityCookieName', - type: { - name: 'String' - } - }, - probeEnabled: { - required: false, - serializedName: 'properties.probeEnabled', - type: { - name: 'Boolean' - } - }, - path: { - required: false, - serializedName: 'properties.path', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - }, - type: { - required: false, - serializedName: 'type', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayBackendHttpSettings; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayConnectionDraining.js b/lib/services/networkManagement2/lib/models/applicationGatewayConnectionDraining.js deleted file mode 100644 index 57bffe64b..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayConnectionDraining.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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'; - -/** - * Connection draining allows open connections to a backend server to be active - * for a specified time after the backend server got removed from the - * configuration. - * - */ -class ApplicationGatewayConnectionDraining { - /** - * Create a ApplicationGatewayConnectionDraining. - * @property {boolean} enabled Whether connection draining is enabled or not. - * @property {number} drainTimeoutInSec The number of seconds connection - * draining is active. Acceptable values are from 1 second to 3600 seconds. - */ - constructor() { - } - - /** - * Defines the metadata of ApplicationGatewayConnectionDraining - * - * @returns {object} metadata of ApplicationGatewayConnectionDraining - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayConnectionDraining', - type: { - name: 'Composite', - className: 'ApplicationGatewayConnectionDraining', - modelProperties: { - enabled: { - required: true, - serializedName: 'enabled', - type: { - name: 'Boolean' - } - }, - drainTimeoutInSec: { - required: true, - serializedName: 'drainTimeoutInSec', - constraints: { - InclusiveMaximum: 3600, - InclusiveMinimum: 1 - }, - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayConnectionDraining; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayCustomError.js b/lib/services/networkManagement2/lib/models/applicationGatewayCustomError.js deleted file mode 100644 index fcd9db712..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayCustomError.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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'; - -/** - * Customer error of an application gateway. - * - */ -class ApplicationGatewayCustomError { - /** - * Create a ApplicationGatewayCustomError. - * @property {string} [statusCode] Status code of the application gateway - * customer error. Possible values include: 'HttpStatus403', 'HttpStatus502' - * @property {string} [customErrorPageUrl] Error page URL of the application - * gateway customer error. - */ - constructor() { - } - - /** - * Defines the metadata of ApplicationGatewayCustomError - * - * @returns {object} metadata of ApplicationGatewayCustomError - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayCustomError', - type: { - name: 'Composite', - className: 'ApplicationGatewayCustomError', - modelProperties: { - statusCode: { - required: false, - serializedName: 'statusCode', - type: { - name: 'String' - } - }, - customErrorPageUrl: { - required: false, - serializedName: 'customErrorPageUrl', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayCustomError; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayFirewallDisabledRuleGroup.js b/lib/services/networkManagement2/lib/models/applicationGatewayFirewallDisabledRuleGroup.js deleted file mode 100644 index 843ca6344..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayFirewallDisabledRuleGroup.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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'; - -/** - * Allows to disable rules within a rule group or an entire rule group. - * - */ -class ApplicationGatewayFirewallDisabledRuleGroup { - /** - * Create a ApplicationGatewayFirewallDisabledRuleGroup. - * @property {string} ruleGroupName The name of the rule group that will be - * disabled. - * @property {array} [rules] The list of rules that will be disabled. If - * null, all rules of the rule group will be disabled. - */ - constructor() { - } - - /** - * Defines the metadata of ApplicationGatewayFirewallDisabledRuleGroup - * - * @returns {object} metadata of ApplicationGatewayFirewallDisabledRuleGroup - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayFirewallDisabledRuleGroup', - type: { - name: 'Composite', - className: 'ApplicationGatewayFirewallDisabledRuleGroup', - modelProperties: { - ruleGroupName: { - required: true, - serializedName: 'ruleGroupName', - type: { - name: 'String' - } - }, - rules: { - required: false, - serializedName: 'rules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'NumberElementType', - type: { - name: 'Number' - } - } - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayFirewallDisabledRuleGroup; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayFirewallExclusion.js b/lib/services/networkManagement2/lib/models/applicationGatewayFirewallExclusion.js deleted file mode 100644 index 465e2639f..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayFirewallExclusion.js +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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'; - -/** - * Allow to exclude some variable satisfy the condition for the WAF check - * - */ -class ApplicationGatewayFirewallExclusion { - /** - * Create a ApplicationGatewayFirewallExclusion. - * @property {string} matchVariable The variable to be excluded. - * @property {string} selectorMatchOperator When matchVariable is a - * collection, operate on the selector to specify which elements in the - * collection this exclusion applies to. - * @property {string} selector When matchVariable is a collection, operator - * used to specify which elements in the collection this exclusion applies - * to. - */ - constructor() { - } - - /** - * Defines the metadata of ApplicationGatewayFirewallExclusion - * - * @returns {object} metadata of ApplicationGatewayFirewallExclusion - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayFirewallExclusion', - type: { - name: 'Composite', - className: 'ApplicationGatewayFirewallExclusion', - modelProperties: { - matchVariable: { - required: true, - serializedName: 'matchVariable', - type: { - name: 'String' - } - }, - selectorMatchOperator: { - required: true, - serializedName: 'selectorMatchOperator', - type: { - name: 'String' - } - }, - selector: { - required: true, - serializedName: 'selector', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayFirewallExclusion; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayFirewallRule.js b/lib/services/networkManagement2/lib/models/applicationGatewayFirewallRule.js deleted file mode 100644 index 081281798..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayFirewallRule.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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'; - -/** - * A web application firewall rule. - * - */ -class ApplicationGatewayFirewallRule { - /** - * Create a ApplicationGatewayFirewallRule. - * @property {number} ruleId The identifier of the web application firewall - * rule. - * @property {string} [description] The description of the web application - * firewall rule. - */ - constructor() { - } - - /** - * Defines the metadata of ApplicationGatewayFirewallRule - * - * @returns {object} metadata of ApplicationGatewayFirewallRule - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayFirewallRule', - type: { - name: 'Composite', - className: 'ApplicationGatewayFirewallRule', - modelProperties: { - ruleId: { - required: true, - serializedName: 'ruleId', - type: { - name: 'Number' - } - }, - description: { - required: false, - serializedName: 'description', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayFirewallRule; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayFirewallRuleGroup.js b/lib/services/networkManagement2/lib/models/applicationGatewayFirewallRuleGroup.js deleted file mode 100644 index 1eb4f665b..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayFirewallRuleGroup.js +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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'; - -/** - * A web application firewall rule group. - * - */ -class ApplicationGatewayFirewallRuleGroup { - /** - * Create a ApplicationGatewayFirewallRuleGroup. - * @property {string} ruleGroupName The name of the web application firewall - * rule group. - * @property {string} [description] The description of the web application - * firewall rule group. - * @property {array} rules The rules of the web application firewall rule - * group. - */ - constructor() { - } - - /** - * Defines the metadata of ApplicationGatewayFirewallRuleGroup - * - * @returns {object} metadata of ApplicationGatewayFirewallRuleGroup - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayFirewallRuleGroup', - type: { - name: 'Composite', - className: 'ApplicationGatewayFirewallRuleGroup', - modelProperties: { - ruleGroupName: { - required: true, - serializedName: 'ruleGroupName', - type: { - name: 'String' - } - }, - description: { - required: false, - serializedName: 'description', - type: { - name: 'String' - } - }, - rules: { - required: true, - serializedName: 'rules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayFirewallRuleElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayFirewallRule' - } - } - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayFirewallRuleGroup; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayFirewallRuleSet.js b/lib/services/networkManagement2/lib/models/applicationGatewayFirewallRuleSet.js deleted file mode 100644 index 76ac7cad6..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayFirewallRuleSet.js +++ /dev/null @@ -1,136 +0,0 @@ -/* - * 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'); - -/** - * A web application firewall rule set. - * - * @extends models['Resource'] - */ -class ApplicationGatewayFirewallRuleSet extends models['Resource'] { - /** - * Create a ApplicationGatewayFirewallRuleSet. - * @property {string} [provisioningState] The provisioning state of the web - * application firewall rule set. - * @property {string} ruleSetType The type of the web application firewall - * rule set. - * @property {string} ruleSetVersion The version of the web application - * firewall rule set type. - * @property {array} ruleGroups The rule groups of the web application - * firewall rule set. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ApplicationGatewayFirewallRuleSet - * - * @returns {object} metadata of ApplicationGatewayFirewallRuleSet - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayFirewallRuleSet', - type: { - name: 'Composite', - className: 'ApplicationGatewayFirewallRuleSet', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - ruleSetType: { - required: true, - serializedName: 'properties.ruleSetType', - type: { - name: 'String' - } - }, - ruleSetVersion: { - required: true, - serializedName: 'properties.ruleSetVersion', - type: { - name: 'String' - } - }, - ruleGroups: { - required: true, - serializedName: 'properties.ruleGroups', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayFirewallRuleGroupElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayFirewallRuleGroup' - } - } - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayFirewallRuleSet; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayFrontendIPConfiguration.js b/lib/services/networkManagement2/lib/models/applicationGatewayFrontendIPConfiguration.js deleted file mode 100644 index 078bd7535..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayFrontendIPConfiguration.js +++ /dev/null @@ -1,128 +0,0 @@ -/* - * 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'); - -/** - * Frontend IP configuration of an application gateway. - * - * @extends models['SubResource'] - */ -class ApplicationGatewayFrontendIPConfiguration extends models['SubResource'] { - /** - * Create a ApplicationGatewayFrontendIPConfiguration. - * @property {string} [privateIPAddress] PrivateIPAddress of the network - * interface IP Configuration. - * @property {string} [privateIPAllocationMethod] PrivateIP allocation - * method. Possible values include: 'Static', 'Dynamic' - * @property {object} [subnet] Reference of the subnet resource. - * @property {string} [subnet.id] Resource ID. - * @property {object} [publicIPAddress] Reference of the PublicIP resource. - * @property {string} [publicIPAddress.id] Resource ID. - * @property {string} [provisioningState] Provisioning state of the public IP - * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [name] Name of the frontend IP configuration that is - * unique within an Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ApplicationGatewayFrontendIPConfiguration - * - * @returns {object} metadata of ApplicationGatewayFrontendIPConfiguration - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayFrontendIPConfiguration', - type: { - name: 'Composite', - className: 'ApplicationGatewayFrontendIPConfiguration', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - privateIPAddress: { - required: false, - serializedName: 'properties.privateIPAddress', - type: { - name: 'String' - } - }, - privateIPAllocationMethod: { - required: false, - serializedName: 'properties.privateIPAllocationMethod', - type: { - name: 'String' - } - }, - subnet: { - required: false, - serializedName: 'properties.subnet', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - publicIPAddress: { - required: false, - serializedName: 'properties.publicIPAddress', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - }, - type: { - required: false, - serializedName: 'type', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayFrontendIPConfiguration; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayFrontendPort.js b/lib/services/networkManagement2/lib/models/applicationGatewayFrontendPort.js deleted file mode 100644 index 7927b4f2b..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayFrontendPort.js +++ /dev/null @@ -1,98 +0,0 @@ -/* - * 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'); - -/** - * Frontend port of an application gateway. - * - * @extends models['SubResource'] - */ -class ApplicationGatewayFrontendPort extends models['SubResource'] { - /** - * Create a ApplicationGatewayFrontendPort. - * @property {number} [port] Frontend port - * @property {string} [provisioningState] Provisioning state of the frontend - * port resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [name] Name of the frontend port that is unique within - * an Application Gateway - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ApplicationGatewayFrontendPort - * - * @returns {object} metadata of ApplicationGatewayFrontendPort - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayFrontendPort', - type: { - name: 'Composite', - className: 'ApplicationGatewayFrontendPort', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - port: { - required: false, - serializedName: 'properties.port', - type: { - name: 'Number' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - }, - type: { - required: false, - serializedName: 'type', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayFrontendPort; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayHeaderConfiguration.js b/lib/services/networkManagement2/lib/models/applicationGatewayHeaderConfiguration.js deleted file mode 100644 index 527538e07..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayHeaderConfiguration.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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'; - -/** - * Header configuration of the Actions set in Application Gateway. - * - */ -class ApplicationGatewayHeaderConfiguration { - /** - * Create a ApplicationGatewayHeaderConfiguration. - * @property {string} [headerName] Header name of the header configuration - * @property {string} [headerValue] Header value of the header configuration - */ - constructor() { - } - - /** - * Defines the metadata of ApplicationGatewayHeaderConfiguration - * - * @returns {object} metadata of ApplicationGatewayHeaderConfiguration - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayHeaderConfiguration', - type: { - name: 'Composite', - className: 'ApplicationGatewayHeaderConfiguration', - modelProperties: { - headerName: { - required: false, - serializedName: 'headerName', - type: { - name: 'String' - } - }, - headerValue: { - required: false, - serializedName: 'headerValue', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayHeaderConfiguration; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayHttpListener.js b/lib/services/networkManagement2/lib/models/applicationGatewayHttpListener.js deleted file mode 100644 index fa17055b8..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayHttpListener.js +++ /dev/null @@ -1,167 +0,0 @@ -/* - * 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'); - -/** - * Http listener of an application gateway. - * - * @extends models['SubResource'] - */ -class ApplicationGatewayHttpListener extends models['SubResource'] { - /** - * Create a ApplicationGatewayHttpListener. - * @property {object} [frontendIPConfiguration] Frontend IP configuration - * resource of an application gateway. - * @property {string} [frontendIPConfiguration.id] Resource ID. - * @property {object} [frontendPort] Frontend port resource of an application - * gateway. - * @property {string} [frontendPort.id] Resource ID. - * @property {string} [protocol] Protocol of the HTTP listener. Possible - * values are 'Http' and 'Https'. Possible values include: 'Http', 'Https' - * @property {string} [hostName] Host name of HTTP listener. - * @property {object} [sslCertificate] SSL certificate resource of an - * application gateway. - * @property {string} [sslCertificate.id] Resource ID. - * @property {boolean} [requireServerNameIndication] Applicable only if - * protocol is https. Enables SNI for multi-hosting. - * @property {string} [provisioningState] Provisioning state of the HTTP - * listener resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {array} [customErrorConfigurations] Custom error configurations - * of the HTTP listener. - * @property {string} [name] Name of the HTTP listener that is unique within - * an Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ApplicationGatewayHttpListener - * - * @returns {object} metadata of ApplicationGatewayHttpListener - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayHttpListener', - type: { - name: 'Composite', - className: 'ApplicationGatewayHttpListener', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - frontendIPConfiguration: { - required: false, - serializedName: 'properties.frontendIPConfiguration', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - frontendPort: { - required: false, - serializedName: 'properties.frontendPort', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - protocol: { - required: false, - serializedName: 'properties.protocol', - type: { - name: 'String' - } - }, - hostName: { - required: false, - serializedName: 'properties.hostName', - type: { - name: 'String' - } - }, - sslCertificate: { - required: false, - serializedName: 'properties.sslCertificate', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - requireServerNameIndication: { - required: false, - serializedName: 'properties.requireServerNameIndication', - type: { - name: 'Boolean' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - customErrorConfigurations: { - required: false, - serializedName: 'properties.customErrorConfigurations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayCustomErrorElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayCustomError' - } - } - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - }, - type: { - required: false, - serializedName: 'type', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayHttpListener; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayIPConfiguration.js b/lib/services/networkManagement2/lib/models/applicationGatewayIPConfiguration.js deleted file mode 100644 index f0f6dc738..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayIPConfiguration.js +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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'); - -/** - * IP configuration of an application gateway. Currently 1 public and 1 private - * IP configuration is allowed. - * - * @extends models['SubResource'] - */ -class ApplicationGatewayIPConfiguration extends models['SubResource'] { - /** - * Create a ApplicationGatewayIPConfiguration. - * @property {object} [subnet] Reference of the subnet resource. A subnet - * from where application gateway gets its private address. - * @property {string} [subnet.id] Resource ID. - * @property {string} [provisioningState] Provisioning state of the - * application gateway subnet resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [name] Name of the IP configuration that is unique - * within an Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ApplicationGatewayIPConfiguration - * - * @returns {object} metadata of ApplicationGatewayIPConfiguration - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayIPConfiguration', - type: { - name: 'Composite', - className: 'ApplicationGatewayIPConfiguration', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - subnet: { - required: false, - serializedName: 'properties.subnet', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - }, - type: { - required: false, - serializedName: 'type', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayIPConfiguration; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayListResult.js b/lib/services/networkManagement2/lib/models/applicationGatewayListResult.js deleted file mode 100644 index 5951addbd..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayListResult.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 ListApplicationGateways API service call. - */ -class ApplicationGatewayListResult extends Array { - /** - * Create a ApplicationGatewayListResult. - * @property {string} [nextLink] URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ApplicationGatewayListResult - * - * @returns {object} metadata of ApplicationGatewayListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayListResult', - type: { - name: 'Composite', - className: 'ApplicationGatewayListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayElementType', - type: { - name: 'Composite', - className: 'ApplicationGateway' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayListResult; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayPathRule.js b/lib/services/networkManagement2/lib/models/applicationGatewayPathRule.js deleted file mode 100644 index 4698b7399..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayPathRule.js +++ /dev/null @@ -1,149 +0,0 @@ -/* - * 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'); - -/** - * Path rule of URL path map of an application gateway. - * - * @extends models['SubResource'] - */ -class ApplicationGatewayPathRule extends models['SubResource'] { - /** - * Create a ApplicationGatewayPathRule. - * @property {array} [paths] Path rules of URL path map. - * @property {object} [backendAddressPool] Backend address pool resource of - * URL path map path rule. - * @property {string} [backendAddressPool.id] Resource ID. - * @property {object} [backendHttpSettings] Backend http settings resource of - * URL path map path rule. - * @property {string} [backendHttpSettings.id] Resource ID. - * @property {object} [redirectConfiguration] Redirect configuration resource - * of URL path map path rule. - * @property {string} [redirectConfiguration.id] Resource ID. - * @property {object} [rewriteRuleSet] Rewrite rule set resource of URL path - * map path rule. - * @property {string} [rewriteRuleSet.id] Resource ID. - * @property {string} [provisioningState] Path rule of URL path map resource. - * Possible values are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [name] Name of the path rule that is unique within an - * Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ApplicationGatewayPathRule - * - * @returns {object} metadata of ApplicationGatewayPathRule - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayPathRule', - type: { - name: 'Composite', - className: 'ApplicationGatewayPathRule', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - paths: { - required: false, - serializedName: 'properties.paths', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - backendAddressPool: { - required: false, - serializedName: 'properties.backendAddressPool', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - backendHttpSettings: { - required: false, - serializedName: 'properties.backendHttpSettings', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - redirectConfiguration: { - required: false, - serializedName: 'properties.redirectConfiguration', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - rewriteRuleSet: { - required: false, - serializedName: 'properties.rewriteRuleSet', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - }, - type: { - required: false, - serializedName: 'type', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayPathRule; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayProbe.js b/lib/services/networkManagement2/lib/models/applicationGatewayProbe.js deleted file mode 100644 index d7781988a..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayProbe.js +++ /dev/null @@ -1,180 +0,0 @@ -/* - * 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'); - -/** - * Probe of the application gateway. - * - * @extends models['SubResource'] - */ -class ApplicationGatewayProbe extends models['SubResource'] { - /** - * Create a ApplicationGatewayProbe. - * @property {string} [protocol] The protocol used for the probe. Possible - * values are 'Http' and 'Https'. Possible values include: 'Http', 'Https' - * @property {string} [host] Host name to send the probe to. - * @property {string} [path] Relative path of probe. Valid path starts from - * '/'. Probe is sent to ://: - * @property {number} [interval] The probing interval in seconds. This is the - * time interval between two consecutive probes. Acceptable values are from 1 - * second to 86400 seconds. - * @property {number} [timeout] the probe timeout in seconds. Probe marked as - * failed if valid response is not received with this timeout period. - * Acceptable values are from 1 second to 86400 seconds. - * @property {number} [unhealthyThreshold] The probe retry count. Backend - * server is marked down after consecutive probe failure count reaches - * UnhealthyThreshold. Acceptable values are from 1 second to 20. - * @property {boolean} [pickHostNameFromBackendHttpSettings] Whether the host - * header should be picked from the backend http settings. Default value is - * false. - * @property {number} [minServers] Minimum number of servers that are always - * marked healthy. Default value is 0. - * @property {object} [match] Criterion for classifying a healthy probe - * response. - * @property {string} [match.body] Body that must be contained in the health - * response. Default value is empty. - * @property {array} [match.statusCodes] Allowed ranges of healthy status - * codes. Default range of healthy status codes is 200-399. - * @property {string} [provisioningState] Provisioning state of the backend - * http settings resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [name] Name of the probe that is unique within an - * Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ApplicationGatewayProbe - * - * @returns {object} metadata of ApplicationGatewayProbe - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayProbe', - type: { - name: 'Composite', - className: 'ApplicationGatewayProbe', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - protocol: { - required: false, - serializedName: 'properties.protocol', - type: { - name: 'String' - } - }, - host: { - required: false, - serializedName: 'properties.host', - type: { - name: 'String' - } - }, - path: { - required: false, - serializedName: 'properties.path', - type: { - name: 'String' - } - }, - interval: { - required: false, - serializedName: 'properties.interval', - type: { - name: 'Number' - } - }, - timeout: { - required: false, - serializedName: 'properties.timeout', - type: { - name: 'Number' - } - }, - unhealthyThreshold: { - required: false, - serializedName: 'properties.unhealthyThreshold', - type: { - name: 'Number' - } - }, - pickHostNameFromBackendHttpSettings: { - required: false, - serializedName: 'properties.pickHostNameFromBackendHttpSettings', - type: { - name: 'Boolean' - } - }, - minServers: { - required: false, - serializedName: 'properties.minServers', - type: { - name: 'Number' - } - }, - match: { - required: false, - serializedName: 'properties.match', - type: { - name: 'Composite', - className: 'ApplicationGatewayProbeHealthResponseMatch' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - }, - type: { - required: false, - serializedName: 'type', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayProbe; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayProbeHealthResponseMatch.js b/lib/services/networkManagement2/lib/models/applicationGatewayProbeHealthResponseMatch.js deleted file mode 100644 index a55dd103e..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayProbeHealthResponseMatch.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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'; - -/** - * Application gateway probe health response match - * - */ -class ApplicationGatewayProbeHealthResponseMatch { - /** - * Create a ApplicationGatewayProbeHealthResponseMatch. - * @property {string} [body] Body that must be contained in the health - * response. Default value is empty. - * @property {array} [statusCodes] Allowed ranges of healthy status codes. - * Default range of healthy status codes is 200-399. - */ - constructor() { - } - - /** - * Defines the metadata of ApplicationGatewayProbeHealthResponseMatch - * - * @returns {object} metadata of ApplicationGatewayProbeHealthResponseMatch - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayProbeHealthResponseMatch', - type: { - name: 'Composite', - className: 'ApplicationGatewayProbeHealthResponseMatch', - modelProperties: { - body: { - required: false, - serializedName: 'body', - type: { - name: 'String' - } - }, - statusCodes: { - required: false, - serializedName: 'statusCodes', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayProbeHealthResponseMatch; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayRedirectConfiguration.js b/lib/services/networkManagement2/lib/models/applicationGatewayRedirectConfiguration.js deleted file mode 100644 index a30e292a8..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayRedirectConfiguration.js +++ /dev/null @@ -1,178 +0,0 @@ -/* - * 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'); - -/** - * Redirect configuration of an application gateway. - * - * @extends models['SubResource'] - */ -class ApplicationGatewayRedirectConfiguration extends models['SubResource'] { - /** - * Create a ApplicationGatewayRedirectConfiguration. - * @property {string} [redirectType] Supported http redirection types - - * Permanent, Temporary, Found, SeeOther. Possible values include: - * 'Permanent', 'Found', 'SeeOther', 'Temporary' - * @property {object} [targetListener] Reference to a listener to redirect - * the request to. - * @property {string} [targetListener.id] Resource ID. - * @property {string} [targetUrl] Url to redirect the request to. - * @property {boolean} [includePath] Include path in the redirected url. - * @property {boolean} [includeQueryString] Include query string in the - * redirected url. - * @property {array} [requestRoutingRules] Request routing specifying - * redirect configuration. - * @property {array} [urlPathMaps] Url path maps specifying default redirect - * configuration. - * @property {array} [pathRules] Path rules specifying redirect - * configuration. - * @property {string} [name] Name of the redirect configuration that is - * unique within an Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ApplicationGatewayRedirectConfiguration - * - * @returns {object} metadata of ApplicationGatewayRedirectConfiguration - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayRedirectConfiguration', - type: { - name: 'Composite', - className: 'ApplicationGatewayRedirectConfiguration', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - redirectType: { - required: false, - serializedName: 'properties.redirectType', - type: { - name: 'String' - } - }, - targetListener: { - required: false, - serializedName: 'properties.targetListener', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - targetUrl: { - required: false, - serializedName: 'properties.targetUrl', - type: { - name: 'String' - } - }, - includePath: { - required: false, - serializedName: 'properties.includePath', - type: { - name: 'Boolean' - } - }, - includeQueryString: { - required: false, - serializedName: 'properties.includeQueryString', - type: { - name: 'Boolean' - } - }, - requestRoutingRules: { - required: false, - serializedName: 'properties.requestRoutingRules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SubResourceElementType', - type: { - name: 'Composite', - className: 'SubResource' - } - } - } - }, - urlPathMaps: { - required: false, - serializedName: 'properties.urlPathMaps', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SubResourceElementType', - type: { - name: 'Composite', - className: 'SubResource' - } - } - } - }, - pathRules: { - required: false, - serializedName: 'properties.pathRules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SubResourceElementType', - type: { - name: 'Composite', - className: 'SubResource' - } - } - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - }, - type: { - required: false, - serializedName: 'type', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayRedirectConfiguration; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayRequestRoutingRule.js b/lib/services/networkManagement2/lib/models/applicationGatewayRequestRoutingRule.js deleted file mode 100644 index a256ecd44..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayRequestRoutingRule.js +++ /dev/null @@ -1,166 +0,0 @@ -/* - * 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'); - -/** - * Request routing rule of an application gateway. - * - * @extends models['SubResource'] - */ -class ApplicationGatewayRequestRoutingRule extends models['SubResource'] { - /** - * Create a ApplicationGatewayRequestRoutingRule. - * @property {string} [ruleType] Rule type. Possible values include: 'Basic', - * 'PathBasedRouting' - * @property {object} [backendAddressPool] Backend address pool resource of - * the application gateway. - * @property {string} [backendAddressPool.id] Resource ID. - * @property {object} [backendHttpSettings] Backend http settings resource of - * the application gateway. - * @property {string} [backendHttpSettings.id] Resource ID. - * @property {object} [httpListener] Http listener resource of the - * application gateway. - * @property {string} [httpListener.id] Resource ID. - * @property {object} [urlPathMap] URL path map resource of the application - * gateway. - * @property {string} [urlPathMap.id] Resource ID. - * @property {object} [rewriteRuleSet] Rewrite Rule Set resource in Basic - * rule of the application gateway. - * @property {string} [rewriteRuleSet.id] Resource ID. - * @property {object} [redirectConfiguration] Redirect configuration resource - * of the application gateway. - * @property {string} [redirectConfiguration.id] Resource ID. - * @property {string} [provisioningState] Provisioning state of the request - * routing rule resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [name] Name of the request routing rule that is unique - * within an Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ApplicationGatewayRequestRoutingRule - * - * @returns {object} metadata of ApplicationGatewayRequestRoutingRule - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayRequestRoutingRule', - type: { - name: 'Composite', - className: 'ApplicationGatewayRequestRoutingRule', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - ruleType: { - required: false, - serializedName: 'properties.ruleType', - type: { - name: 'String' - } - }, - backendAddressPool: { - required: false, - serializedName: 'properties.backendAddressPool', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - backendHttpSettings: { - required: false, - serializedName: 'properties.backendHttpSettings', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - httpListener: { - required: false, - serializedName: 'properties.httpListener', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - urlPathMap: { - required: false, - serializedName: 'properties.urlPathMap', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - rewriteRuleSet: { - required: false, - serializedName: 'properties.rewriteRuleSet', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - redirectConfiguration: { - required: false, - serializedName: 'properties.redirectConfiguration', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - }, - type: { - required: false, - serializedName: 'type', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayRequestRoutingRule; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayRewriteRule.js b/lib/services/networkManagement2/lib/models/applicationGatewayRewriteRule.js deleted file mode 100644 index c0732abf8..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayRewriteRule.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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'; - -/** - * Rewrite rule of an application gateway. - * - */ -class ApplicationGatewayRewriteRule { - /** - * Create a ApplicationGatewayRewriteRule. - * @property {string} [name] Name of the rewrite rule that is unique within - * an Application Gateway. - * @property {object} [actionSet] Set of actions to be done as part of the - * rewrite Rule. - * @property {array} [actionSet.requestHeaderConfigurations] Request Header - * Actions in the Action Set - * @property {array} [actionSet.responseHeaderConfigurations] Response Header - * Actions in the Action Set - */ - constructor() { - } - - /** - * Defines the metadata of ApplicationGatewayRewriteRule - * - * @returns {object} metadata of ApplicationGatewayRewriteRule - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayRewriteRule', - type: { - name: 'Composite', - className: 'ApplicationGatewayRewriteRule', - modelProperties: { - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - actionSet: { - required: false, - serializedName: 'actionSet', - type: { - name: 'Composite', - className: 'ApplicationGatewayRewriteRuleActionSet' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayRewriteRule; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayRewriteRuleActionSet.js b/lib/services/networkManagement2/lib/models/applicationGatewayRewriteRuleActionSet.js deleted file mode 100644 index 57fe71765..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayRewriteRuleActionSet.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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'; - -/** - * Set of actions in the Rewrite Rule in Application Gateway. - * - */ -class ApplicationGatewayRewriteRuleActionSet { - /** - * Create a ApplicationGatewayRewriteRuleActionSet. - * @property {array} [requestHeaderConfigurations] Request Header Actions in - * the Action Set - * @property {array} [responseHeaderConfigurations] Response Header Actions - * in the Action Set - */ - constructor() { - } - - /** - * Defines the metadata of ApplicationGatewayRewriteRuleActionSet - * - * @returns {object} metadata of ApplicationGatewayRewriteRuleActionSet - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayRewriteRuleActionSet', - type: { - name: 'Composite', - className: 'ApplicationGatewayRewriteRuleActionSet', - modelProperties: { - requestHeaderConfigurations: { - required: false, - serializedName: 'requestHeaderConfigurations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayHeaderConfigurationElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayHeaderConfiguration' - } - } - } - }, - responseHeaderConfigurations: { - required: false, - serializedName: 'responseHeaderConfigurations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayHeaderConfigurationElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayHeaderConfiguration' - } - } - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayRewriteRuleActionSet; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayRewriteRuleSet.js b/lib/services/networkManagement2/lib/models/applicationGatewayRewriteRuleSet.js deleted file mode 100644 index f75f7504a..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayRewriteRuleSet.js +++ /dev/null @@ -1,101 +0,0 @@ -/* - * 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'); - -/** - * Rewrite rule set of an application gateway. - * - * @extends models['SubResource'] - */ -class ApplicationGatewayRewriteRuleSet extends models['SubResource'] { - /** - * Create a ApplicationGatewayRewriteRuleSet. - * @property {array} [rewriteRules] Rewrite rules in the rewrite rule set. - * @property {string} [provisioningState] Provisioning state of the rewrite - * rule set resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [name] Name of the rewrite rule set that is unique - * within an Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ApplicationGatewayRewriteRuleSet - * - * @returns {object} metadata of ApplicationGatewayRewriteRuleSet - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayRewriteRuleSet', - type: { - name: 'Composite', - className: 'ApplicationGatewayRewriteRuleSet', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - rewriteRules: { - required: false, - serializedName: 'properties.rewriteRules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayRewriteRuleElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayRewriteRule' - } - } - } - }, - 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 = ApplicationGatewayRewriteRuleSet; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewaySku.js b/lib/services/networkManagement2/lib/models/applicationGatewaySku.js deleted file mode 100644 index cc5b661c8..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewaySku.js +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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'; - -/** - * SKU of an application gateway - * - */ -class ApplicationGatewaySku { - /** - * Create a ApplicationGatewaySku. - * @property {string} [name] Name of an application gateway SKU. Possible - * values include: 'Standard_Small', 'Standard_Medium', 'Standard_Large', - * 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' - * @property {string} [tier] Tier of an application gateway. Possible values - * include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' - * @property {number} [capacity] Capacity (instance count) of an application - * gateway. - */ - constructor() { - } - - /** - * Defines the metadata of ApplicationGatewaySku - * - * @returns {object} metadata of ApplicationGatewaySku - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewaySku', - type: { - name: 'Composite', - className: 'ApplicationGatewaySku', - modelProperties: { - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - tier: { - required: false, - serializedName: 'tier', - type: { - name: 'String' - } - }, - capacity: { - required: false, - serializedName: 'capacity', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewaySku; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewaySslCertificate.js b/lib/services/networkManagement2/lib/models/applicationGatewaySslCertificate.js deleted file mode 100644 index 423e9f513..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewaySslCertificate.js +++ /dev/null @@ -1,127 +0,0 @@ -/* - * 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'); - -/** - * SSL certificates of an application gateway. - * - * @extends models['SubResource'] - */ -class ApplicationGatewaySslCertificate extends models['SubResource'] { - /** - * Create a ApplicationGatewaySslCertificate. - * @property {string} [data] Base-64 encoded pfx certificate. Only applicable - * in PUT Request. - * @property {string} [password] Password for the pfx file specified in data. - * Only applicable in PUT request. - * @property {string} [publicCertData] Base-64 encoded Public cert data - * corresponding to pfx specified in data. Only applicable in GET request. - * @property {string} [keyVaultSecretId] Secret Id of (base-64 encoded - * unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. - * @property {string} [provisioningState] Provisioning state of the SSL - * certificate resource Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [name] Name of the SSL certificate that is unique - * within an Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ApplicationGatewaySslCertificate - * - * @returns {object} metadata of ApplicationGatewaySslCertificate - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewaySslCertificate', - type: { - name: 'Composite', - className: 'ApplicationGatewaySslCertificate', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - data: { - required: false, - serializedName: 'properties.data', - type: { - name: 'String' - } - }, - password: { - required: false, - serializedName: 'properties.password', - type: { - name: 'String' - } - }, - publicCertData: { - required: false, - serializedName: 'properties.publicCertData', - type: { - name: 'String' - } - }, - keyVaultSecretId: { - required: false, - serializedName: 'properties.keyVaultSecretId', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - }, - type: { - required: false, - serializedName: 'type', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewaySslCertificate; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewaySslPolicy.js b/lib/services/networkManagement2/lib/models/applicationGatewaySslPolicy.js deleted file mode 100644 index a9736b210..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewaySslPolicy.js +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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'; - -/** - * Application Gateway Ssl policy. - * - */ -class ApplicationGatewaySslPolicy { - /** - * Create a ApplicationGatewaySslPolicy. - * @property {array} [disabledSslProtocols] Ssl protocols to be disabled on - * application gateway. - * @property {string} [policyType] Type of Ssl Policy. Possible values - * include: 'Predefined', 'Custom' - * @property {string} [policyName] Name of Ssl predefined policy. Possible - * values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', - * 'AppGwSslPolicy20170401S' - * @property {array} [cipherSuites] Ssl cipher suites to be enabled in the - * specified order to application gateway. - * @property {string} [minProtocolVersion] Minimum version of Ssl protocol to - * be supported on application gateway. Possible values include: 'TLSv1_0', - * 'TLSv1_1', 'TLSv1_2' - */ - constructor() { - } - - /** - * Defines the metadata of ApplicationGatewaySslPolicy - * - * @returns {object} metadata of ApplicationGatewaySslPolicy - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewaySslPolicy', - type: { - name: 'Composite', - className: 'ApplicationGatewaySslPolicy', - modelProperties: { - disabledSslProtocols: { - required: false, - serializedName: 'disabledSslProtocols', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewaySslProtocolElementType', - type: { - name: 'String' - } - } - } - }, - policyType: { - required: false, - serializedName: 'policyType', - type: { - name: 'String' - } - }, - policyName: { - required: false, - serializedName: 'policyName', - type: { - name: 'String' - } - }, - cipherSuites: { - required: false, - serializedName: 'cipherSuites', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewaySslCipherSuiteElementType', - type: { - name: 'String' - } - } - } - }, - minProtocolVersion: { - required: false, - serializedName: 'minProtocolVersion', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewaySslPolicy; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewaySslPredefinedPolicy.js b/lib/services/networkManagement2/lib/models/applicationGatewaySslPredefinedPolicy.js deleted file mode 100644 index 6f8f13a36..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewaySslPredefinedPolicy.js +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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'); - -/** - * An Ssl predefined policy - * - * @extends models['SubResource'] - */ -class ApplicationGatewaySslPredefinedPolicy extends models['SubResource'] { - /** - * Create a ApplicationGatewaySslPredefinedPolicy. - * @property {string} [name] Name of the Ssl predefined policy. - * @property {array} [cipherSuites] Ssl cipher suites to be enabled in the - * specified order for application gateway. - * @property {string} [minProtocolVersion] Minimum version of Ssl protocol to - * be supported on application gateway. Possible values include: 'TLSv1_0', - * 'TLSv1_1', 'TLSv1_2' - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ApplicationGatewaySslPredefinedPolicy - * - * @returns {object} metadata of ApplicationGatewaySslPredefinedPolicy - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewaySslPredefinedPolicy', - type: { - name: 'Composite', - className: 'ApplicationGatewaySslPredefinedPolicy', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - cipherSuites: { - required: false, - serializedName: 'properties.cipherSuites', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewaySslCipherSuiteElementType', - type: { - name: 'String' - } - } - } - }, - minProtocolVersion: { - required: false, - serializedName: 'properties.minProtocolVersion', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewaySslPredefinedPolicy; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayTrustedRootCertificate.js b/lib/services/networkManagement2/lib/models/applicationGatewayTrustedRootCertificate.js deleted file mode 100644 index 4edcb248b..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayTrustedRootCertificate.js +++ /dev/null @@ -1,108 +0,0 @@ -/* - * 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'); - -/** - * Trusted Root certificates of an application gateway. - * - * @extends models['SubResource'] - */ -class ApplicationGatewayTrustedRootCertificate extends models['SubResource'] { - /** - * Create a ApplicationGatewayTrustedRootCertificate. - * @property {string} [data] Certificate public data. - * @property {string} [keyVaultSecretId] Secret Id of (base-64 encoded - * unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. - * @property {string} [provisioningState] Provisioning state of the trusted - * root certificate resource. Possible values are: 'Updating', 'Deleting', - * and 'Failed'. - * @property {string} [name] Name of the trusted root certificate that is - * unique within an Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ApplicationGatewayTrustedRootCertificate - * - * @returns {object} metadata of ApplicationGatewayTrustedRootCertificate - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayTrustedRootCertificate', - type: { - name: 'Composite', - className: 'ApplicationGatewayTrustedRootCertificate', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - data: { - required: false, - serializedName: 'properties.data', - type: { - name: 'String' - } - }, - keyVaultSecretId: { - required: false, - serializedName: 'properties.keyVaultSecretId', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - }, - type: { - required: false, - serializedName: 'type', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayTrustedRootCertificate; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayUrlPathMap.js b/lib/services/networkManagement2/lib/models/applicationGatewayUrlPathMap.js deleted file mode 100644 index 391dc28de..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayUrlPathMap.js +++ /dev/null @@ -1,152 +0,0 @@ -/* - * 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'); - -/** - * UrlPathMaps give a url path to the backend mapping information for - * PathBasedRouting. - * - * @extends models['SubResource'] - */ -class ApplicationGatewayUrlPathMap extends models['SubResource'] { - /** - * Create a ApplicationGatewayUrlPathMap. - * @property {object} [defaultBackendAddressPool] Default backend address - * pool resource of URL path map. - * @property {string} [defaultBackendAddressPool.id] Resource ID. - * @property {object} [defaultBackendHttpSettings] Default backend http - * settings resource of URL path map. - * @property {string} [defaultBackendHttpSettings.id] Resource ID. - * @property {object} [defaultRewriteRuleSet] Default Rewrite rule set - * resource of URL path map. - * @property {string} [defaultRewriteRuleSet.id] Resource ID. - * @property {object} [defaultRedirectConfiguration] Default redirect - * configuration resource of URL path map. - * @property {string} [defaultRedirectConfiguration.id] Resource ID. - * @property {array} [pathRules] Path rule of URL path map resource. - * @property {string} [provisioningState] Provisioning state of the backend - * http settings resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [name] Name of the URL path map that is unique within - * an Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ApplicationGatewayUrlPathMap - * - * @returns {object} metadata of ApplicationGatewayUrlPathMap - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayUrlPathMap', - type: { - name: 'Composite', - className: 'ApplicationGatewayUrlPathMap', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - defaultBackendAddressPool: { - required: false, - serializedName: 'properties.defaultBackendAddressPool', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - defaultBackendHttpSettings: { - required: false, - serializedName: 'properties.defaultBackendHttpSettings', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - defaultRewriteRuleSet: { - required: false, - serializedName: 'properties.defaultRewriteRuleSet', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - defaultRedirectConfiguration: { - required: false, - serializedName: 'properties.defaultRedirectConfiguration', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - pathRules: { - required: false, - serializedName: 'properties.pathRules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayPathRuleElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayPathRule' - } - } - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - }, - type: { - required: false, - serializedName: 'type', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayUrlPathMap; diff --git a/lib/services/networkManagement2/lib/models/applicationGatewayWebApplicationFirewallConfiguration.js b/lib/services/networkManagement2/lib/models/applicationGatewayWebApplicationFirewallConfiguration.js deleted file mode 100644 index a2af0c022..000000000 --- a/lib/services/networkManagement2/lib/models/applicationGatewayWebApplicationFirewallConfiguration.js +++ /dev/null @@ -1,158 +0,0 @@ -/* - * 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'; - -/** - * Application gateway web application firewall configuration. - * - */ -class ApplicationGatewayWebApplicationFirewallConfiguration { - /** - * Create a ApplicationGatewayWebApplicationFirewallConfiguration. - * @property {boolean} enabled Whether the web application firewall is - * enabled or not. - * @property {string} firewallMode Web application firewall mode. Possible - * values include: 'Detection', 'Prevention' - * @property {string} ruleSetType The type of the web application firewall - * rule set. Possible values are: 'OWASP'. - * @property {string} ruleSetVersion The version of the rule set type. - * @property {array} [disabledRuleGroups] The disabled rule groups. - * @property {boolean} [requestBodyCheck] Whether allow WAF to check request - * Body. - * @property {number} [maxRequestBodySize] Maxium request body size for WAF. - * @property {number} [maxRequestBodySizeInKb] Maxium request body size in Kb - * for WAF. - * @property {number} [fileUploadLimitInMb] Maxium file upload size in Mb for - * WAF. - * @property {array} [exclusions] The exclusion list. - */ - constructor() { - } - - /** - * Defines the metadata of ApplicationGatewayWebApplicationFirewallConfiguration - * - * @returns {object} metadata of ApplicationGatewayWebApplicationFirewallConfiguration - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationGatewayWebApplicationFirewallConfiguration', - type: { - name: 'Composite', - className: 'ApplicationGatewayWebApplicationFirewallConfiguration', - modelProperties: { - enabled: { - required: true, - serializedName: 'enabled', - type: { - name: 'Boolean' - } - }, - firewallMode: { - required: true, - serializedName: 'firewallMode', - type: { - name: 'String' - } - }, - ruleSetType: { - required: true, - serializedName: 'ruleSetType', - type: { - name: 'String' - } - }, - ruleSetVersion: { - required: true, - serializedName: 'ruleSetVersion', - type: { - name: 'String' - } - }, - disabledRuleGroups: { - required: false, - serializedName: 'disabledRuleGroups', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayFirewallDisabledRuleGroupElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayFirewallDisabledRuleGroup' - } - } - } - }, - requestBodyCheck: { - required: false, - serializedName: 'requestBodyCheck', - type: { - name: 'Boolean' - } - }, - maxRequestBodySize: { - required: false, - serializedName: 'maxRequestBodySize', - constraints: { - InclusiveMaximum: 128, - InclusiveMinimum: 8 - }, - type: { - name: 'Number' - } - }, - maxRequestBodySizeInKb: { - required: false, - serializedName: 'maxRequestBodySizeInKb', - constraints: { - InclusiveMaximum: 128, - InclusiveMinimum: 8 - }, - type: { - name: 'Number' - } - }, - fileUploadLimitInMb: { - required: false, - serializedName: 'fileUploadLimitInMb', - constraints: { - InclusiveMaximum: 500, - InclusiveMinimum: 0 - }, - type: { - name: 'Number' - } - }, - exclusions: { - required: false, - serializedName: 'exclusions', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayFirewallExclusionElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayFirewallExclusion' - } - } - } - } - } - } - }; - } -} - -module.exports = ApplicationGatewayWebApplicationFirewallConfiguration; diff --git a/lib/services/networkManagement2/lib/models/applicationSecurityGroup.js b/lib/services/networkManagement2/lib/models/applicationSecurityGroup.js deleted file mode 100644 index e597d1363..000000000 --- a/lib/services/networkManagement2/lib/models/applicationSecurityGroup.js +++ /dev/null @@ -1,125 +0,0 @@ -/* - * 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'); - -/** - * An application security group in a resource group. - * - * @extends models['Resource'] - */ -class ApplicationSecurityGroup extends models['Resource'] { - /** - * Create a ApplicationSecurityGroup. - * @property {string} [resourceGuid] The resource GUID property of the - * application security group resource. It uniquely identifies a resource, - * even if the user changes its name or migrate the resource across - * subscriptions or resource groups. - * @property {string} [provisioningState] The provisioning state of the - * application security group resource. Possible values are: 'Succeeded', - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ApplicationSecurityGroup - * - * @returns {object} metadata of ApplicationSecurityGroup - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationSecurityGroup', - type: { - name: 'Composite', - className: 'ApplicationSecurityGroup', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - resourceGuid: { - required: false, - readOnly: true, - serializedName: 'properties.resourceGuid', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - etag: { - required: false, - readOnly: true, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ApplicationSecurityGroup; diff --git a/lib/services/networkManagement2/lib/models/applicationSecurityGroupListResult.js b/lib/services/networkManagement2/lib/models/applicationSecurityGroupListResult.js deleted file mode 100644 index 7ab6a3456..000000000 --- a/lib/services/networkManagement2/lib/models/applicationSecurityGroupListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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'; - -/** - * A list of application security groups. - */ -class ApplicationSecurityGroupListResult extends Array { - /** - * Create a ApplicationSecurityGroupListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ApplicationSecurityGroupListResult - * - * @returns {object} metadata of ApplicationSecurityGroupListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ApplicationSecurityGroupListResult', - type: { - name: 'Composite', - className: 'ApplicationSecurityGroupListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationSecurityGroupElementType', - type: { - name: 'Composite', - className: 'ApplicationSecurityGroup' - } - } - } - }, - nextLink: { - required: false, - readOnly: true, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ApplicationSecurityGroupListResult; diff --git a/lib/services/networkManagement2/lib/models/authorizationListResult.js b/lib/services/networkManagement2/lib/models/authorizationListResult.js deleted file mode 100644 index 0425515e5..000000000 --- a/lib/services/networkManagement2/lib/models/authorizationListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 ListAuthorizations API service call retrieves all - * authorizations that belongs to an ExpressRouteCircuit. - */ -class AuthorizationListResult extends Array { - /** - * Create a AuthorizationListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AuthorizationListResult - * - * @returns {object} metadata of AuthorizationListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'AuthorizationListResult', - type: { - name: 'Composite', - className: 'AuthorizationListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ExpressRouteCircuitAuthorizationElementType', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitAuthorization' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AuthorizationListResult; diff --git a/lib/services/networkManagement2/lib/models/availability.js b/lib/services/networkManagement2/lib/models/availability.js deleted file mode 100644 index 413501cb1..000000000 --- a/lib/services/networkManagement2/lib/models/availability.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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'; - -/** - * Availability of the metric. - * - */ -class Availability { - /** - * Create a Availability. - * @property {string} [timeGrain] The time grain of the availability. - * @property {string} [retention] The retention of the availability. - * @property {string} [blobDuration] Duration of the availability blob. - */ - constructor() { - } - - /** - * Defines the metadata of Availability - * - * @returns {object} metadata of Availability - * - */ - mapper() { - return { - required: false, - serializedName: 'Availability', - type: { - name: 'Composite', - className: 'Availability', - modelProperties: { - timeGrain: { - required: false, - serializedName: 'timeGrain', - type: { - name: 'String' - } - }, - retention: { - required: false, - serializedName: 'retention', - type: { - name: 'String' - } - }, - blobDuration: { - required: false, - serializedName: 'blobDuration', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = Availability; diff --git a/lib/services/networkManagement2/lib/models/availableDelegation.js b/lib/services/networkManagement2/lib/models/availableDelegation.js deleted file mode 100644 index 6e7623682..000000000 --- a/lib/services/networkManagement2/lib/models/availableDelegation.js +++ /dev/null @@ -1,94 +0,0 @@ -/* - * 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'; - -/** - * The serviceName of an AvailableDelegation indicates a possible delegation - * for a subnet. - * - */ -class AvailableDelegation { - /** - * Create a AvailableDelegation. - * @property {string} [name] The name of the AvailableDelegation resource. - * @property {string} [id] A unique identifier of the AvailableDelegation - * resource. - * @property {string} [type] Resource type. - * @property {string} [serviceName] The name of the service and resource - * @property {array} [actions] Describes the actions permitted to the service - * upon delegation - */ - constructor() { - } - - /** - * Defines the metadata of AvailableDelegation - * - * @returns {object} metadata of AvailableDelegation - * - */ - mapper() { - return { - required: false, - serializedName: 'AvailableDelegation', - type: { - name: 'Composite', - className: 'AvailableDelegation', - modelProperties: { - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - type: { - required: false, - serializedName: 'type', - type: { - name: 'String' - } - }, - serviceName: { - required: false, - serializedName: 'serviceName', - type: { - name: 'String' - } - }, - actions: { - required: false, - serializedName: 'actions', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - } - } - } - }; - } -} - -module.exports = AvailableDelegation; diff --git a/lib/services/networkManagement2/lib/models/availableDelegationsResult.js b/lib/services/networkManagement2/lib/models/availableDelegationsResult.js deleted file mode 100644 index d83983818..000000000 --- a/lib/services/networkManagement2/lib/models/availableDelegationsResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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'; - -/** - * An array of available delegations. - */ -class AvailableDelegationsResult extends Array { - /** - * Create a AvailableDelegationsResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AvailableDelegationsResult - * - * @returns {object} metadata of AvailableDelegationsResult - * - */ - mapper() { - return { - required: false, - serializedName: 'AvailableDelegationsResult', - type: { - name: 'Composite', - className: 'AvailableDelegationsResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'AvailableDelegationElementType', - type: { - name: 'Composite', - className: 'AvailableDelegation' - } - } - } - }, - nextLink: { - required: false, - readOnly: true, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AvailableDelegationsResult; diff --git a/lib/services/networkManagement2/lib/models/availableProvidersList.js b/lib/services/networkManagement2/lib/models/availableProvidersList.js deleted file mode 100644 index 243d08dbd..000000000 --- a/lib/services/networkManagement2/lib/models/availableProvidersList.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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'; - -/** - * List of available countries with details. - * - */ -class AvailableProvidersList { - /** - * Create a AvailableProvidersList. - * @property {array} countries List of available countries. - */ - constructor() { - } - - /** - * Defines the metadata of AvailableProvidersList - * - * @returns {object} metadata of AvailableProvidersList - * - */ - mapper() { - return { - required: false, - serializedName: 'AvailableProvidersList', - type: { - name: 'Composite', - className: 'AvailableProvidersList', - modelProperties: { - countries: { - required: true, - serializedName: 'countries', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'AvailableProvidersListCountryElementType', - type: { - name: 'Composite', - className: 'AvailableProvidersListCountry' - } - } - } - } - } - } - }; - } -} - -module.exports = AvailableProvidersList; diff --git a/lib/services/networkManagement2/lib/models/availableProvidersListCity.js b/lib/services/networkManagement2/lib/models/availableProvidersListCity.js deleted file mode 100644 index 584d487ca..000000000 --- a/lib/services/networkManagement2/lib/models/availableProvidersListCity.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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'; - -/** - * City or town details. - * - */ -class AvailableProvidersListCity { - /** - * Create a AvailableProvidersListCity. - * @property {string} [cityName] The city or town name. - * @property {array} [providers] A list of Internet service providers. - */ - constructor() { - } - - /** - * Defines the metadata of AvailableProvidersListCity - * - * @returns {object} metadata of AvailableProvidersListCity - * - */ - mapper() { - return { - required: false, - serializedName: 'AvailableProvidersListCity', - type: { - name: 'Composite', - className: 'AvailableProvidersListCity', - modelProperties: { - cityName: { - required: false, - serializedName: 'cityName', - type: { - name: 'String' - } - }, - providers: { - required: false, - serializedName: 'providers', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - } - } - } - }; - } -} - -module.exports = AvailableProvidersListCity; diff --git a/lib/services/networkManagement2/lib/models/availableProvidersListCountry.js b/lib/services/networkManagement2/lib/models/availableProvidersListCountry.js deleted file mode 100644 index 50ff7dbf4..000000000 --- a/lib/services/networkManagement2/lib/models/availableProvidersListCountry.js +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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'; - -/** - * Country details. - * - */ -class AvailableProvidersListCountry { - /** - * Create a AvailableProvidersListCountry. - * @property {string} [countryName] The country name. - * @property {array} [providers] A list of Internet service providers. - * @property {array} [states] List of available states in the country. - */ - constructor() { - } - - /** - * Defines the metadata of AvailableProvidersListCountry - * - * @returns {object} metadata of AvailableProvidersListCountry - * - */ - mapper() { - return { - required: false, - serializedName: 'AvailableProvidersListCountry', - type: { - name: 'Composite', - className: 'AvailableProvidersListCountry', - modelProperties: { - countryName: { - required: false, - serializedName: 'countryName', - type: { - name: 'String' - } - }, - providers: { - required: false, - serializedName: 'providers', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - states: { - required: false, - serializedName: 'states', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'AvailableProvidersListStateElementType', - type: { - name: 'Composite', - className: 'AvailableProvidersListState' - } - } - } - } - } - } - }; - } -} - -module.exports = AvailableProvidersListCountry; diff --git a/lib/services/networkManagement2/lib/models/availableProvidersListParameters.js b/lib/services/networkManagement2/lib/models/availableProvidersListParameters.js deleted file mode 100644 index 2496be90a..000000000 --- a/lib/services/networkManagement2/lib/models/availableProvidersListParameters.js +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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'; - -/** - * Constraints that determine the list of available Internet service providers. - * - */ -class AvailableProvidersListParameters { - /** - * Create a AvailableProvidersListParameters. - * @property {array} [azureLocations] A list of Azure regions. - * @property {string} [country] The country for available providers list. - * @property {string} [state] The state for available providers list. - * @property {string} [city] The city or town for available providers list. - */ - constructor() { - } - - /** - * Defines the metadata of AvailableProvidersListParameters - * - * @returns {object} metadata of AvailableProvidersListParameters - * - */ - mapper() { - return { - required: false, - serializedName: 'AvailableProvidersListParameters', - type: { - name: 'Composite', - className: 'AvailableProvidersListParameters', - modelProperties: { - azureLocations: { - required: false, - serializedName: 'azureLocations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - country: { - required: false, - serializedName: 'country', - type: { - name: 'String' - } - }, - state: { - required: false, - serializedName: 'state', - type: { - name: 'String' - } - }, - city: { - required: false, - serializedName: 'city', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AvailableProvidersListParameters; diff --git a/lib/services/networkManagement2/lib/models/availableProvidersListState.js b/lib/services/networkManagement2/lib/models/availableProvidersListState.js deleted file mode 100644 index c2acfda38..000000000 --- a/lib/services/networkManagement2/lib/models/availableProvidersListState.js +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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'; - -/** - * State details. - * - */ -class AvailableProvidersListState { - /** - * Create a AvailableProvidersListState. - * @property {string} [stateName] The state name. - * @property {array} [providers] A list of Internet service providers. - * @property {array} [cities] List of available cities or towns in the state. - */ - constructor() { - } - - /** - * Defines the metadata of AvailableProvidersListState - * - * @returns {object} metadata of AvailableProvidersListState - * - */ - mapper() { - return { - required: false, - serializedName: 'AvailableProvidersListState', - type: { - name: 'Composite', - className: 'AvailableProvidersListState', - modelProperties: { - stateName: { - required: false, - serializedName: 'stateName', - type: { - name: 'String' - } - }, - providers: { - required: false, - serializedName: 'providers', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - cities: { - required: false, - serializedName: 'cities', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'AvailableProvidersListCityElementType', - type: { - name: 'Composite', - className: 'AvailableProvidersListCity' - } - } - } - } - } - } - }; - } -} - -module.exports = AvailableProvidersListState; diff --git a/lib/services/networkManagement2/lib/models/azureAsyncOperationResult.js b/lib/services/networkManagement2/lib/models/azureAsyncOperationResult.js deleted file mode 100644 index 7f6d7a5d4..000000000 --- a/lib/services/networkManagement2/lib/models/azureAsyncOperationResult.js +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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'; - -/** - * The response body contains the status of the specified asynchronous - * operation, indicating whether it has succeeded, is in progress, or has - * failed. Note that this status is distinct from the HTTP status code returned - * for the Get Operation Status operation itself. If the asynchronous operation - * succeeded, the response body includes the HTTP status code for the - * successful request. If the asynchronous operation failed, the response body - * includes the HTTP status code for the failed request and error information - * regarding the failure. - * - */ -class AzureAsyncOperationResult { - /** - * Create a AzureAsyncOperationResult. - * @property {string} [status] Status of the Azure async operation. Possible - * values are: 'InProgress', 'Succeeded', and 'Failed'. Possible values - * include: 'InProgress', 'Succeeded', 'Failed' - * @property {object} [error] - * @property {string} [error.code] - * @property {string} [error.message] - * @property {string} [error.target] - * @property {array} [error.details] - * @property {string} [error.innerError] - */ - constructor() { - } - - /** - * Defines the metadata of AzureAsyncOperationResult - * - * @returns {object} metadata of AzureAsyncOperationResult - * - */ - mapper() { - return { - required: false, - serializedName: 'AzureAsyncOperationResult', - type: { - name: 'Composite', - className: 'AzureAsyncOperationResult', - modelProperties: { - status: { - required: false, - serializedName: 'status', - type: { - name: 'String' - } - }, - error: { - required: false, - serializedName: 'error', - type: { - name: 'Composite', - className: 'ErrorModel' - } - } - } - } - }; - } -} - -module.exports = AzureAsyncOperationResult; diff --git a/lib/services/networkManagement2/lib/models/azureFirewall.js b/lib/services/networkManagement2/lib/models/azureFirewall.js deleted file mode 100644 index fd6928390..000000000 --- a/lib/services/networkManagement2/lib/models/azureFirewall.js +++ /dev/null @@ -1,180 +0,0 @@ -/* - * 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'); - -/** - * Azure Firewall resource - * - * @extends models['Resource'] - */ -class AzureFirewall extends models['Resource'] { - /** - * Create a AzureFirewall. - * @property {array} [applicationRuleCollections] Collection of application - * rule collections used by Azure Firewall. - * @property {array} [natRuleCollections] Collection of NAT rule collections - * used by Azure Firewall. - * @property {array} [networkRuleCollections] Collection of network rule - * collections used by Azure Firewall. - * @property {array} [ipConfigurations] IP configuration of the Azure - * Firewall resource. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AzureFirewall - * - * @returns {object} metadata of AzureFirewall - * - */ - mapper() { - return { - required: false, - serializedName: 'AzureFirewall', - type: { - name: 'Composite', - className: 'AzureFirewall', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - applicationRuleCollections: { - required: false, - serializedName: 'properties.applicationRuleCollections', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'AzureFirewallApplicationRuleCollectionElementType', - type: { - name: 'Composite', - className: 'AzureFirewallApplicationRuleCollection' - } - } - } - }, - natRuleCollections: { - required: false, - serializedName: 'properties.natRuleCollections', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'AzureFirewallNatRuleCollectionElementType', - type: { - name: 'Composite', - className: 'AzureFirewallNatRuleCollection' - } - } - } - }, - networkRuleCollections: { - required: false, - serializedName: 'properties.networkRuleCollections', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'AzureFirewallNetworkRuleCollectionElementType', - type: { - name: 'Composite', - className: 'AzureFirewallNetworkRuleCollection' - } - } - } - }, - ipConfigurations: { - required: false, - serializedName: 'properties.ipConfigurations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'AzureFirewallIPConfigurationElementType', - type: { - name: 'Composite', - className: 'AzureFirewallIPConfiguration' - } - } - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - etag: { - required: false, - readOnly: true, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AzureFirewall; diff --git a/lib/services/networkManagement2/lib/models/azureFirewallApplicationRule.js b/lib/services/networkManagement2/lib/models/azureFirewallApplicationRule.js deleted file mode 100644 index 24e274744..000000000 --- a/lib/services/networkManagement2/lib/models/azureFirewallApplicationRule.js +++ /dev/null @@ -1,122 +0,0 @@ -/* - * 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'; - -/** - * Properties of an application rule. - * - */ -class AzureFirewallApplicationRule { - /** - * Create a AzureFirewallApplicationRule. - * @property {string} [name] Name of the application rule. - * @property {string} [description] Description of the rule. - * @property {array} [sourceAddresses] List of source IP addresses for this - * rule. - * @property {array} [protocols] Array of ApplicationRuleProtocols. - * @property {array} [targetFqdns] List of FQDNs for this rule. - * @property {array} [fqdnTags] List of FQDN Tags for this rule. - */ - constructor() { - } - - /** - * Defines the metadata of AzureFirewallApplicationRule - * - * @returns {object} metadata of AzureFirewallApplicationRule - * - */ - mapper() { - return { - required: false, - serializedName: 'AzureFirewallApplicationRule', - type: { - name: 'Composite', - className: 'AzureFirewallApplicationRule', - modelProperties: { - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - description: { - required: false, - serializedName: 'description', - type: { - name: 'String' - } - }, - sourceAddresses: { - required: false, - serializedName: 'sourceAddresses', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - protocols: { - required: false, - serializedName: 'protocols', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'AzureFirewallApplicationRuleProtocolElementType', - type: { - name: 'Composite', - className: 'AzureFirewallApplicationRuleProtocol' - } - } - } - }, - targetFqdns: { - required: false, - serializedName: 'targetFqdns', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - fqdnTags: { - required: false, - serializedName: 'fqdnTags', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - } - } - } - }; - } -} - -module.exports = AzureFirewallApplicationRule; diff --git a/lib/services/networkManagement2/lib/models/azureFirewallApplicationRuleCollection.js b/lib/services/networkManagement2/lib/models/azureFirewallApplicationRuleCollection.js deleted file mode 100644 index 5701abe73..000000000 --- a/lib/services/networkManagement2/lib/models/azureFirewallApplicationRuleCollection.js +++ /dev/null @@ -1,125 +0,0 @@ -/* - * 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'); - -/** - * Application rule collection resource - * - * @extends models['SubResource'] - */ -class AzureFirewallApplicationRuleCollection extends models['SubResource'] { - /** - * Create a AzureFirewallApplicationRuleCollection. - * @property {number} [priority] Priority of the application rule collection - * resource. - * @property {object} [action] The action type of a rule collection - * @property {string} [action.type] The type of action. Possible values - * include: 'Allow', 'Deny' - * @property {array} [rules] Collection of rules used by a application rule - * collection. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * '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] Gets a unique read-only string that changes - * whenever the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AzureFirewallApplicationRuleCollection - * - * @returns {object} metadata of AzureFirewallApplicationRuleCollection - * - */ - mapper() { - return { - required: false, - serializedName: 'AzureFirewallApplicationRuleCollection', - type: { - name: 'Composite', - className: 'AzureFirewallApplicationRuleCollection', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - priority: { - required: false, - serializedName: 'properties.priority', - constraints: { - InclusiveMaximum: 65000, - InclusiveMinimum: 100 - }, - type: { - name: 'Number' - } - }, - action: { - required: false, - serializedName: 'properties.action', - type: { - name: 'Composite', - className: 'AzureFirewallRCAction' - } - }, - rules: { - required: false, - serializedName: 'properties.rules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'AzureFirewallApplicationRuleElementType', - type: { - name: 'Composite', - className: 'AzureFirewallApplicationRule' - } - } - } - }, - provisioningState: { - required: false, - 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 = AzureFirewallApplicationRuleCollection; diff --git a/lib/services/networkManagement2/lib/models/azureFirewallApplicationRuleProtocol.js b/lib/services/networkManagement2/lib/models/azureFirewallApplicationRuleProtocol.js deleted file mode 100644 index 389dd7f82..000000000 --- a/lib/services/networkManagement2/lib/models/azureFirewallApplicationRuleProtocol.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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'; - -/** - * Properties of the application rule protocol. - * - */ -class AzureFirewallApplicationRuleProtocol { - /** - * Create a AzureFirewallApplicationRuleProtocol. - * @property {string} [protocolType] Protocol type. Possible values include: - * 'Http', 'Https' - * @property {number} [port] Port number for the protocol, cannot be greater - * than 64000. This field is optional. - */ - constructor() { - } - - /** - * Defines the metadata of AzureFirewallApplicationRuleProtocol - * - * @returns {object} metadata of AzureFirewallApplicationRuleProtocol - * - */ - mapper() { - return { - required: false, - serializedName: 'AzureFirewallApplicationRuleProtocol', - type: { - name: 'Composite', - className: 'AzureFirewallApplicationRuleProtocol', - modelProperties: { - protocolType: { - required: false, - serializedName: 'protocolType', - type: { - name: 'String' - } - }, - port: { - required: false, - serializedName: 'port', - constraints: { - InclusiveMaximum: 64000, - InclusiveMinimum: 0 - }, - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = AzureFirewallApplicationRuleProtocol; diff --git a/lib/services/networkManagement2/lib/models/azureFirewallFqdnTag.js b/lib/services/networkManagement2/lib/models/azureFirewallFqdnTag.js deleted file mode 100644 index 1b5f4eca3..000000000 --- a/lib/services/networkManagement2/lib/models/azureFirewallFqdnTag.js +++ /dev/null @@ -1,121 +0,0 @@ -/* - * 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'); - -/** - * Azure Firewall FQDN Tag Resource - * - * @extends models['Resource'] - */ -class AzureFirewallFqdnTag extends models['Resource'] { - /** - * Create a AzureFirewallFqdnTag. - * @property {string} [provisioningState] The provisioning state of the - * resource. - * @property {string} [fqdnTagName] The name of this FQDN Tag. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AzureFirewallFqdnTag - * - * @returns {object} metadata of AzureFirewallFqdnTag - * - */ - mapper() { - return { - required: false, - serializedName: 'AzureFirewallFqdnTag', - type: { - name: 'Composite', - className: 'AzureFirewallFqdnTag', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - fqdnTagName: { - required: false, - readOnly: true, - serializedName: 'properties.fqdnTagName', - type: { - name: 'String' - } - }, - etag: { - required: false, - readOnly: true, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AzureFirewallFqdnTag; diff --git a/lib/services/networkManagement2/lib/models/azureFirewallFqdnTagListResult.js b/lib/services/networkManagement2/lib/models/azureFirewallFqdnTagListResult.js deleted file mode 100644 index 976fedc15..000000000 --- a/lib/services/networkManagement2/lib/models/azureFirewallFqdnTagListResult.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 ListAzureFirewallFqdnTags API service call. - */ -class AzureFirewallFqdnTagListResult extends Array { - /** - * Create a AzureFirewallFqdnTagListResult. - * @property {string} [nextLink] URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AzureFirewallFqdnTagListResult - * - * @returns {object} metadata of AzureFirewallFqdnTagListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'AzureFirewallFqdnTagListResult', - type: { - name: 'Composite', - className: 'AzureFirewallFqdnTagListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'AzureFirewallFqdnTagElementType', - type: { - name: 'Composite', - className: 'AzureFirewallFqdnTag' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AzureFirewallFqdnTagListResult; diff --git a/lib/services/networkManagement2/lib/models/azureFirewallIPConfiguration.js b/lib/services/networkManagement2/lib/models/azureFirewallIPConfiguration.js deleted file mode 100644 index e7e15ef69..000000000 --- a/lib/services/networkManagement2/lib/models/azureFirewallIPConfiguration.js +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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'); - -/** - * IP configuration of an Azure Firewall. - * - * @extends models['SubResource'] - */ -class AzureFirewallIPConfiguration extends models['SubResource'] { - /** - * Create a AzureFirewallIPConfiguration. - * @property {string} [privateIPAddress] The Firewall Internal Load Balancer - * IP to be used as the next hop in User Defined Routes. - * @property {object} [subnet] Reference of the subnet resource. This - * resource must be named 'AzureFirewallSubnet'. - * @property {string} [subnet.id] Resource ID. - * @property {object} [publicIPAddress] Reference of the PublicIP resource. - * This field is a mandatory input if subnet is not null. - * @property {string} [publicIPAddress.id] Resource ID. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * @property {string} [name] 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 AzureFirewallIPConfiguration - * - * @returns {object} metadata of AzureFirewallIPConfiguration - * - */ - mapper() { - return { - required: false, - serializedName: 'AzureFirewallIPConfiguration', - type: { - name: 'Composite', - className: 'AzureFirewallIPConfiguration', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - privateIPAddress: { - required: false, - readOnly: true, - serializedName: 'properties.privateIPAddress', - type: { - name: 'String' - } - }, - subnet: { - required: false, - serializedName: 'properties.subnet', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - publicIPAddress: { - required: false, - serializedName: 'properties.publicIPAddress', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - provisioningState: { - required: false, - 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 = AzureFirewallIPConfiguration; diff --git a/lib/services/networkManagement2/lib/models/azureFirewallListResult.js b/lib/services/networkManagement2/lib/models/azureFirewallListResult.js deleted file mode 100644 index 127c313db..000000000 --- a/lib/services/networkManagement2/lib/models/azureFirewallListResult.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 ListAzureFirewalls API service call. - */ -class AzureFirewallListResult extends Array { - /** - * Create a AzureFirewallListResult. - * @property {string} [nextLink] URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AzureFirewallListResult - * - * @returns {object} metadata of AzureFirewallListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'AzureFirewallListResult', - type: { - name: 'Composite', - className: 'AzureFirewallListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'AzureFirewallElementType', - type: { - name: 'Composite', - className: 'AzureFirewall' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AzureFirewallListResult; diff --git a/lib/services/networkManagement2/lib/models/azureFirewallNatRCAction.js b/lib/services/networkManagement2/lib/models/azureFirewallNatRCAction.js deleted file mode 100644 index fa76e9408..000000000 --- a/lib/services/networkManagement2/lib/models/azureFirewallNatRCAction.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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'; - -/** - * AzureFirewall NAT Rule Collection Action. - * - */ -class AzureFirewallNatRCAction { - /** - * Create a AzureFirewallNatRCAction. - * @property {string} [type] The type of action. Possible values include: - * 'Snat', 'Dnat' - */ - constructor() { - } - - /** - * Defines the metadata of AzureFirewallNatRCAction - * - * @returns {object} metadata of AzureFirewallNatRCAction - * - */ - mapper() { - return { - required: false, - serializedName: 'AzureFirewallNatRCAction', - type: { - name: 'Composite', - className: 'AzureFirewallNatRCAction', - modelProperties: { - type: { - required: false, - serializedName: 'type', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AzureFirewallNatRCAction; diff --git a/lib/services/networkManagement2/lib/models/azureFirewallNatRule.js b/lib/services/networkManagement2/lib/models/azureFirewallNatRule.js deleted file mode 100644 index 06e3136e1..000000000 --- a/lib/services/networkManagement2/lib/models/azureFirewallNatRule.js +++ /dev/null @@ -1,140 +0,0 @@ -/* - * 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'; - -/** - * Properties of a NAT rule. - * - */ -class AzureFirewallNatRule { - /** - * Create a AzureFirewallNatRule. - * @property {string} [name] Name of the NAT rule. - * @property {string} [description] Description of the rule. - * @property {array} [sourceAddresses] List of source IP addresses for this - * rule. - * @property {array} [destinationAddresses] List of destination IP addresses - * for this rule. - * @property {array} [destinationPorts] List of destination ports. - * @property {array} [protocols] Array of AzureFirewallNetworkRuleProtocols - * applicable to this NAT rule. - * @property {string} [translatedAddress] The translated address for this NAT - * rule. - * @property {string} [translatedPort] The translated port for this NAT rule. - */ - constructor() { - } - - /** - * Defines the metadata of AzureFirewallNatRule - * - * @returns {object} metadata of AzureFirewallNatRule - * - */ - mapper() { - return { - required: false, - serializedName: 'AzureFirewallNatRule', - type: { - name: 'Composite', - className: 'AzureFirewallNatRule', - modelProperties: { - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - description: { - required: false, - serializedName: 'description', - type: { - name: 'String' - } - }, - sourceAddresses: { - required: false, - serializedName: 'sourceAddresses', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - destinationAddresses: { - required: false, - serializedName: 'destinationAddresses', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - destinationPorts: { - required: false, - serializedName: 'destinationPorts', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - protocols: { - required: false, - serializedName: 'protocols', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'AzureFirewallNetworkRuleProtocolElementType', - type: { - name: 'String' - } - } - } - }, - translatedAddress: { - required: false, - serializedName: 'translatedAddress', - type: { - name: 'String' - } - }, - translatedPort: { - required: false, - serializedName: 'translatedPort', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AzureFirewallNatRule; diff --git a/lib/services/networkManagement2/lib/models/azureFirewallNatRuleCollection.js b/lib/services/networkManagement2/lib/models/azureFirewallNatRuleCollection.js deleted file mode 100644 index 6366f05d8..000000000 --- a/lib/services/networkManagement2/lib/models/azureFirewallNatRuleCollection.js +++ /dev/null @@ -1,125 +0,0 @@ -/* - * 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'); - -/** - * NAT rule collection resource - * - * @extends models['SubResource'] - */ -class AzureFirewallNatRuleCollection extends models['SubResource'] { - /** - * Create a AzureFirewallNatRuleCollection. - * @property {number} [priority] Priority of the NAT rule collection - * resource. - * @property {object} [action] The action type of a NAT rule collection - * @property {string} [action.type] The type of action. Possible values - * include: 'Snat', 'Dnat' - * @property {array} [rules] Collection of rules used by a NAT rule - * collection. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * '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] Gets a unique read-only string that changes - * whenever the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AzureFirewallNatRuleCollection - * - * @returns {object} metadata of AzureFirewallNatRuleCollection - * - */ - mapper() { - return { - required: false, - serializedName: 'AzureFirewallNatRuleCollection', - type: { - name: 'Composite', - className: 'AzureFirewallNatRuleCollection', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - priority: { - required: false, - serializedName: 'properties.priority', - constraints: { - InclusiveMaximum: 65000, - InclusiveMinimum: 100 - }, - type: { - name: 'Number' - } - }, - action: { - required: false, - serializedName: 'properties.action', - type: { - name: 'Composite', - className: 'AzureFirewallNatRCAction' - } - }, - rules: { - required: false, - serializedName: 'properties.rules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'AzureFirewallNatRuleElementType', - type: { - name: 'Composite', - className: 'AzureFirewallNatRule' - } - } - } - }, - provisioningState: { - required: false, - 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 = AzureFirewallNatRuleCollection; diff --git a/lib/services/networkManagement2/lib/models/azureFirewallNetworkRule.js b/lib/services/networkManagement2/lib/models/azureFirewallNetworkRule.js deleted file mode 100644 index 54833d3f2..000000000 --- a/lib/services/networkManagement2/lib/models/azureFirewallNetworkRule.js +++ /dev/null @@ -1,121 +0,0 @@ -/* - * 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'; - -/** - * Properties of the network rule. - * - */ -class AzureFirewallNetworkRule { - /** - * Create a AzureFirewallNetworkRule. - * @property {string} [name] Name of the network rule. - * @property {string} [description] Description of the rule. - * @property {array} [protocols] Array of AzureFirewallNetworkRuleProtocols. - * @property {array} [sourceAddresses] List of source IP addresses for this - * rule. - * @property {array} [destinationAddresses] List of destination IP addresses. - * @property {array} [destinationPorts] List of destination ports. - */ - constructor() { - } - - /** - * Defines the metadata of AzureFirewallNetworkRule - * - * @returns {object} metadata of AzureFirewallNetworkRule - * - */ - mapper() { - return { - required: false, - serializedName: 'AzureFirewallNetworkRule', - type: { - name: 'Composite', - className: 'AzureFirewallNetworkRule', - modelProperties: { - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - description: { - required: false, - serializedName: 'description', - type: { - name: 'String' - } - }, - protocols: { - required: false, - serializedName: 'protocols', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'AzureFirewallNetworkRuleProtocolElementType', - type: { - name: 'String' - } - } - } - }, - sourceAddresses: { - required: false, - serializedName: 'sourceAddresses', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - destinationAddresses: { - required: false, - serializedName: 'destinationAddresses', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - destinationPorts: { - required: false, - serializedName: 'destinationPorts', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - } - } - } - }; - } -} - -module.exports = AzureFirewallNetworkRule; diff --git a/lib/services/networkManagement2/lib/models/azureFirewallNetworkRuleCollection.js b/lib/services/networkManagement2/lib/models/azureFirewallNetworkRuleCollection.js deleted file mode 100644 index 56d3d62f4..000000000 --- a/lib/services/networkManagement2/lib/models/azureFirewallNetworkRuleCollection.js +++ /dev/null @@ -1,125 +0,0 @@ -/* - * 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'); - -/** - * Network rule collection resource - * - * @extends models['SubResource'] - */ -class AzureFirewallNetworkRuleCollection extends models['SubResource'] { - /** - * Create a AzureFirewallNetworkRuleCollection. - * @property {number} [priority] Priority of the network rule collection - * resource. - * @property {object} [action] The action type of a rule collection - * @property {string} [action.type] The type of action. Possible values - * include: 'Allow', 'Deny' - * @property {array} [rules] Collection of rules used by a network rule - * collection. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * '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] Gets a unique read-only string that changes - * whenever the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AzureFirewallNetworkRuleCollection - * - * @returns {object} metadata of AzureFirewallNetworkRuleCollection - * - */ - mapper() { - return { - required: false, - serializedName: 'AzureFirewallNetworkRuleCollection', - type: { - name: 'Composite', - className: 'AzureFirewallNetworkRuleCollection', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - priority: { - required: false, - serializedName: 'properties.priority', - constraints: { - InclusiveMaximum: 65000, - InclusiveMinimum: 100 - }, - type: { - name: 'Number' - } - }, - action: { - required: false, - serializedName: 'properties.action', - type: { - name: 'Composite', - className: 'AzureFirewallRCAction' - } - }, - rules: { - required: false, - serializedName: 'properties.rules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'AzureFirewallNetworkRuleElementType', - type: { - name: 'Composite', - className: 'AzureFirewallNetworkRule' - } - } - } - }, - provisioningState: { - required: false, - 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 = AzureFirewallNetworkRuleCollection; diff --git a/lib/services/networkManagement2/lib/models/azureFirewallRCAction.js b/lib/services/networkManagement2/lib/models/azureFirewallRCAction.js deleted file mode 100644 index ab9dfbe70..000000000 --- a/lib/services/networkManagement2/lib/models/azureFirewallRCAction.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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'; - -/** - * Properties of the AzureFirewallRCAction. - * - */ -class AzureFirewallRCAction { - /** - * Create a AzureFirewallRCAction. - * @property {string} [type] The type of action. Possible values include: - * 'Allow', 'Deny' - */ - constructor() { - } - - /** - * Defines the metadata of AzureFirewallRCAction - * - * @returns {object} metadata of AzureFirewallRCAction - * - */ - mapper() { - return { - required: false, - serializedName: 'AzureFirewallRCAction', - type: { - name: 'Composite', - className: 'AzureFirewallRCAction', - modelProperties: { - type: { - required: false, - serializedName: 'type', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AzureFirewallRCAction; diff --git a/lib/services/networkManagement2/lib/models/azureReachabilityReport.js b/lib/services/networkManagement2/lib/models/azureReachabilityReport.js deleted file mode 100644 index 02d1416d6..000000000 --- a/lib/services/networkManagement2/lib/models/azureReachabilityReport.js +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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'; - -/** - * Azure reachability report details. - * - */ -class AzureReachabilityReport { - /** - * Create a AzureReachabilityReport. - * @property {string} aggregationLevel The aggregation level of Azure - * reachability report. Can be Country, State or City. - * @property {object} providerLocation - * @property {string} [providerLocation.country] The name of the country. - * @property {string} [providerLocation.state] The name of the state. - * @property {string} [providerLocation.city] The name of the city or town. - * @property {array} reachabilityReport List of Azure reachability report - * items. - */ - constructor() { - } - - /** - * Defines the metadata of AzureReachabilityReport - * - * @returns {object} metadata of AzureReachabilityReport - * - */ - mapper() { - return { - required: false, - serializedName: 'AzureReachabilityReport', - type: { - name: 'Composite', - className: 'AzureReachabilityReport', - modelProperties: { - aggregationLevel: { - required: true, - serializedName: 'aggregationLevel', - type: { - name: 'String' - } - }, - providerLocation: { - required: true, - serializedName: 'providerLocation', - type: { - name: 'Composite', - className: 'AzureReachabilityReportLocation' - } - }, - reachabilityReport: { - required: true, - serializedName: 'reachabilityReport', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'AzureReachabilityReportItemElementType', - type: { - name: 'Composite', - className: 'AzureReachabilityReportItem' - } - } - } - } - } - } - }; - } -} - -module.exports = AzureReachabilityReport; diff --git a/lib/services/networkManagement2/lib/models/azureReachabilityReportItem.js b/lib/services/networkManagement2/lib/models/azureReachabilityReportItem.js deleted file mode 100644 index ab000ae15..000000000 --- a/lib/services/networkManagement2/lib/models/azureReachabilityReportItem.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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'; - -/** - * Azure reachability report details for a given provider location. - * - */ -class AzureReachabilityReportItem { - /** - * Create a AzureReachabilityReportItem. - * @property {string} [provider] The Internet service provider. - * @property {string} [azureLocation] The Azure region. - * @property {array} [latencies] List of latency details for each of the time - * series. - */ - constructor() { - } - - /** - * Defines the metadata of AzureReachabilityReportItem - * - * @returns {object} metadata of AzureReachabilityReportItem - * - */ - mapper() { - return { - required: false, - serializedName: 'AzureReachabilityReportItem', - type: { - name: 'Composite', - className: 'AzureReachabilityReportItem', - modelProperties: { - provider: { - required: false, - serializedName: 'provider', - type: { - name: 'String' - } - }, - azureLocation: { - required: false, - serializedName: 'azureLocation', - type: { - name: 'String' - } - }, - latencies: { - required: false, - serializedName: 'latencies', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'AzureReachabilityReportLatencyInfoElementType', - type: { - name: 'Composite', - className: 'AzureReachabilityReportLatencyInfo' - } - } - } - } - } - } - }; - } -} - -module.exports = AzureReachabilityReportItem; diff --git a/lib/services/networkManagement2/lib/models/azureReachabilityReportLatencyInfo.js b/lib/services/networkManagement2/lib/models/azureReachabilityReportLatencyInfo.js deleted file mode 100644 index aec147f04..000000000 --- a/lib/services/networkManagement2/lib/models/azureReachabilityReportLatencyInfo.js +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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'; - -/** - * Details on latency for a time series. - * - */ -class AzureReachabilityReportLatencyInfo { - /** - * Create a AzureReachabilityReportLatencyInfo. - * @property {date} [timeStamp] The time stamp. - * @property {number} [score] The relative latency score between 1 and 100, - * higher values indicating a faster connection. - */ - constructor() { - } - - /** - * Defines the metadata of AzureReachabilityReportLatencyInfo - * - * @returns {object} metadata of AzureReachabilityReportLatencyInfo - * - */ - mapper() { - return { - required: false, - serializedName: 'AzureReachabilityReportLatencyInfo', - type: { - name: 'Composite', - className: 'AzureReachabilityReportLatencyInfo', - modelProperties: { - timeStamp: { - required: false, - serializedName: 'timeStamp', - type: { - name: 'DateTime' - } - }, - score: { - required: false, - serializedName: 'score', - constraints: { - InclusiveMaximum: 100, - InclusiveMinimum: 1 - }, - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = AzureReachabilityReportLatencyInfo; diff --git a/lib/services/networkManagement2/lib/models/azureReachabilityReportLocation.js b/lib/services/networkManagement2/lib/models/azureReachabilityReportLocation.js deleted file mode 100644 index 8264f28a9..000000000 --- a/lib/services/networkManagement2/lib/models/azureReachabilityReportLocation.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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'; - -/** - * Parameters that define a geographic location. - * - */ -class AzureReachabilityReportLocation { - /** - * Create a AzureReachabilityReportLocation. - * @property {string} country The name of the country. - * @property {string} [state] The name of the state. - * @property {string} [city] The name of the city or town. - */ - constructor() { - } - - /** - * Defines the metadata of AzureReachabilityReportLocation - * - * @returns {object} metadata of AzureReachabilityReportLocation - * - */ - mapper() { - return { - required: false, - serializedName: 'AzureReachabilityReportLocation', - type: { - name: 'Composite', - className: 'AzureReachabilityReportLocation', - modelProperties: { - country: { - required: true, - serializedName: 'country', - type: { - name: 'String' - } - }, - state: { - required: false, - serializedName: 'state', - type: { - name: 'String' - } - }, - city: { - required: false, - serializedName: 'city', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AzureReachabilityReportLocation; diff --git a/lib/services/networkManagement2/lib/models/azureReachabilityReportParameters.js b/lib/services/networkManagement2/lib/models/azureReachabilityReportParameters.js deleted file mode 100644 index 8d339681a..000000000 --- a/lib/services/networkManagement2/lib/models/azureReachabilityReportParameters.js +++ /dev/null @@ -1,104 +0,0 @@ -/* - * 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'; - -/** - * Geographic and time constraints for Azure reachability report. - * - */ -class AzureReachabilityReportParameters { - /** - * Create a AzureReachabilityReportParameters. - * @property {object} providerLocation - * @property {string} [providerLocation.country] The name of the country. - * @property {string} [providerLocation.state] The name of the state. - * @property {string} [providerLocation.city] The name of the city or town. - * @property {array} [providers] List of Internet service providers. - * @property {array} [azureLocations] Optional Azure regions to scope the - * query to. - * @property {date} startTime The start time for the Azure reachability - * report. - * @property {date} endTime The end time for the Azure reachability report. - */ - constructor() { - } - - /** - * Defines the metadata of AzureReachabilityReportParameters - * - * @returns {object} metadata of AzureReachabilityReportParameters - * - */ - mapper() { - return { - required: false, - serializedName: 'AzureReachabilityReportParameters', - type: { - name: 'Composite', - className: 'AzureReachabilityReportParameters', - modelProperties: { - providerLocation: { - required: true, - serializedName: 'providerLocation', - type: { - name: 'Composite', - className: 'AzureReachabilityReportLocation' - } - }, - providers: { - required: false, - serializedName: 'providers', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - azureLocations: { - required: false, - serializedName: 'azureLocations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - startTime: { - required: true, - serializedName: 'startTime', - type: { - name: 'DateTime' - } - }, - endTime: { - required: true, - serializedName: 'endTime', - type: { - name: 'DateTime' - } - } - } - } - }; - } -} - -module.exports = AzureReachabilityReportParameters; diff --git a/lib/services/networkManagement2/lib/models/bGPCommunity.js b/lib/services/networkManagement2/lib/models/bGPCommunity.js deleted file mode 100644 index 584045928..000000000 --- a/lib/services/networkManagement2/lib/models/bGPCommunity.js +++ /dev/null @@ -1,106 +0,0 @@ -/* - * 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'; - -/** - * Contains bgp community information offered in Service Community resources. - * - */ -class BGPCommunity { - /** - * Create a BGPCommunity. - * @property {string} [serviceSupportedRegion] The region which the service - * support. e.g. For O365, region is Global. - * @property {string} [communityName] The name of the bgp community. e.g. - * Skype. - * @property {string} [communityValue] The value of the bgp community. For - * more information: - * https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. - * @property {array} [communityPrefixes] The prefixes that the bgp community - * contains. - * @property {boolean} [isAuthorizedToUse] Customer is authorized to use bgp - * community or not. - * @property {string} [serviceGroup] The service group of the bgp community - * contains. - */ - constructor() { - } - - /** - * Defines the metadata of BGPCommunity - * - * @returns {object} metadata of BGPCommunity - * - */ - mapper() { - return { - required: false, - serializedName: 'BGPCommunity', - type: { - name: 'Composite', - className: 'BGPCommunity', - modelProperties: { - serviceSupportedRegion: { - required: false, - serializedName: 'serviceSupportedRegion', - type: { - name: 'String' - } - }, - communityName: { - required: false, - serializedName: 'communityName', - type: { - name: 'String' - } - }, - communityValue: { - required: false, - serializedName: 'communityValue', - type: { - name: 'String' - } - }, - communityPrefixes: { - required: false, - serializedName: 'communityPrefixes', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - isAuthorizedToUse: { - required: false, - serializedName: 'isAuthorizedToUse', - type: { - name: 'Boolean' - } - }, - serviceGroup: { - required: false, - serializedName: 'serviceGroup', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = BGPCommunity; diff --git a/lib/services/networkManagement2/lib/models/backendAddressPool.js b/lib/services/networkManagement2/lib/models/backendAddressPool.js deleted file mode 100644 index 40d749467..000000000 --- a/lib/services/networkManagement2/lib/models/backendAddressPool.js +++ /dev/null @@ -1,131 +0,0 @@ -/* - * 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'); - -/** - * Pool of backend IP addresses. - * - * @extends models['SubResource'] - */ -class BackendAddressPool extends models['SubResource'] { - /** - * Create a BackendAddressPool. - * @property {array} [backendIPConfigurations] Gets collection of references - * to IP addresses defined in network interfaces. - * @property {array} [loadBalancingRules] Gets load balancing rules that use - * this backend address pool. - * @property {object} [outboundRule] Gets outbound rules that use this - * backend address pool. - * @property {string} [outboundRule.id] Resource ID. - * @property {string} [provisioningState] Get provisioning state of the - * public IP resource. Possible values are: '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 BackendAddressPool - * - * @returns {object} metadata of BackendAddressPool - * - */ - mapper() { - return { - required: false, - serializedName: 'BackendAddressPool', - type: { - name: 'Composite', - className: 'BackendAddressPool', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - backendIPConfigurations: { - required: false, - readOnly: true, - serializedName: 'properties.backendIPConfigurations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'NetworkInterfaceIPConfigurationElementType', - type: { - name: 'Composite', - className: 'NetworkInterfaceIPConfiguration' - } - } - } - }, - loadBalancingRules: { - required: false, - readOnly: true, - serializedName: 'properties.loadBalancingRules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SubResourceElementType', - type: { - name: 'Composite', - className: 'SubResource' - } - } - } - }, - outboundRule: { - required: false, - readOnly: true, - serializedName: 'properties.outboundRule', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = BackendAddressPool; diff --git a/lib/services/networkManagement2/lib/models/bgpPeerStatus.js b/lib/services/networkManagement2/lib/models/bgpPeerStatus.js deleted file mode 100644 index d0b7cbae4..000000000 --- a/lib/services/networkManagement2/lib/models/bgpPeerStatus.js +++ /dev/null @@ -1,121 +0,0 @@ -/* - * 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'; - -/** - * BGP peer status details - * - */ -class BgpPeerStatus { - /** - * Create a BgpPeerStatus. - * @property {string} [localAddress] The virtual network gateway's local - * address - * @property {string} [neighbor] The remote BGP peer - * @property {number} [asn] The autonomous system number of the remote BGP - * peer - * @property {string} [state] The BGP peer state. Possible values include: - * 'Unknown', 'Stopped', 'Idle', 'Connecting', 'Connected' - * @property {string} [connectedDuration] For how long the peering has been - * up - * @property {number} [routesReceived] The number of routes learned from this - * peer - * @property {number} [messagesSent] The number of BGP messages sent - * @property {number} [messagesReceived] The number of BGP messages received - */ - constructor() { - } - - /** - * Defines the metadata of BgpPeerStatus - * - * @returns {object} metadata of BgpPeerStatus - * - */ - mapper() { - return { - required: false, - serializedName: 'BgpPeerStatus', - type: { - name: 'Composite', - className: 'BgpPeerStatus', - modelProperties: { - localAddress: { - required: false, - readOnly: true, - serializedName: 'localAddress', - type: { - name: 'String' - } - }, - neighbor: { - required: false, - readOnly: true, - serializedName: 'neighbor', - type: { - name: 'String' - } - }, - asn: { - required: false, - readOnly: true, - serializedName: 'asn', - type: { - name: 'Number' - } - }, - state: { - required: false, - readOnly: true, - serializedName: 'state', - type: { - name: 'String' - } - }, - connectedDuration: { - required: false, - readOnly: true, - serializedName: 'connectedDuration', - type: { - name: 'String' - } - }, - routesReceived: { - required: false, - readOnly: true, - serializedName: 'routesReceived', - type: { - name: 'Number' - } - }, - messagesSent: { - required: false, - readOnly: true, - serializedName: 'messagesSent', - type: { - name: 'Number' - } - }, - messagesReceived: { - required: false, - readOnly: true, - serializedName: 'messagesReceived', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = BgpPeerStatus; diff --git a/lib/services/networkManagement2/lib/models/bgpPeerStatusListResult.js b/lib/services/networkManagement2/lib/models/bgpPeerStatusListResult.js deleted file mode 100644 index 53008c42f..000000000 --- a/lib/services/networkManagement2/lib/models/bgpPeerStatusListResult.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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 list BGP peer status API service call - * - */ -class BgpPeerStatusListResult { - /** - * Create a BgpPeerStatusListResult. - * @property {array} [value] List of BGP peers - */ - constructor() { - } - - /** - * Defines the metadata of BgpPeerStatusListResult - * - * @returns {object} metadata of BgpPeerStatusListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'BgpPeerStatusListResult', - type: { - name: 'Composite', - className: 'BgpPeerStatusListResult', - modelProperties: { - value: { - required: false, - serializedName: 'value', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'BgpPeerStatusElementType', - type: { - name: 'Composite', - className: 'BgpPeerStatus' - } - } - } - } - } - } - }; - } -} - -module.exports = BgpPeerStatusListResult; diff --git a/lib/services/networkManagement2/lib/models/bgpServiceCommunity.js b/lib/services/networkManagement2/lib/models/bgpServiceCommunity.js deleted file mode 100644 index c9c2ae3dc..000000000 --- a/lib/services/networkManagement2/lib/models/bgpServiceCommunity.js +++ /dev/null @@ -1,117 +0,0 @@ -/* - * 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'); - -/** - * Service Community Properties. - * - * @extends models['Resource'] - */ -class BgpServiceCommunity extends models['Resource'] { - /** - * Create a BgpServiceCommunity. - * @property {string} [serviceName] The name of the bgp community. e.g. - * Skype. - * @property {array} [bgpCommunities] Get a list of bgp communities. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of BgpServiceCommunity - * - * @returns {object} metadata of BgpServiceCommunity - * - */ - mapper() { - return { - required: false, - serializedName: 'BgpServiceCommunity', - type: { - name: 'Composite', - className: 'BgpServiceCommunity', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - serviceName: { - required: false, - serializedName: 'properties.serviceName', - type: { - name: 'String' - } - }, - bgpCommunities: { - required: false, - serializedName: 'properties.bgpCommunities', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'BGPCommunityElementType', - type: { - name: 'Composite', - className: 'BGPCommunity' - } - } - } - } - } - } - }; - } -} - -module.exports = BgpServiceCommunity; diff --git a/lib/services/networkManagement2/lib/models/bgpServiceCommunityListResult.js b/lib/services/networkManagement2/lib/models/bgpServiceCommunityListResult.js deleted file mode 100644 index b7699fc2f..000000000 --- a/lib/services/networkManagement2/lib/models/bgpServiceCommunityListResult.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 the ListServiceCommunity API service call. - */ -class BgpServiceCommunityListResult extends Array { - /** - * Create a BgpServiceCommunityListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of BgpServiceCommunityListResult - * - * @returns {object} metadata of BgpServiceCommunityListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'BgpServiceCommunityListResult', - type: { - name: 'Composite', - className: 'BgpServiceCommunityListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'BgpServiceCommunityElementType', - type: { - name: 'Composite', - className: 'BgpServiceCommunity' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = BgpServiceCommunityListResult; diff --git a/lib/services/networkManagement2/lib/models/bgpSettings.js b/lib/services/networkManagement2/lib/models/bgpSettings.js deleted file mode 100644 index 331a92538..000000000 --- a/lib/services/networkManagement2/lib/models/bgpSettings.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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'; - -/** - * BGP settings details - * - */ -class BgpSettings { - /** - * Create a BgpSettings. - * @property {number} [asn] The BGP speaker's ASN. - * @property {string} [bgpPeeringAddress] The BGP peering address and BGP - * identifier of this BGP speaker. - * @property {number} [peerWeight] The weight added to routes learned from - * this BGP speaker. - */ - constructor() { - } - - /** - * Defines the metadata of BgpSettings - * - * @returns {object} metadata of BgpSettings - * - */ - mapper() { - return { - required: false, - serializedName: 'BgpSettings', - type: { - name: 'Composite', - className: 'BgpSettings', - modelProperties: { - asn: { - required: false, - serializedName: 'asn', - type: { - name: 'Number' - } - }, - bgpPeeringAddress: { - required: false, - serializedName: 'bgpPeeringAddress', - type: { - name: 'String' - } - }, - peerWeight: { - required: false, - serializedName: 'peerWeight', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = BgpSettings; diff --git a/lib/services/networkManagement2/lib/models/connectionMonitor.js b/lib/services/networkManagement2/lib/models/connectionMonitor.js deleted file mode 100644 index a1bffd79e..000000000 --- a/lib/services/networkManagement2/lib/models/connectionMonitor.js +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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'; - -/** - * Parameters that define the operation to create a connection monitor. - * - */ -class ConnectionMonitor { - /** - * Create a ConnectionMonitor. - * @property {string} [location] Connection monitor location. - * @property {object} [tags] Connection monitor tags. - * @property {object} source - * @property {string} [source.resourceId] The ID of the resource used as the - * source by connection monitor. - * @property {number} [source.port] The source port used by connection - * monitor. - * @property {object} destination - * @property {string} [destination.resourceId] The ID of the resource used as - * the destination by connection monitor. - * @property {string} [destination.address] Address of the connection monitor - * destination (IP or domain name). - * @property {number} [destination.port] The destination port used by - * connection monitor. - * @property {boolean} [autoStart] Determines if the connection monitor will - * start automatically once created. Default value: true . - * @property {number} [monitoringIntervalInSeconds] Monitoring interval in - * seconds. Default value: 60 . - */ - constructor() { - } - - /** - * Defines the metadata of ConnectionMonitor - * - * @returns {object} metadata of ConnectionMonitor - * - */ - mapper() { - return { - required: false, - serializedName: 'ConnectionMonitor', - type: { - name: 'Composite', - className: 'ConnectionMonitor', - modelProperties: { - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - source: { - required: true, - serializedName: 'properties.source', - type: { - name: 'Composite', - className: 'ConnectionMonitorSource' - } - }, - destination: { - required: true, - serializedName: 'properties.destination', - type: { - name: 'Composite', - className: 'ConnectionMonitorDestination' - } - }, - autoStart: { - required: false, - serializedName: 'properties.autoStart', - defaultValue: true, - type: { - name: 'Boolean' - } - }, - monitoringIntervalInSeconds: { - required: false, - serializedName: 'properties.monitoringIntervalInSeconds', - defaultValue: 60, - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = ConnectionMonitor; diff --git a/lib/services/networkManagement2/lib/models/connectionMonitorDestination.js b/lib/services/networkManagement2/lib/models/connectionMonitorDestination.js deleted file mode 100644 index 4d4244d8e..000000000 --- a/lib/services/networkManagement2/lib/models/connectionMonitorDestination.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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'; - -/** - * Describes the destination of connection monitor. - * - */ -class ConnectionMonitorDestination { - /** - * Create a ConnectionMonitorDestination. - * @property {string} [resourceId] The ID of the resource used as the - * destination by connection monitor. - * @property {string} [address] Address of the connection monitor destination - * (IP or domain name). - * @property {number} [port] The destination port used by connection monitor. - */ - constructor() { - } - - /** - * Defines the metadata of ConnectionMonitorDestination - * - * @returns {object} metadata of ConnectionMonitorDestination - * - */ - mapper() { - return { - required: false, - serializedName: 'ConnectionMonitorDestination', - type: { - name: 'Composite', - className: 'ConnectionMonitorDestination', - modelProperties: { - resourceId: { - required: false, - serializedName: 'resourceId', - type: { - name: 'String' - } - }, - address: { - required: false, - serializedName: 'address', - type: { - name: 'String' - } - }, - port: { - required: false, - serializedName: 'port', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = ConnectionMonitorDestination; diff --git a/lib/services/networkManagement2/lib/models/connectionMonitorListResult.js b/lib/services/networkManagement2/lib/models/connectionMonitorListResult.js deleted file mode 100644 index d9a476a32..000000000 --- a/lib/services/networkManagement2/lib/models/connectionMonitorListResult.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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'; - -/** - * List of connection monitors. - */ -class ConnectionMonitorListResult extends Array { - /** - * Create a ConnectionMonitorListResult. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ConnectionMonitorListResult - * - * @returns {object} metadata of ConnectionMonitorListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ConnectionMonitorListResult', - type: { - name: 'Composite', - className: 'ConnectionMonitorListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ConnectionMonitorResultElementType', - type: { - name: 'Composite', - className: 'ConnectionMonitorResult' - } - } - } - } - } - } - }; - } -} - -module.exports = ConnectionMonitorListResult; diff --git a/lib/services/networkManagement2/lib/models/connectionMonitorParameters.js b/lib/services/networkManagement2/lib/models/connectionMonitorParameters.js deleted file mode 100644 index 7aa5127e9..000000000 --- a/lib/services/networkManagement2/lib/models/connectionMonitorParameters.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * 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'; - -/** - * Parameters that define the operation to create a connection monitor. - * - */ -class ConnectionMonitorParameters { - /** - * Create a ConnectionMonitorParameters. - * @property {object} source - * @property {string} [source.resourceId] The ID of the resource used as the - * source by connection monitor. - * @property {number} [source.port] The source port used by connection - * monitor. - * @property {object} destination - * @property {string} [destination.resourceId] The ID of the resource used as - * the destination by connection monitor. - * @property {string} [destination.address] Address of the connection monitor - * destination (IP or domain name). - * @property {number} [destination.port] The destination port used by - * connection monitor. - * @property {boolean} [autoStart] Determines if the connection monitor will - * start automatically once created. Default value: true . - * @property {number} [monitoringIntervalInSeconds] Monitoring interval in - * seconds. Default value: 60 . - */ - constructor() { - } - - /** - * Defines the metadata of ConnectionMonitorParameters - * - * @returns {object} metadata of ConnectionMonitorParameters - * - */ - mapper() { - return { - required: false, - serializedName: 'ConnectionMonitorParameters', - type: { - name: 'Composite', - className: 'ConnectionMonitorParameters', - modelProperties: { - source: { - required: true, - serializedName: 'source', - type: { - name: 'Composite', - className: 'ConnectionMonitorSource' - } - }, - destination: { - required: true, - serializedName: 'destination', - type: { - name: 'Composite', - className: 'ConnectionMonitorDestination' - } - }, - autoStart: { - required: false, - serializedName: 'autoStart', - defaultValue: true, - type: { - name: 'Boolean' - } - }, - monitoringIntervalInSeconds: { - required: false, - serializedName: 'monitoringIntervalInSeconds', - defaultValue: 60, - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = ConnectionMonitorParameters; diff --git a/lib/services/networkManagement2/lib/models/connectionMonitorQueryResult.js b/lib/services/networkManagement2/lib/models/connectionMonitorQueryResult.js deleted file mode 100644 index 5bc4876da..000000000 --- a/lib/services/networkManagement2/lib/models/connectionMonitorQueryResult.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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'; - -/** - * List of connection states snaphots. - * - */ -class ConnectionMonitorQueryResult { - /** - * Create a ConnectionMonitorQueryResult. - * @property {string} [sourceStatus] Status of connection monitor source. - * Possible values include: 'Uknown', 'Active', 'Inactive' - * @property {array} [states] Information about connection states. - */ - constructor() { - } - - /** - * Defines the metadata of ConnectionMonitorQueryResult - * - * @returns {object} metadata of ConnectionMonitorQueryResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ConnectionMonitorQueryResult', - type: { - name: 'Composite', - className: 'ConnectionMonitorQueryResult', - modelProperties: { - sourceStatus: { - required: false, - serializedName: 'sourceStatus', - type: { - name: 'String' - } - }, - states: { - required: false, - serializedName: 'states', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ConnectionStateSnapshotElementType', - type: { - name: 'Composite', - className: 'ConnectionStateSnapshot' - } - } - } - } - } - } - }; - } -} - -module.exports = ConnectionMonitorQueryResult; diff --git a/lib/services/networkManagement2/lib/models/connectionMonitorResult.js b/lib/services/networkManagement2/lib/models/connectionMonitorResult.js deleted file mode 100644 index 8ab04ca11..000000000 --- a/lib/services/networkManagement2/lib/models/connectionMonitorResult.js +++ /dev/null @@ -1,184 +0,0 @@ -/* - * 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'); - -/** - * Information about the connection monitor. - * - * @extends models['BaseResource'] - */ -class ConnectionMonitorResult extends models['BaseResource'] { - /** - * Create a ConnectionMonitorResult. - * @property {string} [name] Name of the connection monitor. - * @property {string} [id] ID of the connection monitor. - * @property {string} [etag] Default value: 'A unique read-only string that - * changes whenever the resource is updated.' . - * @property {string} [type] Connection monitor type. - * @property {string} [location] Connection monitor location. - * @property {object} [tags] Connection monitor tags. - * @property {object} source - * @property {string} [source.resourceId] The ID of the resource used as the - * source by connection monitor. - * @property {number} [source.port] The source port used by connection - * monitor. - * @property {object} destination - * @property {string} [destination.resourceId] The ID of the resource used as - * the destination by connection monitor. - * @property {string} [destination.address] Address of the connection monitor - * destination (IP or domain name). - * @property {number} [destination.port] The destination port used by - * connection monitor. - * @property {boolean} [autoStart] Determines if the connection monitor will - * start automatically once created. Default value: true . - * @property {number} [monitoringIntervalInSeconds] Monitoring interval in - * seconds. Default value: 60 . - * @property {string} [provisioningState] The provisioning state of the - * connection monitor. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * @property {date} [startTime] The date and time when the connection monitor - * was started. - * @property {string} [monitoringStatus] The monitoring status of the - * connection monitor. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ConnectionMonitorResult - * - * @returns {object} metadata of ConnectionMonitorResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ConnectionMonitorResult', - type: { - name: 'Composite', - className: 'ConnectionMonitorResult', - modelProperties: { - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - id: { - required: false, - readOnly: true, - serializedName: 'id', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - defaultValue: 'A unique read-only string that changes whenever the resource is updated.', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - source: { - required: true, - serializedName: 'properties.source', - type: { - name: 'Composite', - className: 'ConnectionMonitorSource' - } - }, - destination: { - required: true, - serializedName: 'properties.destination', - type: { - name: 'Composite', - className: 'ConnectionMonitorDestination' - } - }, - autoStart: { - required: false, - serializedName: 'properties.autoStart', - defaultValue: true, - type: { - name: 'Boolean' - } - }, - monitoringIntervalInSeconds: { - required: false, - serializedName: 'properties.monitoringIntervalInSeconds', - defaultValue: 60, - type: { - name: 'Number' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - startTime: { - required: false, - serializedName: 'properties.startTime', - type: { - name: 'DateTime' - } - }, - monitoringStatus: { - required: false, - serializedName: 'properties.monitoringStatus', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ConnectionMonitorResult; diff --git a/lib/services/networkManagement2/lib/models/connectionMonitorSource.js b/lib/services/networkManagement2/lib/models/connectionMonitorSource.js deleted file mode 100644 index 9d4eda3dd..000000000 --- a/lib/services/networkManagement2/lib/models/connectionMonitorSource.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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'; - -/** - * Describes the source of connection monitor. - * - */ -class ConnectionMonitorSource { - /** - * Create a ConnectionMonitorSource. - * @property {string} resourceId The ID of the resource used as the source by - * connection monitor. - * @property {number} [port] The source port used by connection monitor. - */ - constructor() { - } - - /** - * Defines the metadata of ConnectionMonitorSource - * - * @returns {object} metadata of ConnectionMonitorSource - * - */ - mapper() { - return { - required: false, - serializedName: 'ConnectionMonitorSource', - type: { - name: 'Composite', - className: 'ConnectionMonitorSource', - modelProperties: { - resourceId: { - required: true, - serializedName: 'resourceId', - type: { - name: 'String' - } - }, - port: { - required: false, - serializedName: 'port', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = ConnectionMonitorSource; diff --git a/lib/services/networkManagement2/lib/models/connectionResetSharedKey.js b/lib/services/networkManagement2/lib/models/connectionResetSharedKey.js deleted file mode 100644 index e415344c6..000000000 --- a/lib/services/networkManagement2/lib/models/connectionResetSharedKey.js +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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'; - -/** - * The virtual network connection reset shared key - * - */ -class ConnectionResetSharedKey { - /** - * Create a ConnectionResetSharedKey. - * @property {number} keyLength The virtual network connection reset shared - * key length, should between 1 and 128. - */ - constructor() { - } - - /** - * Defines the metadata of ConnectionResetSharedKey - * - * @returns {object} metadata of ConnectionResetSharedKey - * - */ - mapper() { - return { - required: false, - serializedName: 'ConnectionResetSharedKey', - type: { - name: 'Composite', - className: 'ConnectionResetSharedKey', - modelProperties: { - keyLength: { - required: true, - serializedName: 'keyLength', - constraints: { - InclusiveMaximum: 128, - InclusiveMinimum: 1 - }, - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = ConnectionResetSharedKey; diff --git a/lib/services/networkManagement2/lib/models/connectionSharedKey.js b/lib/services/networkManagement2/lib/models/connectionSharedKey.js deleted file mode 100644 index b40c68ad8..000000000 --- a/lib/services/networkManagement2/lib/models/connectionSharedKey.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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'); - -/** - * Response for GetConnectionSharedKey API service call - * - * @extends models['SubResource'] - */ -class ConnectionSharedKey extends models['SubResource'] { - /** - * Create a ConnectionSharedKey. - * @property {string} value The virtual network connection shared key value. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ConnectionSharedKey - * - * @returns {object} metadata of ConnectionSharedKey - * - */ - mapper() { - return { - required: false, - serializedName: 'ConnectionSharedKey', - type: { - name: 'Composite', - className: 'ConnectionSharedKey', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - value: { - required: true, - serializedName: 'value', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ConnectionSharedKey; diff --git a/lib/services/networkManagement2/lib/models/connectionStateSnapshot.js b/lib/services/networkManagement2/lib/models/connectionStateSnapshot.js deleted file mode 100644 index b085793cc..000000000 --- a/lib/services/networkManagement2/lib/models/connectionStateSnapshot.js +++ /dev/null @@ -1,136 +0,0 @@ -/* - * 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'; - -/** - * Connection state snapshot. - * - */ -class ConnectionStateSnapshot { - /** - * Create a ConnectionStateSnapshot. - * @property {string} [connectionState] The connection state. Possible values - * include: 'Reachable', 'Unreachable', 'Unknown' - * @property {date} [startTime] The start time of the connection snapshot. - * @property {date} [endTime] The end time of the connection snapshot. - * @property {string} [evaluationState] Connectivity analysis evaluation - * state. Possible values include: 'NotStarted', 'InProgress', 'Completed' - * @property {number} [avgLatencyInMs] Average latency in ms. - * @property {number} [minLatencyInMs] Minimum latency in ms. - * @property {number} [maxLatencyInMs] Maximum latency in ms. - * @property {number} [probesSent] The number of sent probes. - * @property {number} [probesFailed] The number of failed probes. - * @property {array} [hops] List of hops between the source and the - * destination. - */ - constructor() { - } - - /** - * Defines the metadata of ConnectionStateSnapshot - * - * @returns {object} metadata of ConnectionStateSnapshot - * - */ - mapper() { - return { - required: false, - serializedName: 'ConnectionStateSnapshot', - type: { - name: 'Composite', - className: 'ConnectionStateSnapshot', - modelProperties: { - connectionState: { - required: false, - serializedName: 'connectionState', - type: { - name: 'String' - } - }, - startTime: { - required: false, - serializedName: 'startTime', - type: { - name: 'DateTime' - } - }, - endTime: { - required: false, - serializedName: 'endTime', - type: { - name: 'DateTime' - } - }, - evaluationState: { - required: false, - serializedName: 'evaluationState', - type: { - name: 'String' - } - }, - avgLatencyInMs: { - required: false, - serializedName: 'avgLatencyInMs', - type: { - name: 'Number' - } - }, - minLatencyInMs: { - required: false, - serializedName: 'minLatencyInMs', - type: { - name: 'Number' - } - }, - maxLatencyInMs: { - required: false, - serializedName: 'maxLatencyInMs', - type: { - name: 'Number' - } - }, - probesSent: { - required: false, - serializedName: 'probesSent', - type: { - name: 'Number' - } - }, - probesFailed: { - required: false, - serializedName: 'probesFailed', - type: { - name: 'Number' - } - }, - hops: { - required: false, - readOnly: true, - serializedName: 'hops', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ConnectivityHopElementType', - type: { - name: 'Composite', - className: 'ConnectivityHop' - } - } - } - } - } - } - }; - } -} - -module.exports = ConnectionStateSnapshot; diff --git a/lib/services/networkManagement2/lib/models/connectivityDestination.js b/lib/services/networkManagement2/lib/models/connectivityDestination.js deleted file mode 100644 index ab5bea289..000000000 --- a/lib/services/networkManagement2/lib/models/connectivityDestination.js +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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'; - -/** - * Parameters that define destination of connection. - * - */ -class ConnectivityDestination { - /** - * Create a ConnectivityDestination. - * @property {string} [resourceId] The ID of the resource to which a - * connection attempt will be made. - * @property {string} [address] The IP address or URI the resource to which a - * connection attempt will be made. - * @property {number} [port] Port on which check connectivity will be - * performed. - */ - constructor() { - } - - /** - * Defines the metadata of ConnectivityDestination - * - * @returns {object} metadata of ConnectivityDestination - * - */ - mapper() { - return { - required: false, - serializedName: 'ConnectivityDestination', - type: { - name: 'Composite', - className: 'ConnectivityDestination', - modelProperties: { - resourceId: { - required: false, - serializedName: 'resourceId', - type: { - name: 'String' - } - }, - address: { - required: false, - serializedName: 'address', - type: { - name: 'String' - } - }, - port: { - required: false, - serializedName: 'port', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = ConnectivityDestination; diff --git a/lib/services/networkManagement2/lib/models/connectivityHop.js b/lib/services/networkManagement2/lib/models/connectivityHop.js deleted file mode 100644 index 6e53507d6..000000000 --- a/lib/services/networkManagement2/lib/models/connectivityHop.js +++ /dev/null @@ -1,114 +0,0 @@ -/* - * 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'; - -/** - * Information about a hop between the source and the destination. - * - */ -class ConnectivityHop { - /** - * Create a ConnectivityHop. - * @property {string} [type] The type of the hop. - * @property {string} [id] The ID of the hop. - * @property {string} [address] The IP address of the hop. - * @property {string} [resourceId] The ID of the resource corresponding to - * this hop. - * @property {array} [nextHopIds] List of next hop identifiers. - * @property {array} [issues] List of issues. - */ - constructor() { - } - - /** - * Defines the metadata of ConnectivityHop - * - * @returns {object} metadata of ConnectivityHop - * - */ - mapper() { - return { - required: false, - serializedName: 'ConnectivityHop', - type: { - name: 'Composite', - className: 'ConnectivityHop', - modelProperties: { - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - id: { - required: false, - readOnly: true, - serializedName: 'id', - type: { - name: 'String' - } - }, - address: { - required: false, - readOnly: true, - serializedName: 'address', - type: { - name: 'String' - } - }, - resourceId: { - required: false, - readOnly: true, - serializedName: 'resourceId', - type: { - name: 'String' - } - }, - nextHopIds: { - required: false, - readOnly: true, - serializedName: 'nextHopIds', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - issues: { - required: false, - readOnly: true, - serializedName: 'issues', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ConnectivityIssueElementType', - type: { - name: 'Composite', - className: 'ConnectivityIssue' - } - } - } - } - } - } - }; - } -} - -module.exports = ConnectivityHop; diff --git a/lib/services/networkManagement2/lib/models/connectivityInformation.js b/lib/services/networkManagement2/lib/models/connectivityInformation.js deleted file mode 100644 index 9f9564069..000000000 --- a/lib/services/networkManagement2/lib/models/connectivityInformation.js +++ /dev/null @@ -1,117 +0,0 @@ -/* - * 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'; - -/** - * Information on the connectivity status. - * - */ -class ConnectivityInformation { - /** - * Create a ConnectivityInformation. - * @property {array} [hops] List of hops between the source and the - * destination. - * @property {string} [connectionStatus] The connection status. Possible - * values include: 'Unknown', 'Connected', 'Disconnected', 'Degraded' - * @property {number} [avgLatencyInMs] Average latency in milliseconds. - * @property {number} [minLatencyInMs] Minimum latency in milliseconds. - * @property {number} [maxLatencyInMs] Maximum latency in milliseconds. - * @property {number} [probesSent] Total number of probes sent. - * @property {number} [probesFailed] Number of failed probes. - */ - constructor() { - } - - /** - * Defines the metadata of ConnectivityInformation - * - * @returns {object} metadata of ConnectivityInformation - * - */ - mapper() { - return { - required: false, - serializedName: 'ConnectivityInformation', - type: { - name: 'Composite', - className: 'ConnectivityInformation', - modelProperties: { - hops: { - required: false, - readOnly: true, - serializedName: 'hops', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ConnectivityHopElementType', - type: { - name: 'Composite', - className: 'ConnectivityHop' - } - } - } - }, - connectionStatus: { - required: false, - readOnly: true, - serializedName: 'connectionStatus', - type: { - name: 'String' - } - }, - avgLatencyInMs: { - required: false, - readOnly: true, - serializedName: 'avgLatencyInMs', - type: { - name: 'Number' - } - }, - minLatencyInMs: { - required: false, - readOnly: true, - serializedName: 'minLatencyInMs', - type: { - name: 'Number' - } - }, - maxLatencyInMs: { - required: false, - readOnly: true, - serializedName: 'maxLatencyInMs', - type: { - name: 'Number' - } - }, - probesSent: { - required: false, - readOnly: true, - serializedName: 'probesSent', - type: { - name: 'Number' - } - }, - probesFailed: { - required: false, - readOnly: true, - serializedName: 'probesFailed', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = ConnectivityInformation; diff --git a/lib/services/networkManagement2/lib/models/connectivityIssue.js b/lib/services/networkManagement2/lib/models/connectivityIssue.js deleted file mode 100644 index b2b557f0d..000000000 --- a/lib/services/networkManagement2/lib/models/connectivityIssue.js +++ /dev/null @@ -1,99 +0,0 @@ -/* - * 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'; - -/** - * Information about an issue encountered in the process of checking for - * connectivity. - * - */ -class ConnectivityIssue { - /** - * Create a ConnectivityIssue. - * @property {string} [origin] The origin of the issue. Possible values - * include: 'Local', 'Inbound', 'Outbound' - * @property {string} [severity] The severity of the issue. Possible values - * include: 'Error', 'Warning' - * @property {string} [type] The type of issue. Possible values include: - * 'Unknown', 'AgentStopped', 'GuestFirewall', 'DnsResolution', 'SocketBind', - * 'NetworkSecurityRule', 'UserDefinedRoute', 'PortThrottled', 'Platform' - * @property {array} [context] Provides additional context on the issue. - */ - constructor() { - } - - /** - * Defines the metadata of ConnectivityIssue - * - * @returns {object} metadata of ConnectivityIssue - * - */ - mapper() { - return { - required: false, - serializedName: 'ConnectivityIssue', - type: { - name: 'Composite', - className: 'ConnectivityIssue', - modelProperties: { - origin: { - required: false, - readOnly: true, - serializedName: 'origin', - type: { - name: 'String' - } - }, - severity: { - required: false, - readOnly: true, - serializedName: 'severity', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - context: { - required: false, - readOnly: true, - serializedName: 'context', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ObjectElementType', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - } - } - } - } - } - }; - } -} - -module.exports = ConnectivityIssue; diff --git a/lib/services/networkManagement2/lib/models/connectivityParameters.js b/lib/services/networkManagement2/lib/models/connectivityParameters.js deleted file mode 100644 index 3892d2b8b..000000000 --- a/lib/services/networkManagement2/lib/models/connectivityParameters.js +++ /dev/null @@ -1,98 +0,0 @@ -/* - * 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'; - -/** - * Parameters that determine how the connectivity check will be performed. - * - */ -class ConnectivityParameters { - /** - * Create a ConnectivityParameters. - * @property {object} source - * @property {string} [source.resourceId] The ID of the resource from which a - * connectivity check will be initiated. - * @property {number} [source.port] The source port from which a connectivity - * check will be performed. - * @property {object} destination - * @property {string} [destination.resourceId] The ID of the resource to - * which a connection attempt will be made. - * @property {string} [destination.address] The IP address or URI the - * resource to which a connection attempt will be made. - * @property {number} [destination.port] Port on which check connectivity - * will be performed. - * @property {string} [protocol] Network protocol. Possible values include: - * 'Tcp', 'Http', 'Https', 'Icmp' - * @property {object} [protocolConfiguration] - * @property {object} [protocolConfiguration.hTTPConfiguration] - * @property {string} [protocolConfiguration.hTTPConfiguration.method] HTTP - * method. Possible values include: 'Get' - * @property {array} [protocolConfiguration.hTTPConfiguration.headers] List - * of HTTP headers. - * @property {array} - * [protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid status - * codes. - */ - constructor() { - } - - /** - * Defines the metadata of ConnectivityParameters - * - * @returns {object} metadata of ConnectivityParameters - * - */ - mapper() { - return { - required: false, - serializedName: 'ConnectivityParameters', - type: { - name: 'Composite', - className: 'ConnectivityParameters', - modelProperties: { - source: { - required: true, - serializedName: 'source', - type: { - name: 'Composite', - className: 'ConnectivitySource' - } - }, - destination: { - required: true, - serializedName: 'destination', - type: { - name: 'Composite', - className: 'ConnectivityDestination' - } - }, - protocol: { - required: false, - serializedName: 'protocol', - type: { - name: 'String' - } - }, - protocolConfiguration: { - required: false, - serializedName: 'protocolConfiguration', - type: { - name: 'Composite', - className: 'ProtocolConfiguration' - } - } - } - } - }; - } -} - -module.exports = ConnectivityParameters; diff --git a/lib/services/networkManagement2/lib/models/connectivitySource.js b/lib/services/networkManagement2/lib/models/connectivitySource.js deleted file mode 100644 index 9f8679076..000000000 --- a/lib/services/networkManagement2/lib/models/connectivitySource.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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'; - -/** - * Parameters that define the source of the connection. - * - */ -class ConnectivitySource { - /** - * Create a ConnectivitySource. - * @property {string} resourceId The ID of the resource from which a - * connectivity check will be initiated. - * @property {number} [port] The source port from which a connectivity check - * will be performed. - */ - constructor() { - } - - /** - * Defines the metadata of ConnectivitySource - * - * @returns {object} metadata of ConnectivitySource - * - */ - mapper() { - return { - required: false, - serializedName: 'ConnectivitySource', - type: { - name: 'Composite', - className: 'ConnectivitySource', - modelProperties: { - resourceId: { - required: true, - serializedName: 'resourceId', - type: { - name: 'String' - } - }, - port: { - required: false, - serializedName: 'port', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = ConnectivitySource; diff --git a/lib/services/networkManagement2/lib/models/container.js b/lib/services/networkManagement2/lib/models/container.js deleted file mode 100644 index 7c1d6407a..000000000 --- a/lib/services/networkManagement2/lib/models/container.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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'); - -/** - * Reference to container resource in remote resource provider. - * - * @extends models['SubResource'] - */ -class Container extends models['SubResource'] { - /** - * Create a Container. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of Container - * - * @returns {object} metadata of Container - * - */ - mapper() { - return { - required: false, - serializedName: 'Container', - type: { - name: 'Composite', - className: 'Container', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = Container; diff --git a/lib/services/networkManagement2/lib/models/containerNetworkInterface.js b/lib/services/networkManagement2/lib/models/containerNetworkInterface.js deleted file mode 100644 index 8daec95b3..000000000 --- a/lib/services/networkManagement2/lib/models/containerNetworkInterface.js +++ /dev/null @@ -1,146 +0,0 @@ -/* - * 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'); - -/** - * Container network interface child resource. - * - * @extends models['SubResource'] - */ -class ContainerNetworkInterface extends models['SubResource'] { - /** - * Create a ContainerNetworkInterface. - * @property {object} [containerNetworkInterfaceConfiguration] Container - * network interface configuration from which this container network - * interface is created. - * @property {array} - * [containerNetworkInterfaceConfiguration.ipConfigurations] A list of ip - * configurations of the container network interface configuration. - * @property {array} - * [containerNetworkInterfaceConfiguration.containerNetworkInterfaces] A list - * of container network interfaces created from this container network - * interface configuration. - * @property {string} - * [containerNetworkInterfaceConfiguration.provisioningState] The - * provisioning state of the resource. - * @property {string} [containerNetworkInterfaceConfiguration.name] The name - * of the resource. This name can be used to access the resource. - * @property {string} [containerNetworkInterfaceConfiguration.type] Sub - * Resource type. - * @property {string} [containerNetworkInterfaceConfiguration.etag] A unique - * read-only string that changes whenever the resource is updated. - * @property {object} [container] Reference to the conatinaer to which this - * container network interface is attached. - * @property {array} [ipConfigurations] Reference to the ip configuration on - * this container nic. - * @property {string} [provisioningState] The provisioning state of the - * resource. - * @property {string} [name] The name of the resource. This name can be used - * to access the resource. - * @property {string} [type] Sub Resource type. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ContainerNetworkInterface - * - * @returns {object} metadata of ContainerNetworkInterface - * - */ - mapper() { - return { - required: false, - serializedName: 'ContainerNetworkInterface', - type: { - name: 'Composite', - className: 'ContainerNetworkInterface', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - containerNetworkInterfaceConfiguration: { - required: false, - serializedName: 'properties.containerNetworkInterfaceConfiguration', - type: { - name: 'Composite', - className: 'ContainerNetworkInterfaceConfiguration' - } - }, - container: { - required: false, - serializedName: 'properties.container', - type: { - name: 'Composite', - className: 'Container' - } - }, - ipConfigurations: { - required: false, - serializedName: 'properties.ipConfigurations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ContainerNetworkInterfaceIpConfigurationElementType', - type: { - name: 'Composite', - className: 'ContainerNetworkInterfaceIpConfiguration' - } - } - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ContainerNetworkInterface; diff --git a/lib/services/networkManagement2/lib/models/containerNetworkInterfaceConfiguration.js b/lib/services/networkManagement2/lib/models/containerNetworkInterfaceConfiguration.js deleted file mode 100644 index 701851a1d..000000000 --- a/lib/services/networkManagement2/lib/models/containerNetworkInterfaceConfiguration.js +++ /dev/null @@ -1,126 +0,0 @@ -/* - * 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'); - -/** - * Container network interface configruation child resource. - * - * @extends models['SubResource'] - */ -class ContainerNetworkInterfaceConfiguration extends models['SubResource'] { - /** - * Create a ContainerNetworkInterfaceConfiguration. - * @property {array} [ipConfigurations] A list of ip configurations of the - * container network interface configuration. - * @property {array} [containerNetworkInterfaces] A list of container network - * interfaces created from this container network interface configuration. - * @property {string} [provisioningState] The provisioning state of the - * resource. - * @property {string} [name] The name of the resource. This name can be used - * to access the resource. - * @property {string} [type] Sub Resource type. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ContainerNetworkInterfaceConfiguration - * - * @returns {object} metadata of ContainerNetworkInterfaceConfiguration - * - */ - mapper() { - return { - required: false, - serializedName: 'ContainerNetworkInterfaceConfiguration', - type: { - name: 'Composite', - className: 'ContainerNetworkInterfaceConfiguration', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - ipConfigurations: { - required: false, - serializedName: 'properties.ipConfigurations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'IPConfigurationProfileElementType', - type: { - name: 'Composite', - className: 'IPConfigurationProfile' - } - } - } - }, - containerNetworkInterfaces: { - required: false, - serializedName: 'properties.containerNetworkInterfaces', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SubResourceElementType', - type: { - name: 'Composite', - className: 'SubResource' - } - } - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ContainerNetworkInterfaceConfiguration; diff --git a/lib/services/networkManagement2/lib/models/containerNetworkInterfaceIpConfiguration.js b/lib/services/networkManagement2/lib/models/containerNetworkInterfaceIpConfiguration.js deleted file mode 100644 index 4cb277ab5..000000000 --- a/lib/services/networkManagement2/lib/models/containerNetworkInterfaceIpConfiguration.js +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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'; - -/** - * The ip configuration for a container network interface. - * - */ -class ContainerNetworkInterfaceIpConfiguration { - /** - * Create a ContainerNetworkInterfaceIpConfiguration. - * @property {string} [provisioningState] The provisioning state of the - * resource. - * @property {string} [name] The name of the resource. This name can be used - * to access the resource. - * @property {string} [type] Sub Resource type. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ - constructor() { - } - - /** - * Defines the metadata of ContainerNetworkInterfaceIpConfiguration - * - * @returns {object} metadata of ContainerNetworkInterfaceIpConfiguration - * - */ - mapper() { - return { - required: false, - serializedName: 'ContainerNetworkInterfaceIpConfiguration', - type: { - name: 'Composite', - className: 'ContainerNetworkInterfaceIpConfiguration', - modelProperties: { - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ContainerNetworkInterfaceIpConfiguration; diff --git a/lib/services/networkManagement2/lib/models/ddosProtectionPlan.js b/lib/services/networkManagement2/lib/models/ddosProtectionPlan.js deleted file mode 100644 index dcbd8362b..000000000 --- a/lib/services/networkManagement2/lib/models/ddosProtectionPlan.js +++ /dev/null @@ -1,149 +0,0 @@ -/* - * 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'); - -/** - * A DDoS protection plan in a resource group. - * - * @extends models['BaseResource'] - */ -class DdosProtectionPlan extends models['BaseResource'] { - /** - * Create a DdosProtectionPlan. - * @property {string} [id] Resource ID. - * @property {string} [name] Resource name. - * @property {string} [type] Resource type. - * @property {string} [location] Resource location. - * @property {object} [tags] Resource tags. - * @property {string} [resourceGuid] The resource GUID property of the DDoS - * protection plan resource. It uniquely identifies the resource, even if the - * user changes its name or migrate the resource across subscriptions or - * resource groups. - * @property {string} [provisioningState] The provisioning state of the DDoS - * protection plan resource. Possible values are: 'Succeeded', 'Updating', - * 'Deleting', and 'Failed'. - * @property {array} [virtualNetworks] The list of virtual networks - * associated with the DDoS protection plan resource. This list is read-only. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of DdosProtectionPlan - * - * @returns {object} metadata of DdosProtectionPlan - * - */ - mapper() { - return { - required: false, - serializedName: 'DdosProtectionPlan', - type: { - name: 'Composite', - className: 'DdosProtectionPlan', - modelProperties: { - id: { - required: false, - readOnly: true, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - resourceGuid: { - required: false, - readOnly: true, - serializedName: 'properties.resourceGuid', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - virtualNetworks: { - required: false, - readOnly: true, - serializedName: 'properties.virtualNetworks', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SubResourceElementType', - type: { - name: 'Composite', - className: 'SubResource' - } - } - } - }, - etag: { - required: false, - readOnly: true, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = DdosProtectionPlan; diff --git a/lib/services/networkManagement2/lib/models/ddosProtectionPlanListResult.js b/lib/services/networkManagement2/lib/models/ddosProtectionPlanListResult.js deleted file mode 100644 index cdc43f84d..000000000 --- a/lib/services/networkManagement2/lib/models/ddosProtectionPlanListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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'; - -/** - * A list of DDoS protection plans. - */ -class DdosProtectionPlanListResult extends Array { - /** - * Create a DdosProtectionPlanListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of DdosProtectionPlanListResult - * - * @returns {object} metadata of DdosProtectionPlanListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'DdosProtectionPlanListResult', - type: { - name: 'Composite', - className: 'DdosProtectionPlanListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'DdosProtectionPlanElementType', - type: { - name: 'Composite', - className: 'DdosProtectionPlan' - } - } - } - }, - nextLink: { - required: false, - readOnly: true, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = DdosProtectionPlanListResult; diff --git a/lib/services/networkManagement2/lib/models/delegation.js b/lib/services/networkManagement2/lib/models/delegation.js deleted file mode 100644 index 9df672a3c..000000000 --- a/lib/services/networkManagement2/lib/models/delegation.js +++ /dev/null @@ -1,108 +0,0 @@ -/* - * 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'); - -/** - * Details the service to which the subnet is delegated. - * - * @extends models['SubResource'] - */ -class Delegation extends models['SubResource'] { - /** - * Create a Delegation. - * @property {string} [serviceName] The name of the service to whom the - * subnet should be delegated (e.g. Microsoft.Sql/servers) - * @property {array} [actions] Describes the actions permitted to the service - * upon delegation - * @property {string} [provisioningState] The provisioning state of the - * resource. - * @property {string} [name] The name of the resource that is unique within a - * subnet. 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 Delegation - * - * @returns {object} metadata of Delegation - * - */ - mapper() { - return { - required: false, - serializedName: 'Delegation', - type: { - name: 'Composite', - className: 'Delegation', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - serviceName: { - required: false, - serializedName: 'properties.serviceName', - type: { - name: 'String' - } - }, - actions: { - required: false, - serializedName: 'properties.actions', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - 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, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = Delegation; diff --git a/lib/services/networkManagement2/lib/models/deviceProperties.js b/lib/services/networkManagement2/lib/models/deviceProperties.js deleted file mode 100644 index f92d07640..000000000 --- a/lib/services/networkManagement2/lib/models/deviceProperties.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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'; - -/** - * List of properties of the device. - * - */ -class DeviceProperties { - /** - * Create a DeviceProperties. - * @property {string} [deviceVendor] Name of the device Vendor. - * @property {string} [deviceModel] Model of the device. - * @property {number} [linkSpeedInMbps] Link speed. - */ - constructor() { - } - - /** - * Defines the metadata of DeviceProperties - * - * @returns {object} metadata of DeviceProperties - * - */ - mapper() { - return { - required: false, - serializedName: 'DeviceProperties', - type: { - name: 'Composite', - className: 'DeviceProperties', - modelProperties: { - deviceVendor: { - required: false, - serializedName: 'deviceVendor', - type: { - name: 'String' - } - }, - deviceModel: { - required: false, - serializedName: 'deviceModel', - type: { - name: 'String' - } - }, - linkSpeedInMbps: { - required: false, - serializedName: 'linkSpeedInMbps', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = DeviceProperties; diff --git a/lib/services/networkManagement2/lib/models/dhcpOptions.js b/lib/services/networkManagement2/lib/models/dhcpOptions.js deleted file mode 100644 index cd4ced7c4..000000000 --- a/lib/services/networkManagement2/lib/models/dhcpOptions.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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'; - -/** - * DhcpOptions contains an array of DNS servers available to VMs deployed in - * the virtual network. Standard DHCP option for a subnet overrides VNET DHCP - * options. - * - */ -class DhcpOptions { - /** - * Create a DhcpOptions. - * @property {array} [dnsServers] The list of DNS servers IP addresses. - */ - constructor() { - } - - /** - * Defines the metadata of DhcpOptions - * - * @returns {object} metadata of DhcpOptions - * - */ - mapper() { - return { - required: false, - serializedName: 'DhcpOptions', - type: { - name: 'Composite', - className: 'DhcpOptions', - modelProperties: { - dnsServers: { - required: false, - serializedName: 'dnsServers', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - } - } - } - }; - } -} - -module.exports = DhcpOptions; diff --git a/lib/services/networkManagement2/lib/models/dimension.js b/lib/services/networkManagement2/lib/models/dimension.js deleted file mode 100644 index 47c4c2a81..000000000 --- a/lib/services/networkManagement2/lib/models/dimension.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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'; - -/** - * Dimension of the metric. - * - */ -class Dimension { - /** - * Create a Dimension. - * @property {string} [name] The name of the dimension. - * @property {string} [displayName] The display name of the dimension. - * @property {string} [internalName] The internal name of the dimension. - */ - constructor() { - } - - /** - * Defines the metadata of Dimension - * - * @returns {object} metadata of Dimension - * - */ - mapper() { - return { - required: false, - serializedName: 'Dimension', - type: { - name: 'Composite', - className: 'Dimension', - modelProperties: { - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - displayName: { - required: false, - serializedName: 'displayName', - type: { - name: 'String' - } - }, - internalName: { - required: false, - serializedName: 'internalName', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = Dimension; diff --git a/lib/services/networkManagement2/lib/models/dnsNameAvailabilityResult.js b/lib/services/networkManagement2/lib/models/dnsNameAvailabilityResult.js deleted file mode 100644 index 3c73b6c14..000000000 --- a/lib/services/networkManagement2/lib/models/dnsNameAvailabilityResult.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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 the CheckDnsNameAvailability API service call. - * - */ -class DnsNameAvailabilityResult { - /** - * Create a DnsNameAvailabilityResult. - * @property {boolean} [available] Domain availability (True/False). - */ - constructor() { - } - - /** - * Defines the metadata of DnsNameAvailabilityResult - * - * @returns {object} metadata of DnsNameAvailabilityResult - * - */ - mapper() { - return { - required: false, - serializedName: 'DnsNameAvailabilityResult', - type: { - name: 'Composite', - className: 'DnsNameAvailabilityResult', - modelProperties: { - available: { - required: false, - serializedName: 'available', - type: { - name: 'Boolean' - } - } - } - } - }; - } -} - -module.exports = DnsNameAvailabilityResult; diff --git a/lib/services/networkManagement2/lib/models/effectiveNetworkSecurityGroup.js b/lib/services/networkManagement2/lib/models/effectiveNetworkSecurityGroup.js deleted file mode 100644 index 0c3a5ea48..000000000 --- a/lib/services/networkManagement2/lib/models/effectiveNetworkSecurityGroup.js +++ /dev/null @@ -1,109 +0,0 @@ -/* - * 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'; - -/** - * Effective network security group. - * - */ -class EffectiveNetworkSecurityGroup { - /** - * Create a EffectiveNetworkSecurityGroup. - * @property {object} [networkSecurityGroup] The ID of network security group - * that is applied. - * @property {string} [networkSecurityGroup.id] Resource ID. - * @property {object} [association] Associated resources. - * @property {object} [association.subnet] The ID of the subnet if assigned. - * @property {string} [association.subnet.id] Resource ID. - * @property {object} [association.networkInterface] The ID of the network - * interface if assigned. - * @property {string} [association.networkInterface.id] Resource ID. - * @property {array} [effectiveSecurityRules] A collection of effective - * security rules. - * @property {object} [tagMap] Mapping of tags to list of IP Addresses - * included within the tag. - */ - constructor() { - } - - /** - * Defines the metadata of EffectiveNetworkSecurityGroup - * - * @returns {object} metadata of EffectiveNetworkSecurityGroup - * - */ - mapper() { - return { - required: false, - serializedName: 'EffectiveNetworkSecurityGroup', - type: { - name: 'Composite', - className: 'EffectiveNetworkSecurityGroup', - modelProperties: { - networkSecurityGroup: { - required: false, - serializedName: 'networkSecurityGroup', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - association: { - required: false, - serializedName: 'association', - type: { - name: 'Composite', - className: 'EffectiveNetworkSecurityGroupAssociation' - } - }, - effectiveSecurityRules: { - required: false, - serializedName: 'effectiveSecurityRules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'EffectiveNetworkSecurityRuleElementType', - type: { - name: 'Composite', - className: 'EffectiveNetworkSecurityRule' - } - } - } - }, - tagMap: { - required: false, - serializedName: 'tagMap', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'ArrayElementType', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - } - } - } - } - } - }; - } -} - -module.exports = EffectiveNetworkSecurityGroup; diff --git a/lib/services/networkManagement2/lib/models/effectiveNetworkSecurityGroupAssociation.js b/lib/services/networkManagement2/lib/models/effectiveNetworkSecurityGroupAssociation.js deleted file mode 100644 index 080c896d1..000000000 --- a/lib/services/networkManagement2/lib/models/effectiveNetworkSecurityGroupAssociation.js +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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'; - -/** - * The effective network security group association. - * - */ -class EffectiveNetworkSecurityGroupAssociation { - /** - * Create a EffectiveNetworkSecurityGroupAssociation. - * @property {object} [subnet] The ID of the subnet if assigned. - * @property {string} [subnet.id] Resource ID. - * @property {object} [networkInterface] The ID of the network interface if - * assigned. - * @property {string} [networkInterface.id] Resource ID. - */ - constructor() { - } - - /** - * Defines the metadata of EffectiveNetworkSecurityGroupAssociation - * - * @returns {object} metadata of EffectiveNetworkSecurityGroupAssociation - * - */ - mapper() { - return { - required: false, - serializedName: 'EffectiveNetworkSecurityGroupAssociation', - type: { - name: 'Composite', - className: 'EffectiveNetworkSecurityGroupAssociation', - modelProperties: { - subnet: { - required: false, - serializedName: 'subnet', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - networkInterface: { - required: false, - serializedName: 'networkInterface', - type: { - name: 'Composite', - className: 'SubResource' - } - } - } - } - }; - } -} - -module.exports = EffectiveNetworkSecurityGroupAssociation; diff --git a/lib/services/networkManagement2/lib/models/effectiveNetworkSecurityGroupListResult.js b/lib/services/networkManagement2/lib/models/effectiveNetworkSecurityGroupListResult.js deleted file mode 100644 index 0db456ff3..000000000 --- a/lib/services/networkManagement2/lib/models/effectiveNetworkSecurityGroupListResult.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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 list effective network security groups API service call. - * - */ -class EffectiveNetworkSecurityGroupListResult { - /** - * Create a EffectiveNetworkSecurityGroupListResult. - * @property {array} [value] A list of effective network security groups. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - } - - /** - * Defines the metadata of EffectiveNetworkSecurityGroupListResult - * - * @returns {object} metadata of EffectiveNetworkSecurityGroupListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'EffectiveNetworkSecurityGroupListResult', - type: { - name: 'Composite', - className: 'EffectiveNetworkSecurityGroupListResult', - modelProperties: { - value: { - required: false, - serializedName: 'value', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'EffectiveNetworkSecurityGroupElementType', - type: { - name: 'Composite', - className: 'EffectiveNetworkSecurityGroup' - } - } - } - }, - nextLink: { - required: false, - readOnly: true, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = EffectiveNetworkSecurityGroupListResult; diff --git a/lib/services/networkManagement2/lib/models/effectiveNetworkSecurityRule.js b/lib/services/networkManagement2/lib/models/effectiveNetworkSecurityRule.js deleted file mode 100644 index 7e443c472..000000000 --- a/lib/services/networkManagement2/lib/models/effectiveNetworkSecurityRule.js +++ /dev/null @@ -1,225 +0,0 @@ -/* - * 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'; - -/** - * Effective network security rules. - * - */ -class EffectiveNetworkSecurityRule { - /** - * Create a EffectiveNetworkSecurityRule. - * @property {string} [name] The name of the security rule specified by the - * user (if created by the user). - * @property {string} [protocol] The network protocol this rule applies to. - * Possible values are: 'Tcp', 'Udp', and 'All'. Possible values include: - * 'Tcp', 'Udp', 'All' - * @property {string} [sourcePortRange] The source port or range. - * @property {string} [destinationPortRange] The destination port or range. - * @property {array} [sourcePortRanges] The source port ranges. Expected - * values include a single integer between 0 and 65535, a range using '-' as - * seperator (e.g. 100-400), or an asterix (*) - * @property {array} [destinationPortRanges] The destination port ranges. - * Expected values include a single integer between 0 and 65535, a range - * using '-' as seperator (e.g. 100-400), or an asterix (*) - * @property {string} [sourceAddressPrefix] The source address prefix. - * @property {string} [destinationAddressPrefix] The destination address - * prefix. - * @property {array} [sourceAddressPrefixes] The source address prefixes. - * Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, - * AureLoadBalancer, Internet), System Tags, and the asterix (*). - * @property {array} [destinationAddressPrefixes] The destination address - * prefixes. Expected values include CIDR IP ranges, Default Tags - * (VirtualNetwork, AureLoadBalancer, Internet), System Tags, and the asterix - * (*). - * @property {array} [expandedSourceAddressPrefix] The expanded source - * address prefix. - * @property {array} [expandedDestinationAddressPrefix] Expanded destination - * address prefix. - * @property {string} [access] Whether network traffic is allowed or denied. - * Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', - * 'Deny' - * @property {number} [priority] The priority of the rule. - * @property {string} [direction] The direction of the rule. Possible values - * are: 'Inbound and Outbound'. Possible values include: 'Inbound', - * 'Outbound' - */ - constructor() { - } - - /** - * Defines the metadata of EffectiveNetworkSecurityRule - * - * @returns {object} metadata of EffectiveNetworkSecurityRule - * - */ - mapper() { - return { - required: false, - serializedName: 'EffectiveNetworkSecurityRule', - type: { - name: 'Composite', - className: 'EffectiveNetworkSecurityRule', - modelProperties: { - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - protocol: { - required: false, - serializedName: 'protocol', - type: { - name: 'String' - } - }, - sourcePortRange: { - required: false, - serializedName: 'sourcePortRange', - type: { - name: 'String' - } - }, - destinationPortRange: { - required: false, - serializedName: 'destinationPortRange', - type: { - name: 'String' - } - }, - sourcePortRanges: { - required: false, - serializedName: 'sourcePortRanges', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - destinationPortRanges: { - required: false, - serializedName: 'destinationPortRanges', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - sourceAddressPrefix: { - required: false, - serializedName: 'sourceAddressPrefix', - type: { - name: 'String' - } - }, - destinationAddressPrefix: { - required: false, - serializedName: 'destinationAddressPrefix', - type: { - name: 'String' - } - }, - sourceAddressPrefixes: { - required: false, - serializedName: 'sourceAddressPrefixes', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - destinationAddressPrefixes: { - required: false, - serializedName: 'destinationAddressPrefixes', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - expandedSourceAddressPrefix: { - required: false, - serializedName: 'expandedSourceAddressPrefix', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - expandedDestinationAddressPrefix: { - required: false, - serializedName: 'expandedDestinationAddressPrefix', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - access: { - required: false, - serializedName: 'access', - type: { - name: 'String' - } - }, - priority: { - required: false, - serializedName: 'priority', - type: { - name: 'Number' - } - }, - direction: { - required: false, - serializedName: 'direction', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = EffectiveNetworkSecurityRule; diff --git a/lib/services/networkManagement2/lib/models/effectiveRoute.js b/lib/services/networkManagement2/lib/models/effectiveRoute.js deleted file mode 100644 index d4b537f52..000000000 --- a/lib/services/networkManagement2/lib/models/effectiveRoute.js +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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'; - -/** - * Effective Route - * - */ -class EffectiveRoute { - /** - * Create a EffectiveRoute. - * @property {string} [name] The name of the user defined route. This is - * optional. - * @property {string} [source] Who created the route. Possible values are: - * 'Unknown', 'User', 'VirtualNetworkGateway', and 'Default'. Possible values - * include: 'Unknown', 'User', 'VirtualNetworkGateway', 'Default' - * @property {string} [state] The value of effective route. Possible values - * are: 'Active' and 'Invalid'. Possible values include: 'Active', 'Invalid' - * @property {array} [addressPrefix] The address prefixes of the effective - * routes in CIDR notation. - * @property {array} [nextHopIpAddress] The IP address of the next hop of the - * effective route. - * @property {string} [nextHopType] The type of Azure hop the packet should - * be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', - * 'Internet', 'VirtualAppliance', and 'None'. Possible values include: - * 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', - * 'None' - */ - constructor() { - } - - /** - * Defines the metadata of EffectiveRoute - * - * @returns {object} metadata of EffectiveRoute - * - */ - mapper() { - return { - required: false, - serializedName: 'EffectiveRoute', - type: { - name: 'Composite', - className: 'EffectiveRoute', - modelProperties: { - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - source: { - required: false, - serializedName: 'source', - type: { - name: 'String' - } - }, - state: { - required: false, - serializedName: 'state', - type: { - name: 'String' - } - }, - addressPrefix: { - required: false, - serializedName: 'addressPrefix', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - nextHopIpAddress: { - required: false, - serializedName: 'nextHopIpAddress', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - nextHopType: { - required: false, - serializedName: 'nextHopType', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = EffectiveRoute; diff --git a/lib/services/networkManagement2/lib/models/effectiveRouteListResult.js b/lib/services/networkManagement2/lib/models/effectiveRouteListResult.js deleted file mode 100644 index 2cc550a0a..000000000 --- a/lib/services/networkManagement2/lib/models/effectiveRouteListResult.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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 list effective route API service call. - * - */ -class EffectiveRouteListResult { - /** - * Create a EffectiveRouteListResult. - * @property {array} [value] A list of effective routes. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - } - - /** - * Defines the metadata of EffectiveRouteListResult - * - * @returns {object} metadata of EffectiveRouteListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'EffectiveRouteListResult', - type: { - name: 'Composite', - className: 'EffectiveRouteListResult', - modelProperties: { - value: { - required: false, - serializedName: 'value', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'EffectiveRouteElementType', - type: { - name: 'Composite', - className: 'EffectiveRoute' - } - } - } - }, - nextLink: { - required: false, - readOnly: true, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = EffectiveRouteListResult; diff --git a/lib/services/networkManagement2/lib/models/endpointService.js b/lib/services/networkManagement2/lib/models/endpointService.js deleted file mode 100644 index 46d4534c3..000000000 --- a/lib/services/networkManagement2/lib/models/endpointService.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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'; - -/** - * Identifies the service being brought into the virtual network. - * - */ -class EndpointService { - /** - * Create a EndpointService. - * @property {string} [id] A unique identifier of the service being - * referenced by the interface endpoint. - */ - constructor() { - } - - /** - * Defines the metadata of EndpointService - * - * @returns {object} metadata of EndpointService - * - */ - mapper() { - return { - required: false, - serializedName: 'EndpointService', - type: { - name: 'Composite', - className: 'EndpointService', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = EndpointService; diff --git a/lib/services/networkManagement2/lib/models/endpointServiceResult.js b/lib/services/networkManagement2/lib/models/endpointServiceResult.js deleted file mode 100644 index 3b31b7b64..000000000 --- a/lib/services/networkManagement2/lib/models/endpointServiceResult.js +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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'); - -/** - * Endpoint service. - * - * @extends models['SubResource'] - */ -class EndpointServiceResult extends models['SubResource'] { - /** - * Create a EndpointServiceResult. - * @property {string} [name] Name of the endpoint service. - * @property {string} [type] Type of the endpoint service. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of EndpointServiceResult - * - * @returns {object} metadata of EndpointServiceResult - * - */ - mapper() { - return { - required: false, - serializedName: 'EndpointServiceResult', - type: { - name: 'Composite', - className: 'EndpointServiceResult', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = EndpointServiceResult; diff --git a/lib/services/networkManagement2/lib/models/endpointServicesListResult.js b/lib/services/networkManagement2/lib/models/endpointServicesListResult.js deleted file mode 100644 index 5ca88cc91..000000000 --- a/lib/services/networkManagement2/lib/models/endpointServicesListResult.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 the ListAvailableEndpointServices API service call. - */ -class EndpointServicesListResult extends Array { - /** - * Create a EndpointServicesListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of EndpointServicesListResult - * - * @returns {object} metadata of EndpointServicesListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'EndpointServicesListResult', - type: { - name: 'Composite', - className: 'EndpointServicesListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'EndpointServiceResultElementType', - type: { - name: 'Composite', - className: 'EndpointServiceResult' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = EndpointServicesListResult; diff --git a/lib/services/networkManagement2/lib/models/errorDetails.js b/lib/services/networkManagement2/lib/models/errorDetails.js deleted file mode 100644 index 7393f6613..000000000 --- a/lib/services/networkManagement2/lib/models/errorDetails.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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'; - -/** - * Class representing a ErrorDetails. - */ -class ErrorDetails { - /** - * Create a ErrorDetails. - * @property {string} [code] - * @property {string} [target] - * @property {string} [message] - */ - constructor() { - } - - /** - * Defines the metadata of ErrorDetails - * - * @returns {object} metadata of ErrorDetails - * - */ - mapper() { - return { - required: false, - serializedName: 'ErrorDetails', - type: { - name: 'Composite', - className: 'ErrorDetails', - modelProperties: { - code: { - required: false, - serializedName: 'code', - type: { - name: 'String' - } - }, - target: { - required: false, - serializedName: 'target', - type: { - name: 'String' - } - }, - message: { - required: false, - serializedName: 'message', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ErrorDetails; diff --git a/lib/services/networkManagement2/lib/models/errorModel.js b/lib/services/networkManagement2/lib/models/errorModel.js deleted file mode 100644 index 6ef42630b..000000000 --- a/lib/services/networkManagement2/lib/models/errorModel.js +++ /dev/null @@ -1,91 +0,0 @@ -/* - * 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'; - -/** - * Class representing a ErrorModel. - */ -class ErrorModel { - /** - * Create a ErrorModel. - * @property {string} [code] - * @property {string} [message] - * @property {string} [target] - * @property {array} [details] - * @property {string} [innerError] - */ - constructor() { - } - - /** - * Defines the metadata of ErrorModel - * - * @returns {object} metadata of ErrorModel - * - */ - mapper() { - return { - required: false, - serializedName: 'Error', - type: { - name: 'Composite', - className: 'ErrorModel', - modelProperties: { - code: { - required: false, - serializedName: 'code', - type: { - name: 'String' - } - }, - message: { - required: false, - serializedName: 'message', - type: { - name: 'String' - } - }, - target: { - required: false, - serializedName: 'target', - type: { - name: 'String' - } - }, - details: { - required: false, - serializedName: 'details', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ErrorDetailsElementType', - type: { - name: 'Composite', - className: 'ErrorDetails' - } - } - } - }, - innerError: { - required: false, - serializedName: 'innerError', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ErrorModel; diff --git a/lib/services/networkManagement2/lib/models/errorResponse.js b/lib/services/networkManagement2/lib/models/errorResponse.js deleted file mode 100644 index b0712fc75..000000000 --- a/lib/services/networkManagement2/lib/models/errorResponse.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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'; - -/** - * The error object. - * - */ -class ErrorResponse { - /** - * Create a ErrorResponse. - * @property {object} [error] Error. - * @property {string} [error.code] - * @property {string} [error.target] - * @property {string} [error.message] - */ - constructor() { - } - - /** - * Defines the metadata of ErrorResponse - * - * @returns {object} metadata of ErrorResponse - * - */ - mapper() { - return { - required: false, - serializedName: 'ErrorResponse', - type: { - name: 'Composite', - className: 'ErrorResponse', - modelProperties: { - error: { - required: false, - serializedName: 'error', - type: { - name: 'Composite', - className: 'ErrorDetails' - } - } - } - } - }; - } -} - -module.exports = ErrorResponse; diff --git a/lib/services/networkManagement2/lib/models/evaluatedNetworkSecurityGroup.js b/lib/services/networkManagement2/lib/models/evaluatedNetworkSecurityGroup.js deleted file mode 100644 index 9bcaf402c..000000000 --- a/lib/services/networkManagement2/lib/models/evaluatedNetworkSecurityGroup.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * 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'; - -/** - * Results of network security group evaluation. - * - */ -class EvaluatedNetworkSecurityGroup { - /** - * Create a EvaluatedNetworkSecurityGroup. - * @property {string} [networkSecurityGroupId] Network security group ID. - * @property {string} [appliedTo] Resource ID of nic or subnet to which - * network security group is applied. - * @property {object} [matchedRule] - * @property {string} [matchedRule.ruleName] Name of the matched network - * security rule. - * @property {string} [matchedRule.action] The network traffic is allowed or - * denied. Possible values are 'Allow' and 'Deny'. - * @property {array} [rulesEvaluationResult] List of network security rules - * evaluation results. - */ - constructor() { - } - - /** - * Defines the metadata of EvaluatedNetworkSecurityGroup - * - * @returns {object} metadata of EvaluatedNetworkSecurityGroup - * - */ - mapper() { - return { - required: false, - serializedName: 'EvaluatedNetworkSecurityGroup', - type: { - name: 'Composite', - className: 'EvaluatedNetworkSecurityGroup', - modelProperties: { - networkSecurityGroupId: { - required: false, - serializedName: 'networkSecurityGroupId', - type: { - name: 'String' - } - }, - appliedTo: { - required: false, - serializedName: 'appliedTo', - type: { - name: 'String' - } - }, - matchedRule: { - required: false, - serializedName: 'matchedRule', - type: { - name: 'Composite', - className: 'MatchedRule' - } - }, - rulesEvaluationResult: { - required: false, - readOnly: true, - serializedName: 'rulesEvaluationResult', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'NetworkSecurityRulesEvaluationResultElementType', - type: { - name: 'Composite', - className: 'NetworkSecurityRulesEvaluationResult' - } - } - } - } - } - } - }; - } -} - -module.exports = EvaluatedNetworkSecurityGroup; diff --git a/lib/services/networkManagement2/lib/models/expressRouteCircuit.js b/lib/services/networkManagement2/lib/models/expressRouteCircuit.js deleted file mode 100644 index fe3414539..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteCircuit.js +++ /dev/null @@ -1,269 +0,0 @@ -/* - * 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'); - -/** - * ExpressRouteCircuit resource - * - * @extends models['Resource'] - */ -class ExpressRouteCircuit extends models['Resource'] { - /** - * Create a ExpressRouteCircuit. - * @property {object} [sku] The SKU. - * @property {string} [sku.name] The name of the SKU. - * @property {string} [sku.tier] The tier of the SKU. Possible values are - * 'Standard', 'Premium' or 'Basic'. Possible values include: 'Standard', - * 'Premium', 'Basic' - * @property {string} [sku.family] The family of the SKU. Possible values - * are: 'UnlimitedData' and 'MeteredData'. Possible values include: - * 'UnlimitedData', 'MeteredData' - * @property {boolean} [allowClassicOperations] Allow classic operations - * @property {string} [circuitProvisioningState] The CircuitProvisioningState - * state of the resource. - * @property {string} [serviceProviderProvisioningState] The - * ServiceProviderProvisioningState state of the resource. Possible values - * are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' - * @property {array} [authorizations] The list of authorizations. - * @property {array} [peerings] The list of peerings. - * @property {string} [serviceKey] The ServiceKey. - * @property {string} [serviceProviderNotes] The ServiceProviderNotes. - * @property {object} [serviceProviderProperties] The - * ServiceProviderProperties. - * @property {string} [serviceProviderProperties.serviceProviderName] The - * serviceProviderName. - * @property {string} [serviceProviderProperties.peeringLocation] The peering - * location. - * @property {number} [serviceProviderProperties.bandwidthInMbps] The - * BandwidthInMbps. - * @property {object} [expressRoutePort] The reference to the - * ExpressRoutePort resource when the circuit is provisioned on an - * ExpressRoutePort resource. - * @property {string} [expressRoutePort.id] Resource ID. - * @property {number} [bandwidthInGbps] The bandwidth of the circuit when the - * circuit is provisioned on an ExpressRoutePort resource. - * @property {number} [stag] The identifier of the circuit traffic. Outer tag - * for QinQ encapsulation. - * @property {string} [provisioningState] Gets the provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [gatewayManagerEtag] The GatewayManager Etag. - * @property {boolean} [allowGlobalReach] Flag to enable Global Reach on the - * circuit. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ExpressRouteCircuit - * - * @returns {object} metadata of ExpressRouteCircuit - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteCircuit', - type: { - name: 'Composite', - className: 'ExpressRouteCircuit', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - sku: { - required: false, - serializedName: 'sku', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitSku' - } - }, - allowClassicOperations: { - required: false, - serializedName: 'properties.allowClassicOperations', - type: { - name: 'Boolean' - } - }, - circuitProvisioningState: { - required: false, - serializedName: 'properties.circuitProvisioningState', - type: { - name: 'String' - } - }, - serviceProviderProvisioningState: { - required: false, - serializedName: 'properties.serviceProviderProvisioningState', - type: { - name: 'String' - } - }, - authorizations: { - required: false, - serializedName: 'properties.authorizations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ExpressRouteCircuitAuthorizationElementType', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitAuthorization' - } - } - } - }, - peerings: { - required: false, - serializedName: 'properties.peerings', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ExpressRouteCircuitPeeringElementType', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitPeering' - } - } - } - }, - serviceKey: { - required: false, - serializedName: 'properties.serviceKey', - type: { - name: 'String' - } - }, - serviceProviderNotes: { - required: false, - serializedName: 'properties.serviceProviderNotes', - type: { - name: 'String' - } - }, - serviceProviderProperties: { - required: false, - serializedName: 'properties.serviceProviderProperties', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitServiceProviderProperties' - } - }, - expressRoutePort: { - required: false, - serializedName: 'properties.expressRoutePort', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - bandwidthInGbps: { - required: false, - serializedName: 'properties.bandwidthInGbps', - type: { - name: 'Number' - } - }, - stag: { - required: false, - readOnly: true, - serializedName: 'properties.stag', - type: { - name: 'Number' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - gatewayManagerEtag: { - required: false, - serializedName: 'properties.gatewayManagerEtag', - type: { - name: 'String' - } - }, - allowGlobalReach: { - required: false, - serializedName: 'properties.allowGlobalReach', - type: { - name: 'Boolean' - } - }, - etag: { - required: false, - readOnly: true, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteCircuit; diff --git a/lib/services/networkManagement2/lib/models/expressRouteCircuitArpTable.js b/lib/services/networkManagement2/lib/models/expressRouteCircuitArpTable.js deleted file mode 100644 index 74565fa2e..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteCircuitArpTable.js +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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'; - -/** - * The ARP table associated with the ExpressRouteCircuit. - * - */ -class ExpressRouteCircuitArpTable { - /** - * Create a ExpressRouteCircuitArpTable. - * @property {number} [age] Entry age in minutes - * @property {string} [interfaceProperty] Interface address - * @property {string} [ipAddress] The IP address. - * @property {string} [macAddress] The MAC address. - */ - constructor() { - } - - /** - * Defines the metadata of ExpressRouteCircuitArpTable - * - * @returns {object} metadata of ExpressRouteCircuitArpTable - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteCircuitArpTable', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitArpTable', - modelProperties: { - age: { - required: false, - serializedName: 'age', - type: { - name: 'Number' - } - }, - interfaceProperty: { - required: false, - serializedName: 'interface', - type: { - name: 'String' - } - }, - ipAddress: { - required: false, - serializedName: 'ipAddress', - type: { - name: 'String' - } - }, - macAddress: { - required: false, - serializedName: 'macAddress', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteCircuitArpTable; diff --git a/lib/services/networkManagement2/lib/models/expressRouteCircuitAuthorization.js b/lib/services/networkManagement2/lib/models/expressRouteCircuitAuthorization.js deleted file mode 100644 index cb83e671c..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteCircuitAuthorization.js +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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'); - -/** - * Authorization in an ExpressRouteCircuit resource. - * - * @extends models['SubResource'] - */ -class ExpressRouteCircuitAuthorization extends models['SubResource'] { - /** - * Create a ExpressRouteCircuitAuthorization. - * @property {string} [authorizationKey] The authorization key. - * @property {string} [authorizationUseStatus] AuthorizationUseStatus. - * Possible values are: 'Available' and 'InUse'. Possible values include: - * 'Available', 'InUse' - * @property {string} [provisioningState] Gets the provisioning state of the - * public IP resource. Possible values are: '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 ExpressRouteCircuitAuthorization - * - * @returns {object} metadata of ExpressRouteCircuitAuthorization - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteCircuitAuthorization', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitAuthorization', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - authorizationKey: { - required: false, - serializedName: 'properties.authorizationKey', - type: { - name: 'String' - } - }, - authorizationUseStatus: { - required: false, - serializedName: 'properties.authorizationUseStatus', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - 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 = ExpressRouteCircuitAuthorization; diff --git a/lib/services/networkManagement2/lib/models/expressRouteCircuitConnection.js b/lib/services/networkManagement2/lib/models/expressRouteCircuitConnection.js deleted file mode 100644 index f938b80f4..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteCircuitConnection.js +++ /dev/null @@ -1,135 +0,0 @@ -/* - * 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'); - -/** - * Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. - * - * @extends models['SubResource'] - */ -class ExpressRouteCircuitConnection extends models['SubResource'] { - /** - * Create a ExpressRouteCircuitConnection. - * @property {object} [expressRouteCircuitPeering] Reference to Express Route - * Circuit Private Peering Resource of the circuit initiating connection. - * @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} [authorizationKey] The authorization key. - * @property {string} [circuitConnectionStatus] Express Route Circuit - * Connection State. Possible values are: 'Connected' and 'Disconnected'. - * Possible values include: 'Connected', 'Connecting', 'Disconnected' - * @property {string} [provisioningState] Provisioning state of the circuit - * connection resource. Possible values are: 'Succeded', '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 ExpressRouteCircuitConnection - * - * @returns {object} metadata of ExpressRouteCircuitConnection - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteCircuitConnection', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitConnection', - 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' - } - }, - authorizationKey: { - required: false, - serializedName: 'properties.authorizationKey', - type: { - name: 'String' - } - }, - circuitConnectionStatus: { - required: false, - readOnly: true, - serializedName: 'properties.circuitConnectionStatus', - 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 = ExpressRouteCircuitConnection; diff --git a/lib/services/networkManagement2/lib/models/expressRouteCircuitConnectionListResult.js b/lib/services/networkManagement2/lib/models/expressRouteCircuitConnectionListResult.js deleted file mode 100644 index d840b3492..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteCircuitConnectionListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 ListConnections API service call retrieves all global reach - * connections that belongs to a Private Peering for an ExpressRouteCircuit. - */ -class ExpressRouteCircuitConnectionListResult extends Array { - /** - * Create a ExpressRouteCircuitConnectionListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ExpressRouteCircuitConnectionListResult - * - * @returns {object} metadata of ExpressRouteCircuitConnectionListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteCircuitConnectionListResult', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitConnectionListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ExpressRouteCircuitConnectionElementType', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitConnection' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteCircuitConnectionListResult; diff --git a/lib/services/networkManagement2/lib/models/expressRouteCircuitListResult.js b/lib/services/networkManagement2/lib/models/expressRouteCircuitListResult.js deleted file mode 100644 index 632a0d650..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteCircuitListResult.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 ListExpressRouteCircuit API service call. - */ -class ExpressRouteCircuitListResult extends Array { - /** - * Create a ExpressRouteCircuitListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ExpressRouteCircuitListResult - * - * @returns {object} metadata of ExpressRouteCircuitListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteCircuitListResult', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ExpressRouteCircuitElementType', - type: { - name: 'Composite', - className: 'ExpressRouteCircuit' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteCircuitListResult; diff --git a/lib/services/networkManagement2/lib/models/expressRouteCircuitPeering.js b/lib/services/networkManagement2/lib/models/expressRouteCircuitPeering.js deleted file mode 100644 index 081bc3005..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteCircuitPeering.js +++ /dev/null @@ -1,321 +0,0 @@ -/* - * 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'); - -/** - * Peering in an ExpressRouteCircuit resource. - * - * @extends models['SubResource'] - */ -class ExpressRouteCircuitPeering extends models['SubResource'] { - /** - * Create a ExpressRouteCircuitPeering. - * @property {string} [peeringType] The peering type. Possible values - * include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' - * @property {string} [state] The peering state. Possible values include: - * 'Disabled', 'Enabled' - * @property {number} [azureASN] The Azure ASN. - * @property {number} [peerASN] The peer ASN. - * @property {string} [primaryPeerAddressPrefix] The primary address prefix. - * @property {string} [secondaryPeerAddressPrefix] The secondary address - * prefix. - * @property {string} [primaryAzurePort] The primary port. - * @property {string} [secondaryAzurePort] The secondary port. - * @property {string} [sharedKey] The shared key. - * @property {number} [vlanId] The VLAN ID. - * @property {object} [microsoftPeeringConfig] The Microsoft peering - * configuration. - * @property {array} [microsoftPeeringConfig.advertisedPublicPrefixes] The - * reference of AdvertisedPublicPrefixes. - * @property {array} [microsoftPeeringConfig.advertisedCommunities] The - * communities of bgp peering. Spepcified for microsoft peering - * @property {string} [microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * @property {number} [microsoftPeeringConfig.legacyMode] The legacy mode of - * the peering. - * @property {number} [microsoftPeeringConfig.customerASN] The CustomerASN of - * the peering. - * @property {string} [microsoftPeeringConfig.routingRegistryName] The - * RoutingRegistryName of the configuration. - * @property {object} [stats] Gets peering stats. - * @property {number} [stats.primarybytesIn] Gets BytesIn of the peering. - * @property {number} [stats.primarybytesOut] Gets BytesOut of the peering. - * @property {number} [stats.secondarybytesIn] Gets BytesIn of the peering. - * @property {number} [stats.secondarybytesOut] Gets BytesOut of the peering. - * @property {string} [provisioningState] Gets the provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [gatewayManagerEtag] The GatewayManager Etag. - * @property {string} [lastModifiedBy] Gets whether the provider or the - * customer last modified the peering. - * @property {object} [routeFilter] The reference of the RouteFilter - * resource. - * @property {array} [routeFilter.rules] Collection of RouteFilterRules - * contained within a route filter. - * @property {array} [routeFilter.peerings] A collection of references to - * express route circuit peerings. - * @property {string} [routeFilter.provisioningState] The provisioning state - * of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' - * and 'Failed'. - * @property {string} [routeFilter.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * @property {object} [ipv6PeeringConfig] The IPv6 peering configuration. - * @property {string} [ipv6PeeringConfig.primaryPeerAddressPrefix] The - * primary address prefix. - * @property {string} [ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. - * @property {object} [ipv6PeeringConfig.microsoftPeeringConfig] The - * Microsoft peering configuration. - * @property {array} - * [ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] The - * reference of AdvertisedPublicPrefixes. - * @property {array} - * [ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] The - * communities of bgp peering. Spepcified for microsoft peering - * @property {string} - * [ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * @property {number} [ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] - * The legacy mode of the peering. - * @property {number} [ipv6PeeringConfig.microsoftPeeringConfig.customerASN] - * The CustomerASN of the peering. - * @property {string} - * [ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] The - * RoutingRegistryName of the configuration. - * @property {object} [ipv6PeeringConfig.routeFilter] The reference of the - * RouteFilter resource. - * @property {array} [ipv6PeeringConfig.routeFilter.rules] Collection of - * RouteFilterRules contained within a route filter. - * @property {array} [ipv6PeeringConfig.routeFilter.peerings] A collection of - * references to express route circuit peerings. - * @property {string} [ipv6PeeringConfig.routeFilter.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', 'Succeeded' and 'Failed'. - * @property {string} [ipv6PeeringConfig.routeFilter.etag] Gets a unique - * read-only string that changes whenever the resource is updated. - * @property {string} [ipv6PeeringConfig.state] The state of peering. - * Possible values are: 'Disabled' and 'Enabled'. Possible values include: - * 'Disabled', 'Enabled' - * @property {object} [expressRouteConnection] The ExpressRoute connection. - * @property {string} [expressRouteConnection.id] The ID of the - * ExpressRouteConnection. - * @property {array} [connections] The list of 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 - * the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ExpressRouteCircuitPeering - * - * @returns {object} metadata of ExpressRouteCircuitPeering - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteCircuitPeering', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitPeering', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - peeringType: { - required: false, - serializedName: 'properties.peeringType', - type: { - name: 'String' - } - }, - state: { - required: false, - serializedName: 'properties.state', - type: { - name: 'String' - } - }, - azureASN: { - required: false, - serializedName: 'properties.azureASN', - type: { - name: 'Number' - } - }, - peerASN: { - required: false, - serializedName: 'properties.peerASN', - constraints: { - InclusiveMaximum: 4294967295, - InclusiveMinimum: 1 - }, - type: { - name: 'Number' - } - }, - primaryPeerAddressPrefix: { - required: false, - serializedName: 'properties.primaryPeerAddressPrefix', - type: { - name: 'String' - } - }, - secondaryPeerAddressPrefix: { - required: false, - serializedName: 'properties.secondaryPeerAddressPrefix', - type: { - name: 'String' - } - }, - primaryAzurePort: { - required: false, - serializedName: 'properties.primaryAzurePort', - type: { - name: 'String' - } - }, - secondaryAzurePort: { - required: false, - serializedName: 'properties.secondaryAzurePort', - type: { - name: 'String' - } - }, - sharedKey: { - required: false, - serializedName: 'properties.sharedKey', - type: { - name: 'String' - } - }, - vlanId: { - required: false, - serializedName: 'properties.vlanId', - type: { - name: 'Number' - } - }, - microsoftPeeringConfig: { - required: false, - serializedName: 'properties.microsoftPeeringConfig', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitPeeringConfig' - } - }, - stats: { - required: false, - serializedName: 'properties.stats', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitStats' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - gatewayManagerEtag: { - required: false, - serializedName: 'properties.gatewayManagerEtag', - type: { - name: 'String' - } - }, - lastModifiedBy: { - required: false, - serializedName: 'properties.lastModifiedBy', - type: { - name: 'String' - } - }, - routeFilter: { - required: false, - serializedName: 'properties.routeFilter', - type: { - name: 'Composite', - className: 'RouteFilter' - } - }, - ipv6PeeringConfig: { - required: false, - serializedName: 'properties.ipv6PeeringConfig', - type: { - name: 'Composite', - className: 'Ipv6ExpressRouteCircuitPeeringConfig' - } - }, - expressRouteConnection: { - required: false, - serializedName: 'properties.expressRouteConnection', - type: { - name: 'Composite', - className: 'ExpressRouteConnectionId' - } - }, - connections: { - required: false, - serializedName: 'properties.connections', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ExpressRouteCircuitConnectionElementType', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitConnection' - } - } - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - readOnly: true, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteCircuitPeering; diff --git a/lib/services/networkManagement2/lib/models/expressRouteCircuitPeeringConfig.js b/lib/services/networkManagement2/lib/models/expressRouteCircuitPeeringConfig.js deleted file mode 100644 index d8b599509..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteCircuitPeeringConfig.js +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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'; - -/** - * Specifies the peering configuration. - * - */ -class ExpressRouteCircuitPeeringConfig { - /** - * Create a ExpressRouteCircuitPeeringConfig. - * @property {array} [advertisedPublicPrefixes] The reference of - * AdvertisedPublicPrefixes. - * @property {array} [advertisedCommunities] The communities of bgp peering. - * Spepcified for microsoft peering - * @property {string} [advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * @property {number} [legacyMode] The legacy mode of the peering. - * @property {number} [customerASN] The CustomerASN of the peering. - * @property {string} [routingRegistryName] The RoutingRegistryName of the - * configuration. - */ - constructor() { - } - - /** - * Defines the metadata of ExpressRouteCircuitPeeringConfig - * - * @returns {object} metadata of ExpressRouteCircuitPeeringConfig - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteCircuitPeeringConfig', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitPeeringConfig', - modelProperties: { - advertisedPublicPrefixes: { - required: false, - serializedName: 'advertisedPublicPrefixes', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - advertisedCommunities: { - required: false, - serializedName: 'advertisedCommunities', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - advertisedPublicPrefixesState: { - required: false, - serializedName: 'advertisedPublicPrefixesState', - type: { - name: 'String' - } - }, - legacyMode: { - required: false, - serializedName: 'legacyMode', - type: { - name: 'Number' - } - }, - customerASN: { - required: false, - serializedName: 'customerASN', - type: { - name: 'Number' - } - }, - routingRegistryName: { - required: false, - serializedName: 'routingRegistryName', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteCircuitPeeringConfig; diff --git a/lib/services/networkManagement2/lib/models/expressRouteCircuitPeeringId.js b/lib/services/networkManagement2/lib/models/expressRouteCircuitPeeringId.js deleted file mode 100644 index fda100a3a..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteCircuitPeeringId.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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'; - -/** - * ExpressRoute circuit peering identifier. - * - */ -class ExpressRouteCircuitPeeringId { - /** - * Create a ExpressRouteCircuitPeeringId. - * @property {string} [id] The ID of the ExpressRoute circuit peering. - */ - constructor() { - } - - /** - * Defines the metadata of ExpressRouteCircuitPeeringId - * - * @returns {object} metadata of ExpressRouteCircuitPeeringId - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteCircuitPeeringId', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitPeeringId', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteCircuitPeeringId; diff --git a/lib/services/networkManagement2/lib/models/expressRouteCircuitPeeringListResult.js b/lib/services/networkManagement2/lib/models/expressRouteCircuitPeeringListResult.js deleted file mode 100644 index fd93ec4db..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteCircuitPeeringListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 ListPeering API service call retrieves all peerings that belong - * to an ExpressRouteCircuit. - */ -class ExpressRouteCircuitPeeringListResult extends Array { - /** - * Create a ExpressRouteCircuitPeeringListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ExpressRouteCircuitPeeringListResult - * - * @returns {object} metadata of ExpressRouteCircuitPeeringListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteCircuitPeeringListResult', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitPeeringListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ExpressRouteCircuitPeeringElementType', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitPeering' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteCircuitPeeringListResult; diff --git a/lib/services/networkManagement2/lib/models/expressRouteCircuitReference.js b/lib/services/networkManagement2/lib/models/expressRouteCircuitReference.js deleted file mode 100644 index 16b8feba3..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteCircuitReference.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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'; - -/** - * Class representing a ExpressRouteCircuitReference. - */ -class ExpressRouteCircuitReference { - /** - * Create a ExpressRouteCircuitReference. - * @property {string} [id] Corresponding Express Route Circuit Id. - */ - constructor() { - } - - /** - * Defines the metadata of ExpressRouteCircuitReference - * - * @returns {object} metadata of ExpressRouteCircuitReference - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteCircuitReference', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitReference', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteCircuitReference; diff --git a/lib/services/networkManagement2/lib/models/expressRouteCircuitRoutesTable.js b/lib/services/networkManagement2/lib/models/expressRouteCircuitRoutesTable.js deleted file mode 100644 index 45ac0977f..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteCircuitRoutesTable.js +++ /dev/null @@ -1,86 +0,0 @@ -/* - * 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'; - -/** - * The routes table associated with the ExpressRouteCircuit - * - */ -class ExpressRouteCircuitRoutesTable { - /** - * Create a ExpressRouteCircuitRoutesTable. - * @property {string} [network] IP address of a network entity - * @property {string} [nextHop] NextHop address - * @property {string} [locPrf] Local preference value as set with the set - * local-preference route-map configuration command - * @property {number} [weight] Route Weight. - * @property {string} [path] Autonomous system paths to the destination - * network. - */ - constructor() { - } - - /** - * Defines the metadata of ExpressRouteCircuitRoutesTable - * - * @returns {object} metadata of ExpressRouteCircuitRoutesTable - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteCircuitRoutesTable', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitRoutesTable', - modelProperties: { - network: { - required: false, - serializedName: 'network', - type: { - name: 'String' - } - }, - nextHop: { - required: false, - serializedName: 'nextHop', - type: { - name: 'String' - } - }, - locPrf: { - required: false, - serializedName: 'locPrf', - type: { - name: 'String' - } - }, - weight: { - required: false, - serializedName: 'weight', - type: { - name: 'Number' - } - }, - path: { - required: false, - serializedName: 'path', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteCircuitRoutesTable; diff --git a/lib/services/networkManagement2/lib/models/expressRouteCircuitRoutesTableSummary.js b/lib/services/networkManagement2/lib/models/expressRouteCircuitRoutesTableSummary.js deleted file mode 100644 index 292b7756b..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteCircuitRoutesTableSummary.js +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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'; - -/** - * The routes table associated with the ExpressRouteCircuit. - * - */ -class ExpressRouteCircuitRoutesTableSummary { - /** - * Create a ExpressRouteCircuitRoutesTableSummary. - * @property {string} [neighbor] IP address of the neighbor. - * @property {number} [v] BGP version number spoken to the neighbor. - * @property {number} [as] Autonomous system number. - * @property {string} [upDown] The length of time that the BGP session has - * been in the Established state, or the current status if not in the - * Established state. - * @property {string} [statePfxRcd] Current state of the BGP session, and the - * number of prefixes that have been received from a neighbor or peer group. - */ - constructor() { - } - - /** - * Defines the metadata of ExpressRouteCircuitRoutesTableSummary - * - * @returns {object} metadata of ExpressRouteCircuitRoutesTableSummary - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteCircuitRoutesTableSummary', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitRoutesTableSummary', - modelProperties: { - neighbor: { - required: false, - serializedName: 'neighbor', - type: { - name: 'String' - } - }, - v: { - required: false, - serializedName: 'v', - type: { - name: 'Number' - } - }, - as: { - required: false, - serializedName: 'as', - type: { - name: 'Number' - } - }, - upDown: { - required: false, - serializedName: 'upDown', - type: { - name: 'String' - } - }, - statePfxRcd: { - required: false, - serializedName: 'statePfxRcd', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteCircuitRoutesTableSummary; diff --git a/lib/services/networkManagement2/lib/models/expressRouteCircuitServiceProviderProperties.js b/lib/services/networkManagement2/lib/models/expressRouteCircuitServiceProviderProperties.js deleted file mode 100644 index 32145139c..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteCircuitServiceProviderProperties.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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'; - -/** - * Contains ServiceProviderProperties in an ExpressRouteCircuit. - * - */ -class ExpressRouteCircuitServiceProviderProperties { - /** - * Create a ExpressRouteCircuitServiceProviderProperties. - * @property {string} [serviceProviderName] The serviceProviderName. - * @property {string} [peeringLocation] The peering location. - * @property {number} [bandwidthInMbps] The BandwidthInMbps. - */ - constructor() { - } - - /** - * Defines the metadata of ExpressRouteCircuitServiceProviderProperties - * - * @returns {object} metadata of ExpressRouteCircuitServiceProviderProperties - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteCircuitServiceProviderProperties', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitServiceProviderProperties', - modelProperties: { - serviceProviderName: { - required: false, - serializedName: 'serviceProviderName', - type: { - name: 'String' - } - }, - peeringLocation: { - required: false, - serializedName: 'peeringLocation', - type: { - name: 'String' - } - }, - bandwidthInMbps: { - required: false, - serializedName: 'bandwidthInMbps', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteCircuitServiceProviderProperties; diff --git a/lib/services/networkManagement2/lib/models/expressRouteCircuitSku.js b/lib/services/networkManagement2/lib/models/expressRouteCircuitSku.js deleted file mode 100644 index 3f1132db4..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteCircuitSku.js +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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'; - -/** - * Contains SKU in an ExpressRouteCircuit. - * - */ -class ExpressRouteCircuitSku { - /** - * Create a ExpressRouteCircuitSku. - * @property {string} [name] The name of the SKU. - * @property {string} [tier] The tier of the SKU. Possible values are - * 'Standard', 'Premium' or 'Basic'. Possible values include: 'Standard', - * 'Premium', 'Basic' - * @property {string} [family] The family of the SKU. Possible values are: - * 'UnlimitedData' and 'MeteredData'. Possible values include: - * 'UnlimitedData', 'MeteredData' - */ - constructor() { - } - - /** - * Defines the metadata of ExpressRouteCircuitSku - * - * @returns {object} metadata of ExpressRouteCircuitSku - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteCircuitSku', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitSku', - modelProperties: { - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - tier: { - required: false, - serializedName: 'tier', - type: { - name: 'String' - } - }, - family: { - required: false, - serializedName: 'family', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteCircuitSku; diff --git a/lib/services/networkManagement2/lib/models/expressRouteCircuitStats.js b/lib/services/networkManagement2/lib/models/expressRouteCircuitStats.js deleted file mode 100644 index daafa8919..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteCircuitStats.js +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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'; - -/** - * Contains stats associated with the peering. - * - */ -class ExpressRouteCircuitStats { - /** - * Create a ExpressRouteCircuitStats. - * @property {number} [primarybytesIn] Gets BytesIn of the peering. - * @property {number} [primarybytesOut] Gets BytesOut of the peering. - * @property {number} [secondarybytesIn] Gets BytesIn of the peering. - * @property {number} [secondarybytesOut] Gets BytesOut of the peering. - */ - constructor() { - } - - /** - * Defines the metadata of ExpressRouteCircuitStats - * - * @returns {object} metadata of ExpressRouteCircuitStats - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteCircuitStats', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitStats', - modelProperties: { - primarybytesIn: { - required: false, - serializedName: 'primarybytesIn', - type: { - name: 'Number' - } - }, - primarybytesOut: { - required: false, - serializedName: 'primarybytesOut', - type: { - name: 'Number' - } - }, - secondarybytesIn: { - required: false, - serializedName: 'secondarybytesIn', - type: { - name: 'Number' - } - }, - secondarybytesOut: { - required: false, - serializedName: 'secondarybytesOut', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteCircuitStats; diff --git a/lib/services/networkManagement2/lib/models/expressRouteCircuitsArpTableListResult.js b/lib/services/networkManagement2/lib/models/expressRouteCircuitsArpTableListResult.js deleted file mode 100644 index 1b6a7cc50..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteCircuitsArpTableListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 ListArpTable associated with the Express Route Circuits API. - * - */ -class ExpressRouteCircuitsArpTableListResult { - /** - * Create a ExpressRouteCircuitsArpTableListResult. - * @property {array} [value] Gets list of the ARP table. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - } - - /** - * Defines the metadata of ExpressRouteCircuitsArpTableListResult - * - * @returns {object} metadata of ExpressRouteCircuitsArpTableListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteCircuitsArpTableListResult', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitsArpTableListResult', - modelProperties: { - value: { - required: false, - serializedName: 'value', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ExpressRouteCircuitArpTableElementType', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitArpTable' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteCircuitsArpTableListResult; diff --git a/lib/services/networkManagement2/lib/models/expressRouteCircuitsRoutesTableListResult.js b/lib/services/networkManagement2/lib/models/expressRouteCircuitsRoutesTableListResult.js deleted file mode 100644 index cc8258435..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteCircuitsRoutesTableListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 ListRoutesTable associated with the Express Route Circuits API. - * - */ -class ExpressRouteCircuitsRoutesTableListResult { - /** - * Create a ExpressRouteCircuitsRoutesTableListResult. - * @property {array} [value] The list of routes table. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - } - - /** - * Defines the metadata of ExpressRouteCircuitsRoutesTableListResult - * - * @returns {object} metadata of ExpressRouteCircuitsRoutesTableListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteCircuitsRoutesTableListResult', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitsRoutesTableListResult', - modelProperties: { - value: { - required: false, - serializedName: 'value', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ExpressRouteCircuitRoutesTableElementType', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitRoutesTable' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteCircuitsRoutesTableListResult; diff --git a/lib/services/networkManagement2/lib/models/expressRouteCircuitsRoutesTableSummaryListResult.js b/lib/services/networkManagement2/lib/models/expressRouteCircuitsRoutesTableSummaryListResult.js deleted file mode 100644 index 8298b48a6..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteCircuitsRoutesTableSummaryListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 ListRoutesTable associated with the Express Route Circuits API. - * - */ -class ExpressRouteCircuitsRoutesTableSummaryListResult { - /** - * Create a ExpressRouteCircuitsRoutesTableSummaryListResult. - * @property {array} [value] A list of the routes table. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - } - - /** - * Defines the metadata of ExpressRouteCircuitsRoutesTableSummaryListResult - * - * @returns {object} metadata of ExpressRouteCircuitsRoutesTableSummaryListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteCircuitsRoutesTableSummaryListResult', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitsRoutesTableSummaryListResult', - modelProperties: { - value: { - required: false, - serializedName: 'value', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ExpressRouteCircuitRoutesTableSummaryElementType', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitRoutesTableSummary' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteCircuitsRoutesTableSummaryListResult; diff --git a/lib/services/networkManagement2/lib/models/expressRouteConnection.js b/lib/services/networkManagement2/lib/models/expressRouteConnection.js deleted file mode 100644 index 1e865b4d3..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteConnection.js +++ /dev/null @@ -1,104 +0,0 @@ -/* - * 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'); - -/** - * ExpressRouteConnection resource. - * - * @extends models['SubResource'] - */ -class ExpressRouteConnection extends models['SubResource'] { - /** - * Create a ExpressRouteConnection. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * @property {object} expressRouteCircuitPeering The ExpressRoute circuit - * peering. - * @property {string} [expressRouteCircuitPeering.id] The ID of the - * ExpressRoute circuit peering. - * @property {string} [authorizationKey] Authorization key to establish the - * connection. - * @property {number} [routingWeight] The routing weight associated to the - * connection. - * @property {string} name The name of the resource. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ExpressRouteConnection - * - * @returns {object} metadata of ExpressRouteConnection - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteConnection', - type: { - name: 'Composite', - className: 'ExpressRouteConnection', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - expressRouteCircuitPeering: { - required: true, - serializedName: 'properties.expressRouteCircuitPeering', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitPeeringId' - } - }, - authorizationKey: { - required: false, - serializedName: 'properties.authorizationKey', - type: { - name: 'String' - } - }, - routingWeight: { - required: false, - serializedName: 'properties.routingWeight', - type: { - name: 'Number' - } - }, - name: { - required: true, - serializedName: 'name', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteConnection; diff --git a/lib/services/networkManagement2/lib/models/expressRouteConnectionId.js b/lib/services/networkManagement2/lib/models/expressRouteConnectionId.js deleted file mode 100644 index dc09bd0b3..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteConnectionId.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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'; - -/** - * The ID of the ExpressRouteConnection. - * - */ -class ExpressRouteConnectionId { - /** - * Create a ExpressRouteConnectionId. - * @property {string} [id] The ID of the ExpressRouteConnection. - */ - constructor() { - } - - /** - * Defines the metadata of ExpressRouteConnectionId - * - * @returns {object} metadata of ExpressRouteConnectionId - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteConnectionId', - type: { - name: 'Composite', - className: 'ExpressRouteConnectionId', - modelProperties: { - id: { - required: false, - readOnly: true, - serializedName: 'id', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteConnectionId; diff --git a/lib/services/networkManagement2/lib/models/expressRouteConnectionList.js b/lib/services/networkManagement2/lib/models/expressRouteConnectionList.js deleted file mode 100644 index a23abbf08..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteConnectionList.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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'; - -/** - * ExpressRouteConnection list - * - */ -class ExpressRouteConnectionList { - /** - * Create a ExpressRouteConnectionList. - * @property {array} [value] The list of ExpressRoute connections - */ - constructor() { - } - - /** - * Defines the metadata of ExpressRouteConnectionList - * - * @returns {object} metadata of ExpressRouteConnectionList - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteConnectionList', - type: { - name: 'Composite', - className: 'ExpressRouteConnectionList', - modelProperties: { - value: { - required: false, - serializedName: 'value', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ExpressRouteConnectionElementType', - type: { - name: 'Composite', - className: 'ExpressRouteConnection' - } - } - } - } - } - } - }; - } -} - -module.exports = ExpressRouteConnectionList; diff --git a/lib/services/networkManagement2/lib/models/expressRouteCrossConnection.js b/lib/services/networkManagement2/lib/models/expressRouteCrossConnection.js deleted file mode 100644 index 6b1891580..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteCrossConnection.js +++ /dev/null @@ -1,204 +0,0 @@ -/* - * 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'); - -/** - * ExpressRouteCrossConnection resource - * - * @extends models['Resource'] - */ -class ExpressRouteCrossConnection extends models['Resource'] { - /** - * Create a ExpressRouteCrossConnection. - * @property {string} [primaryAzurePort] The name of the primary port. - * @property {string} [secondaryAzurePort] The name of the secondary port. - * @property {number} [sTag] The identifier of the circuit traffic. - * @property {string} [peeringLocation] The peering location of the - * ExpressRoute circuit. - * @property {number} [bandwidthInMbps] The circuit bandwidth In Mbps. - * @property {object} [expressRouteCircuit] The ExpressRouteCircuit - * @property {string} [expressRouteCircuit.id] Corresponding Express Route - * Circuit Id. - * @property {string} [serviceProviderProvisioningState] The provisioning - * state of the circuit in the connectivity provider system. Possible values - * are 'NotProvisioned', 'Provisioning', 'Provisioned'. Possible values - * include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' - * @property {string} [serviceProviderNotes] Additional read only notes set - * by the connectivity provider. - * @property {string} [provisioningState] Gets the provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {array} [peerings] The list of peerings. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ExpressRouteCrossConnection - * - * @returns {object} metadata of ExpressRouteCrossConnection - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteCrossConnection', - type: { - name: 'Composite', - className: 'ExpressRouteCrossConnection', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - primaryAzurePort: { - required: false, - readOnly: true, - serializedName: 'properties.primaryAzurePort', - type: { - name: 'String' - } - }, - secondaryAzurePort: { - required: false, - readOnly: true, - serializedName: 'properties.secondaryAzurePort', - type: { - name: 'String' - } - }, - sTag: { - required: false, - readOnly: true, - serializedName: 'properties.sTag', - type: { - name: 'Number' - } - }, - peeringLocation: { - required: false, - serializedName: 'properties.peeringLocation', - type: { - name: 'String' - } - }, - bandwidthInMbps: { - required: false, - serializedName: 'properties.bandwidthInMbps', - type: { - name: 'Number' - } - }, - expressRouteCircuit: { - required: false, - serializedName: 'properties.expressRouteCircuit', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitReference' - } - }, - serviceProviderProvisioningState: { - required: false, - serializedName: 'properties.serviceProviderProvisioningState', - type: { - name: 'String' - } - }, - serviceProviderNotes: { - required: false, - serializedName: 'properties.serviceProviderNotes', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - peerings: { - required: false, - serializedName: 'properties.peerings', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ExpressRouteCrossConnectionPeeringElementType', - type: { - name: 'Composite', - className: 'ExpressRouteCrossConnectionPeering' - } - } - } - }, - etag: { - required: false, - readOnly: true, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteCrossConnection; diff --git a/lib/services/networkManagement2/lib/models/expressRouteCrossConnectionListResult.js b/lib/services/networkManagement2/lib/models/expressRouteCrossConnectionListResult.js deleted file mode 100644 index e5b983edc..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteCrossConnectionListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 ListExpressRouteCrossConnection API service call. - */ -class ExpressRouteCrossConnectionListResult extends Array { - /** - * Create a ExpressRouteCrossConnectionListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ExpressRouteCrossConnectionListResult - * - * @returns {object} metadata of ExpressRouteCrossConnectionListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteCrossConnectionListResult', - type: { - name: 'Composite', - className: 'ExpressRouteCrossConnectionListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ExpressRouteCrossConnectionElementType', - type: { - name: 'Composite', - className: 'ExpressRouteCrossConnection' - } - } - } - }, - nextLink: { - required: false, - readOnly: true, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteCrossConnectionListResult; diff --git a/lib/services/networkManagement2/lib/models/expressRouteCrossConnectionPeering.js b/lib/services/networkManagement2/lib/models/expressRouteCrossConnectionPeering.js deleted file mode 100644 index 7160299e3..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteCrossConnectionPeering.js +++ /dev/null @@ -1,265 +0,0 @@ -/* - * 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'); - -/** - * Peering in an ExpressRoute Cross Connection resource. - * - * @extends models['SubResource'] - */ -class ExpressRouteCrossConnectionPeering extends models['SubResource'] { - /** - * Create a ExpressRouteCrossConnectionPeering. - * @property {string} [peeringType] The peering type. Possible values - * include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' - * @property {string} [state] The peering state. Possible values include: - * 'Disabled', 'Enabled' - * @property {number} [azureASN] The Azure ASN. - * @property {number} [peerASN] The peer ASN. - * @property {string} [primaryPeerAddressPrefix] The primary address prefix. - * @property {string} [secondaryPeerAddressPrefix] The secondary address - * prefix. - * @property {string} [primaryAzurePort] The primary port. - * @property {string} [secondaryAzurePort] The secondary port. - * @property {string} [sharedKey] The shared key. - * @property {number} [vlanId] The VLAN ID. - * @property {object} [microsoftPeeringConfig] The Microsoft peering - * configuration. - * @property {array} [microsoftPeeringConfig.advertisedPublicPrefixes] The - * reference of AdvertisedPublicPrefixes. - * @property {array} [microsoftPeeringConfig.advertisedCommunities] The - * communities of bgp peering. Spepcified for microsoft peering - * @property {string} [microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * @property {number} [microsoftPeeringConfig.legacyMode] The legacy mode of - * the peering. - * @property {number} [microsoftPeeringConfig.customerASN] The CustomerASN of - * the peering. - * @property {string} [microsoftPeeringConfig.routingRegistryName] The - * RoutingRegistryName of the configuration. - * @property {string} [provisioningState] Gets the provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [gatewayManagerEtag] The GatewayManager Etag. - * @property {string} [lastModifiedBy] Gets whether the provider or the - * customer last modified the peering. - * @property {object} [ipv6PeeringConfig] The IPv6 peering configuration. - * @property {string} [ipv6PeeringConfig.primaryPeerAddressPrefix] The - * primary address prefix. - * @property {string} [ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. - * @property {object} [ipv6PeeringConfig.microsoftPeeringConfig] The - * Microsoft peering configuration. - * @property {array} - * [ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] The - * reference of AdvertisedPublicPrefixes. - * @property {array} - * [ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] The - * communities of bgp peering. Spepcified for microsoft peering - * @property {string} - * [ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * @property {number} [ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] - * The legacy mode of the peering. - * @property {number} [ipv6PeeringConfig.microsoftPeeringConfig.customerASN] - * The CustomerASN of the peering. - * @property {string} - * [ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] The - * RoutingRegistryName of the configuration. - * @property {object} [ipv6PeeringConfig.routeFilter] The reference of the - * RouteFilter resource. - * @property {array} [ipv6PeeringConfig.routeFilter.rules] Collection of - * RouteFilterRules contained within a route filter. - * @property {array} [ipv6PeeringConfig.routeFilter.peerings] A collection of - * references to express route circuit peerings. - * @property {string} [ipv6PeeringConfig.routeFilter.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', 'Succeeded' and 'Failed'. - * @property {string} [ipv6PeeringConfig.routeFilter.etag] Gets a unique - * read-only string that changes whenever the resource is updated. - * @property {string} [ipv6PeeringConfig.state] The state of peering. - * Possible values are: 'Disabled' and 'Enabled'. Possible values include: - * 'Disabled', 'Enabled' - * @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 ExpressRouteCrossConnectionPeering - * - * @returns {object} metadata of ExpressRouteCrossConnectionPeering - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteCrossConnectionPeering', - type: { - name: 'Composite', - className: 'ExpressRouteCrossConnectionPeering', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - peeringType: { - required: false, - serializedName: 'properties.peeringType', - type: { - name: 'String' - } - }, - state: { - required: false, - serializedName: 'properties.state', - type: { - name: 'String' - } - }, - azureASN: { - required: false, - readOnly: true, - serializedName: 'properties.azureASN', - type: { - name: 'Number' - } - }, - peerASN: { - required: false, - serializedName: 'properties.peerASN', - constraints: { - InclusiveMaximum: 4294967295, - InclusiveMinimum: 1 - }, - type: { - name: 'Number' - } - }, - primaryPeerAddressPrefix: { - required: false, - serializedName: 'properties.primaryPeerAddressPrefix', - type: { - name: 'String' - } - }, - secondaryPeerAddressPrefix: { - required: false, - serializedName: 'properties.secondaryPeerAddressPrefix', - type: { - name: 'String' - } - }, - primaryAzurePort: { - required: false, - readOnly: true, - serializedName: 'properties.primaryAzurePort', - type: { - name: 'String' - } - }, - secondaryAzurePort: { - required: false, - readOnly: true, - serializedName: 'properties.secondaryAzurePort', - type: { - name: 'String' - } - }, - sharedKey: { - required: false, - serializedName: 'properties.sharedKey', - type: { - name: 'String' - } - }, - vlanId: { - required: false, - serializedName: 'properties.vlanId', - type: { - name: 'Number' - } - }, - microsoftPeeringConfig: { - required: false, - serializedName: 'properties.microsoftPeeringConfig', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitPeeringConfig' - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - gatewayManagerEtag: { - required: false, - serializedName: 'properties.gatewayManagerEtag', - type: { - name: 'String' - } - }, - lastModifiedBy: { - required: false, - serializedName: 'properties.lastModifiedBy', - type: { - name: 'String' - } - }, - ipv6PeeringConfig: { - required: false, - serializedName: 'properties.ipv6PeeringConfig', - type: { - name: 'Composite', - className: 'Ipv6ExpressRouteCircuitPeeringConfig' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - readOnly: true, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteCrossConnectionPeering; diff --git a/lib/services/networkManagement2/lib/models/expressRouteCrossConnectionPeeringList.js b/lib/services/networkManagement2/lib/models/expressRouteCrossConnectionPeeringList.js deleted file mode 100644 index 195fa0830..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteCrossConnectionPeeringList.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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 ListPeering API service call retrieves all peerings that belong - * to an ExpressRouteCrossConnection. - */ -class ExpressRouteCrossConnectionPeeringList extends Array { - /** - * Create a ExpressRouteCrossConnectionPeeringList. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ExpressRouteCrossConnectionPeeringList - * - * @returns {object} metadata of ExpressRouteCrossConnectionPeeringList - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteCrossConnectionPeeringList', - type: { - name: 'Composite', - className: 'ExpressRouteCrossConnectionPeeringList', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ExpressRouteCrossConnectionPeeringElementType', - type: { - name: 'Composite', - className: 'ExpressRouteCrossConnectionPeering' - } - } - } - }, - nextLink: { - required: false, - readOnly: true, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteCrossConnectionPeeringList; diff --git a/lib/services/networkManagement2/lib/models/expressRouteCrossConnectionRoutesTableSummary.js b/lib/services/networkManagement2/lib/models/expressRouteCrossConnectionRoutesTableSummary.js deleted file mode 100644 index bade51057..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteCrossConnectionRoutesTableSummary.js +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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'; - -/** - * The routes table associated with the ExpressRouteCircuit. - * - */ -class ExpressRouteCrossConnectionRoutesTableSummary { - /** - * Create a ExpressRouteCrossConnectionRoutesTableSummary. - * @property {string} [neighbor] IP address of Neighbor router - * @property {number} [asn] Autonomous system number. - * @property {string} [upDown] The length of time that the BGP session has - * been in the Established state, or the current status if not in the - * Established state. - * @property {string} [stateOrPrefixesReceived] Current state of the BGP - * session, and the number of prefixes that have been received from a - * neighbor or peer group. - */ - constructor() { - } - - /** - * Defines the metadata of ExpressRouteCrossConnectionRoutesTableSummary - * - * @returns {object} metadata of ExpressRouteCrossConnectionRoutesTableSummary - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteCrossConnectionRoutesTableSummary', - type: { - name: 'Composite', - className: 'ExpressRouteCrossConnectionRoutesTableSummary', - modelProperties: { - neighbor: { - required: false, - serializedName: 'neighbor', - type: { - name: 'String' - } - }, - asn: { - required: false, - serializedName: 'asn', - type: { - name: 'Number' - } - }, - upDown: { - required: false, - serializedName: 'upDown', - type: { - name: 'String' - } - }, - stateOrPrefixesReceived: { - required: false, - serializedName: 'stateOrPrefixesReceived', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteCrossConnectionRoutesTableSummary; diff --git a/lib/services/networkManagement2/lib/models/expressRouteCrossConnectionsRoutesTableSummaryListResult.js b/lib/services/networkManagement2/lib/models/expressRouteCrossConnectionsRoutesTableSummaryListResult.js deleted file mode 100644 index 8d232042b..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteCrossConnectionsRoutesTableSummaryListResult.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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 ListRoutesTable associated with the Express Route Cross - * Connections. - * - */ -class ExpressRouteCrossConnectionsRoutesTableSummaryListResult { - /** - * Create a ExpressRouteCrossConnectionsRoutesTableSummaryListResult. - * @property {array} [value] A list of the routes table. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - } - - /** - * Defines the metadata of ExpressRouteCrossConnectionsRoutesTableSummaryListResult - * - * @returns {object} metadata of ExpressRouteCrossConnectionsRoutesTableSummaryListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteCrossConnectionsRoutesTableSummaryListResult', - type: { - name: 'Composite', - className: 'ExpressRouteCrossConnectionsRoutesTableSummaryListResult', - modelProperties: { - value: { - required: false, - serializedName: 'value', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ExpressRouteCrossConnectionRoutesTableSummaryElementType', - type: { - name: 'Composite', - className: 'ExpressRouteCrossConnectionRoutesTableSummary' - } - } - } - }, - nextLink: { - required: false, - readOnly: true, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteCrossConnectionsRoutesTableSummaryListResult; diff --git a/lib/services/networkManagement2/lib/models/expressRouteGateway.js b/lib/services/networkManagement2/lib/models/expressRouteGateway.js deleted file mode 100644 index 3ba9059ef..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteGateway.js +++ /dev/null @@ -1,161 +0,0 @@ -/* - * 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'); - -/** - * ExpressRoute gateway resource. - * - * @extends models['Resource'] - */ -class ExpressRouteGateway extends models['Resource'] { - /** - * Create a ExpressRouteGateway. - * @property {object} [autoScaleConfiguration] Configuration for auto - * scaling. - * @property {object} [autoScaleConfiguration.bounds] Minimum and maximum - * number of scale units to deploy. - * @property {number} [autoScaleConfiguration.bounds.min] Minimum number of - * scale units deployed for ExpressRoute gateway. - * @property {number} [autoScaleConfiguration.bounds.max] Maximum number of - * scale units deployed for ExpressRoute gateway. - * @property {array} [expressRouteConnections] List of ExpressRoute - * connections to the ExpressRoute gateway. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * @property {object} virtualHub The Virtual Hub where the ExpressRoute - * gateway is or will be deployed. - * @property {string} [virtualHub.id] The resource URI for the Virtual Hub - * where the ExpressRoute gateway is or will be deployed. The Virtual Hub - * resource and the ExpressRoute gateway resource reside in the same - * subscription. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ExpressRouteGateway - * - * @returns {object} metadata of ExpressRouteGateway - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteGateway', - type: { - name: 'Composite', - className: 'ExpressRouteGateway', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - autoScaleConfiguration: { - required: false, - serializedName: 'properties.autoScaleConfiguration', - type: { - name: 'Composite', - className: 'ExpressRouteGatewayPropertiesAutoScaleConfiguration' - } - }, - expressRouteConnections: { - required: false, - readOnly: true, - serializedName: 'properties.expressRouteConnections', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ExpressRouteConnectionElementType', - type: { - name: 'Composite', - className: 'ExpressRouteConnection' - } - } - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - virtualHub: { - required: true, - serializedName: 'properties.virtualHub', - type: { - name: 'Composite', - className: 'VirtualHubId' - } - }, - etag: { - required: false, - readOnly: true, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteGateway; diff --git a/lib/services/networkManagement2/lib/models/expressRouteGatewayList.js b/lib/services/networkManagement2/lib/models/expressRouteGatewayList.js deleted file mode 100644 index 71f0937a3..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteGatewayList.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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'; - -/** - * List of ExpressRoute gateways. - * - */ -class ExpressRouteGatewayList { - /** - * Create a ExpressRouteGatewayList. - * @property {array} [value] List of ExpressRoute gateways. - */ - constructor() { - } - - /** - * Defines the metadata of ExpressRouteGatewayList - * - * @returns {object} metadata of ExpressRouteGatewayList - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteGatewayList', - type: { - name: 'Composite', - className: 'ExpressRouteGatewayList', - modelProperties: { - value: { - required: false, - serializedName: 'value', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ExpressRouteGatewayElementType', - type: { - name: 'Composite', - className: 'ExpressRouteGateway' - } - } - } - } - } - } - }; - } -} - -module.exports = ExpressRouteGatewayList; diff --git a/lib/services/networkManagement2/lib/models/expressRouteGatewayPropertiesAutoScaleConfiguration.js b/lib/services/networkManagement2/lib/models/expressRouteGatewayPropertiesAutoScaleConfiguration.js deleted file mode 100644 index a3f7a1197..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteGatewayPropertiesAutoScaleConfiguration.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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'; - -/** - * Configuration for auto scaling. - * - */ -class ExpressRouteGatewayPropertiesAutoScaleConfiguration { - /** - * Create a ExpressRouteGatewayPropertiesAutoScaleConfiguration. - * @property {object} [bounds] Minimum and maximum number of scale units to - * deploy. - * @property {number} [bounds.min] Minimum number of scale units deployed for - * ExpressRoute gateway. - * @property {number} [bounds.max] Maximum number of scale units deployed for - * ExpressRoute gateway. - */ - constructor() { - } - - /** - * Defines the metadata of ExpressRouteGatewayPropertiesAutoScaleConfiguration - * - * @returns {object} metadata of ExpressRouteGatewayPropertiesAutoScaleConfiguration - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteGatewayProperties_autoScaleConfiguration', - type: { - name: 'Composite', - className: 'ExpressRouteGatewayPropertiesAutoScaleConfiguration', - modelProperties: { - bounds: { - required: false, - serializedName: 'bounds', - type: { - name: 'Composite', - className: 'ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteGatewayPropertiesAutoScaleConfiguration; diff --git a/lib/services/networkManagement2/lib/models/expressRouteGatewayPropertiesAutoScaleConfigurationBounds.js b/lib/services/networkManagement2/lib/models/expressRouteGatewayPropertiesAutoScaleConfigurationBounds.js deleted file mode 100644 index 6a508544d..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteGatewayPropertiesAutoScaleConfigurationBounds.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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'; - -/** - * Minimum and maximum number of scale units to deploy. - * - */ -class ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds { - /** - * Create a ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds. - * @property {number} [min] Minimum number of scale units deployed for - * ExpressRoute gateway. - * @property {number} [max] Maximum number of scale units deployed for - * ExpressRoute gateway. - */ - constructor() { - } - - /** - * Defines the metadata of ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds - * - * @returns {object} metadata of ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteGatewayProperties_autoScaleConfiguration_bounds', - type: { - name: 'Composite', - className: 'ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds', - modelProperties: { - min: { - required: false, - serializedName: 'min', - type: { - name: 'Number' - } - }, - max: { - required: false, - serializedName: 'max', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds; diff --git a/lib/services/networkManagement2/lib/models/expressRouteLink.js b/lib/services/networkManagement2/lib/models/expressRouteLink.js deleted file mode 100644 index aecc4482c..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteLink.js +++ /dev/null @@ -1,144 +0,0 @@ -/* - * 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'); - -/** - * @summary ExpressRouteLink - * - * ExpressRouteLink child resource definition. - * - * @extends models['SubResource'] - */ -class ExpressRouteLink extends models['SubResource'] { - /** - * Create a ExpressRouteLink. - * @property {string} [routerName] Name of Azure router associated with - * physical port. - * @property {string} [interfaceName] Name of Azure router interface. - * @property {string} [patchPanelId] Mapping between physical port to patch - * panel port. - * @property {string} [rackId] Mapping of physical patch panel to rack. - * @property {string} [connectorType] Physical fiber port type. Possible - * values include: 'LC', 'SC' - * @property {string} [adminState] Administrative state of the physical port. - * Possible values include: 'Enabled', 'Disabled' - * @property {string} [provisioningState] The provisioning state of the - * ExpressRouteLink resource. Possible values are: 'Succeeded', 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [name] Name of child port resource that is unique among - * child port resources of the parent. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ExpressRouteLink - * - * @returns {object} metadata of ExpressRouteLink - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteLink', - type: { - name: 'Composite', - className: 'ExpressRouteLink', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - routerName: { - required: false, - readOnly: true, - serializedName: 'properties.routerName', - type: { - name: 'String' - } - }, - interfaceName: { - required: false, - readOnly: true, - serializedName: 'properties.interfaceName', - type: { - name: 'String' - } - }, - patchPanelId: { - required: false, - readOnly: true, - serializedName: 'properties.patchPanelId', - type: { - name: 'String' - } - }, - rackId: { - required: false, - readOnly: true, - serializedName: 'properties.rackId', - type: { - name: 'String' - } - }, - connectorType: { - required: false, - readOnly: true, - serializedName: 'properties.connectorType', - type: { - name: 'String' - } - }, - adminState: { - required: false, - serializedName: 'properties.adminState', - 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 = ExpressRouteLink; diff --git a/lib/services/networkManagement2/lib/models/expressRouteLinkListResult.js b/lib/services/networkManagement2/lib/models/expressRouteLinkListResult.js deleted file mode 100644 index c846fd7c9..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteLinkListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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'; - -/** - * @summary ExpressRouteLink List Result - * Response for ListExpressRouteLinks API service call. - */ -class ExpressRouteLinkListResult extends Array { - /** - * Create a ExpressRouteLinkListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ExpressRouteLinkListResult - * - * @returns {object} metadata of ExpressRouteLinkListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteLinkListResult', - type: { - name: 'Composite', - className: 'ExpressRouteLinkListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ExpressRouteLinkElementType', - type: { - name: 'Composite', - className: 'ExpressRouteLink' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteLinkListResult; diff --git a/lib/services/networkManagement2/lib/models/expressRoutePort.js b/lib/services/networkManagement2/lib/models/expressRoutePort.js deleted file mode 100644 index 825da5b27..000000000 --- a/lib/services/networkManagement2/lib/models/expressRoutePort.js +++ /dev/null @@ -1,224 +0,0 @@ -/* - * 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'); - -/** - * @summary ExpressRoute Port - * - * ExpressRoutePort resource definition. - * - * @extends models['Resource'] - */ -class ExpressRoutePort extends models['Resource'] { - /** - * Create a ExpressRoutePort. - * @property {string} [peeringLocation] The name of the peering location that - * the ExpressRoutePort is mapped to physically. - * @property {number} [bandwidthInGbps] Bandwidth of procured ports in Gbps - * @property {number} [provisionedBandwidthInGbps] Aggregate Gbps of - * associated circuit bandwidths. - * @property {string} [mtu] Maximum transmission unit of the physical port - * pair(s) - * @property {string} [encapsulation] Encapsulation method on physical ports. - * Possible values include: 'Dot1Q', 'QinQ' - * @property {string} [etherType] Ethertype of the physical port. - * @property {string} [allocationDate] Date of the physical port allocation - * to be used in Letter of Authorization. - * @property {array} [links] ExpressRouteLink Sub-Resources. The set of - * physical links of the ExpressRoutePort resource - * @property {array} [circuits] Reference the ExpressRoute circuit(s) that - * are provisioned on this ExpressRoutePort resource. - * @property {string} [provisioningState] The provisioning state of the - * ExpressRoutePort resource. Possible values are: 'Succeeded', 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [resourceGuid] The resource GUID property of the - * ExpressRoutePort resource. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ExpressRoutePort - * - * @returns {object} metadata of ExpressRoutePort - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRoutePort', - type: { - name: 'Composite', - className: 'ExpressRoutePort', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - peeringLocation: { - required: false, - serializedName: 'properties.peeringLocation', - type: { - name: 'String' - } - }, - bandwidthInGbps: { - required: false, - serializedName: 'properties.bandwidthInGbps', - type: { - name: 'Number' - } - }, - provisionedBandwidthInGbps: { - required: false, - readOnly: true, - serializedName: 'properties.provisionedBandwidthInGbps', - type: { - name: 'Number' - } - }, - mtu: { - required: false, - readOnly: true, - serializedName: 'properties.mtu', - type: { - name: 'String' - } - }, - encapsulation: { - required: false, - serializedName: 'properties.encapsulation', - type: { - name: 'String' - } - }, - etherType: { - required: false, - readOnly: true, - serializedName: 'properties.etherType', - type: { - name: 'String' - } - }, - allocationDate: { - required: false, - readOnly: true, - serializedName: 'properties.allocationDate', - type: { - name: 'String' - } - }, - links: { - required: false, - serializedName: 'properties.links', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ExpressRouteLinkElementType', - type: { - name: 'Composite', - className: 'ExpressRouteLink' - } - } - } - }, - circuits: { - required: false, - readOnly: true, - serializedName: 'properties.circuits', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SubResourceElementType', - type: { - name: 'Composite', - className: 'SubResource' - } - } - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - resourceGuid: { - required: false, - serializedName: 'properties.resourceGuid', - type: { - name: 'String' - } - }, - etag: { - required: false, - readOnly: true, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRoutePort; diff --git a/lib/services/networkManagement2/lib/models/expressRoutePortListResult.js b/lib/services/networkManagement2/lib/models/expressRoutePortListResult.js deleted file mode 100644 index 1453a2c1a..000000000 --- a/lib/services/networkManagement2/lib/models/expressRoutePortListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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'; - -/** - * @summary ExpressRoute Port List Result - * Response for ListExpressRoutePorts API service call. - */ -class ExpressRoutePortListResult extends Array { - /** - * Create a ExpressRoutePortListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ExpressRoutePortListResult - * - * @returns {object} metadata of ExpressRoutePortListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRoutePortListResult', - type: { - name: 'Composite', - className: 'ExpressRoutePortListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ExpressRoutePortElementType', - type: { - name: 'Composite', - className: 'ExpressRoutePort' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRoutePortListResult; diff --git a/lib/services/networkManagement2/lib/models/expressRoutePortsLocation.js b/lib/services/networkManagement2/lib/models/expressRoutePortsLocation.js deleted file mode 100644 index e1098643a..000000000 --- a/lib/services/networkManagement2/lib/models/expressRoutePortsLocation.js +++ /dev/null @@ -1,140 +0,0 @@ -/* - * 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'); - -/** - * @summary ExpressRoutePorts Peering Location - * - * Definition of the ExpressRoutePorts peering location resource. - * - * @extends models['Resource'] - */ -class ExpressRoutePortsLocation extends models['Resource'] { - /** - * Create a ExpressRoutePortsLocation. - * @property {string} [address] Address of peering location. - * @property {string} [contact] Contact details of peering locations. - * @property {array} [availableBandwidths] The inventory of available - * ExpressRoutePort bandwidths. - * @property {string} [provisioningState] The provisioning state of the - * ExpressRoutePortLocation resource. Possible values are: 'Succeeded', - * 'Updating', 'Deleting', and 'Failed'. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ExpressRoutePortsLocation - * - * @returns {object} metadata of ExpressRoutePortsLocation - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRoutePortsLocation', - type: { - name: 'Composite', - className: 'ExpressRoutePortsLocation', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - address: { - required: false, - readOnly: true, - serializedName: 'properties.address', - type: { - name: 'String' - } - }, - contact: { - required: false, - readOnly: true, - serializedName: 'properties.contact', - type: { - name: 'String' - } - }, - availableBandwidths: { - required: false, - serializedName: 'properties.availableBandwidths', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ExpressRoutePortsLocationBandwidthsElementType', - type: { - name: 'Composite', - className: 'ExpressRoutePortsLocationBandwidths' - } - } - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRoutePortsLocation; diff --git a/lib/services/networkManagement2/lib/models/expressRoutePortsLocationBandwidths.js b/lib/services/networkManagement2/lib/models/expressRoutePortsLocationBandwidths.js deleted file mode 100644 index bb158bcd2..000000000 --- a/lib/services/networkManagement2/lib/models/expressRoutePortsLocationBandwidths.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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'; - -/** - * @summary ExpressRoutePorts Location Bandwidths - * - * Real-time inventory of available ExpressRoute port bandwidths. - * - */ -class ExpressRoutePortsLocationBandwidths { - /** - * Create a ExpressRoutePortsLocationBandwidths. - * @property {string} [offerName] Bandwidth descriptive name - * @property {number} [valueInGbps] Bandwidth value in Gbps - */ - constructor() { - } - - /** - * Defines the metadata of ExpressRoutePortsLocationBandwidths - * - * @returns {object} metadata of ExpressRoutePortsLocationBandwidths - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRoutePortsLocationBandwidths', - type: { - name: 'Composite', - className: 'ExpressRoutePortsLocationBandwidths', - modelProperties: { - offerName: { - required: false, - readOnly: true, - serializedName: 'offerName', - type: { - name: 'String' - } - }, - valueInGbps: { - required: false, - readOnly: true, - serializedName: 'valueInGbps', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = ExpressRoutePortsLocationBandwidths; diff --git a/lib/services/networkManagement2/lib/models/expressRoutePortsLocationListResult.js b/lib/services/networkManagement2/lib/models/expressRoutePortsLocationListResult.js deleted file mode 100644 index d7eeba384..000000000 --- a/lib/services/networkManagement2/lib/models/expressRoutePortsLocationListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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'; - -/** - * @summary ExpressRoutePorts Location List Result - * Response for ListExpressRoutePortsLocations API service call. - */ -class ExpressRoutePortsLocationListResult extends Array { - /** - * Create a ExpressRoutePortsLocationListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ExpressRoutePortsLocationListResult - * - * @returns {object} metadata of ExpressRoutePortsLocationListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRoutePortsLocationListResult', - type: { - name: 'Composite', - className: 'ExpressRoutePortsLocationListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ExpressRoutePortsLocationElementType', - type: { - name: 'Composite', - className: 'ExpressRoutePortsLocation' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRoutePortsLocationListResult; diff --git a/lib/services/networkManagement2/lib/models/expressRouteServiceProvider.js b/lib/services/networkManagement2/lib/models/expressRouteServiceProvider.js deleted file mode 100644 index 45a6ab231..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteServiceProvider.js +++ /dev/null @@ -1,132 +0,0 @@ -/* - * 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'); - -/** - * A ExpressRouteResourceProvider object. - * - * @extends models['Resource'] - */ -class ExpressRouteServiceProvider extends models['Resource'] { - /** - * Create a ExpressRouteServiceProvider. - * @property {array} [peeringLocations] Get a list of peering locations. - * @property {array} [bandwidthsOffered] Gets bandwidths offered. - * @property {string} [provisioningState] Gets the provisioning state of the - * resource. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ExpressRouteServiceProvider - * - * @returns {object} metadata of ExpressRouteServiceProvider - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteServiceProvider', - type: { - name: 'Composite', - className: 'ExpressRouteServiceProvider', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - peeringLocations: { - required: false, - serializedName: 'properties.peeringLocations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - bandwidthsOffered: { - required: false, - serializedName: 'properties.bandwidthsOffered', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ExpressRouteServiceProviderBandwidthsOfferedElementType', - type: { - name: 'Composite', - className: 'ExpressRouteServiceProviderBandwidthsOffered' - } - } - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteServiceProvider; diff --git a/lib/services/networkManagement2/lib/models/expressRouteServiceProviderBandwidthsOffered.js b/lib/services/networkManagement2/lib/models/expressRouteServiceProviderBandwidthsOffered.js deleted file mode 100644 index 9504fed98..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteServiceProviderBandwidthsOffered.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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'; - -/** - * Contains bandwidths offered in ExpressRouteServiceProvider resources. - * - */ -class ExpressRouteServiceProviderBandwidthsOffered { - /** - * Create a ExpressRouteServiceProviderBandwidthsOffered. - * @property {string} [offerName] The OfferName. - * @property {number} [valueInMbps] The ValueInMbps. - */ - constructor() { - } - - /** - * Defines the metadata of ExpressRouteServiceProviderBandwidthsOffered - * - * @returns {object} metadata of ExpressRouteServiceProviderBandwidthsOffered - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteServiceProviderBandwidthsOffered', - type: { - name: 'Composite', - className: 'ExpressRouteServiceProviderBandwidthsOffered', - modelProperties: { - offerName: { - required: false, - serializedName: 'offerName', - type: { - name: 'String' - } - }, - valueInMbps: { - required: false, - serializedName: 'valueInMbps', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteServiceProviderBandwidthsOffered; diff --git a/lib/services/networkManagement2/lib/models/expressRouteServiceProviderListResult.js b/lib/services/networkManagement2/lib/models/expressRouteServiceProviderListResult.js deleted file mode 100644 index 9c9cde4de..000000000 --- a/lib/services/networkManagement2/lib/models/expressRouteServiceProviderListResult.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 the ListExpressRouteServiceProvider API service call. - */ -class ExpressRouteServiceProviderListResult extends Array { - /** - * Create a ExpressRouteServiceProviderListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ExpressRouteServiceProviderListResult - * - * @returns {object} metadata of ExpressRouteServiceProviderListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ExpressRouteServiceProviderListResult', - type: { - name: 'Composite', - className: 'ExpressRouteServiceProviderListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ExpressRouteServiceProviderElementType', - type: { - name: 'Composite', - className: 'ExpressRouteServiceProvider' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ExpressRouteServiceProviderListResult; diff --git a/lib/services/networkManagement2/lib/models/flowLogFormatParameters.js b/lib/services/networkManagement2/lib/models/flowLogFormatParameters.js deleted file mode 100644 index 3a57e9cc6..000000000 --- a/lib/services/networkManagement2/lib/models/flowLogFormatParameters.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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'; - -/** - * Parameters that define the flow log format. - * - */ -class FlowLogFormatParameters { - /** - * Create a FlowLogFormatParameters. - * @property {string} [type] The file type of flow log. Possible values - * include: 'JSON' - * @property {number} [version] The version (revision) of the flow log. - * Default value: 0 . - */ - constructor() { - } - - /** - * Defines the metadata of FlowLogFormatParameters - * - * @returns {object} metadata of FlowLogFormatParameters - * - */ - mapper() { - return { - required: false, - serializedName: 'FlowLogFormatParameters', - type: { - name: 'Composite', - className: 'FlowLogFormatParameters', - modelProperties: { - type: { - required: false, - serializedName: 'type', - type: { - name: 'String' - } - }, - version: { - required: false, - serializedName: 'version', - defaultValue: 0, - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = FlowLogFormatParameters; diff --git a/lib/services/networkManagement2/lib/models/flowLogInformation.js b/lib/services/networkManagement2/lib/models/flowLogInformation.js deleted file mode 100644 index 20bbb0b7f..000000000 --- a/lib/services/networkManagement2/lib/models/flowLogInformation.js +++ /dev/null @@ -1,124 +0,0 @@ -/* - * 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'; - -/** - * Information on the configuration of flow log and traffic analytics - * (optional) . - * - */ -class FlowLogInformation { - /** - * Create a FlowLogInformation. - * @property {string} targetResourceId The ID of the resource to configure - * for flow log and traffic analytics (optional) . - * @property {string} storageId ID of the storage account which is used to - * store the flow log. - * @property {boolean} enabled Flag to enable/disable flow logging. - * @property {object} [retentionPolicy] - * @property {number} [retentionPolicy.days] Number of days to retain flow - * log records. - * @property {boolean} [retentionPolicy.enabled] Flag to enable/disable - * retention. - * @property {object} [format] - * @property {string} [format.type] The file type of flow log. Possible - * values include: 'JSON' - * @property {number} [format.version] The version (revision) of the flow - * log. - * @property {object} [flowAnalyticsConfiguration] - * @property {object} - * [flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration] - * @property {boolean} - * [flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled] - * Flag to enable/disable traffic analytics. - * @property {string} - * [flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId] - * The resource guid of the attached workspace - * @property {string} - * [flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion] - * The location of the attached workspace - * @property {string} - * [flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId] - * Resource Id of the attached workspace - * @property {number} - * [flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.trafficAnalyticsInterval] - * The interval in minutes which would decide how frequently TA service - * should do flow analytics - */ - constructor() { - } - - /** - * Defines the metadata of FlowLogInformation - * - * @returns {object} metadata of FlowLogInformation - * - */ - mapper() { - return { - required: false, - serializedName: 'FlowLogInformation', - type: { - name: 'Composite', - className: 'FlowLogInformation', - modelProperties: { - targetResourceId: { - required: true, - serializedName: 'targetResourceId', - type: { - name: 'String' - } - }, - storageId: { - required: true, - serializedName: 'properties.storageId', - type: { - name: 'String' - } - }, - enabled: { - required: true, - serializedName: 'properties.enabled', - type: { - name: 'Boolean' - } - }, - retentionPolicy: { - required: false, - serializedName: 'properties.retentionPolicy', - type: { - name: 'Composite', - className: 'RetentionPolicyParameters' - } - }, - format: { - required: false, - serializedName: 'properties.format', - type: { - name: 'Composite', - className: 'FlowLogFormatParameters' - } - }, - flowAnalyticsConfiguration: { - required: false, - serializedName: 'flowAnalyticsConfiguration', - type: { - name: 'Composite', - className: 'TrafficAnalyticsProperties' - } - } - } - } - }; - } -} - -module.exports = FlowLogInformation; diff --git a/lib/services/networkManagement2/lib/models/flowLogStatusParameters.js b/lib/services/networkManagement2/lib/models/flowLogStatusParameters.js deleted file mode 100644 index 111c451ce..000000000 --- a/lib/services/networkManagement2/lib/models/flowLogStatusParameters.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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'; - -/** - * Parameters that define a resource to query flow log and traffic analytics - * (optional) status. - * - */ -class FlowLogStatusParameters { - /** - * Create a FlowLogStatusParameters. - * @property {string} targetResourceId The target resource where getting the - * flow log and traffic analytics (optional) status. - */ - constructor() { - } - - /** - * Defines the metadata of FlowLogStatusParameters - * - * @returns {object} metadata of FlowLogStatusParameters - * - */ - mapper() { - return { - required: false, - serializedName: 'FlowLogStatusParameters', - type: { - name: 'Composite', - className: 'FlowLogStatusParameters', - modelProperties: { - targetResourceId: { - required: true, - serializedName: 'targetResourceId', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = FlowLogStatusParameters; diff --git a/lib/services/networkManagement2/lib/models/frontendIPConfiguration.js b/lib/services/networkManagement2/lib/models/frontendIPConfiguration.js deleted file mode 100644 index 935a6e5df..000000000 --- a/lib/services/networkManagement2/lib/models/frontendIPConfiguration.js +++ /dev/null @@ -1,425 +0,0 @@ -/* - * 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'); - -/** - * Frontend IP address of the load balancer. - * - * @extends models['SubResource'] - */ -class FrontendIPConfiguration extends models['SubResource'] { - /** - * Create a FrontendIPConfiguration. - * @property {array} [inboundNatRules] Read only. Inbound rules URIs that use - * this frontend IP. - * @property {array} [inboundNatPools] Read only. Inbound pools URIs that use - * this frontend IP. - * @property {array} [outboundRules] Read only. Outbound rules URIs that use - * this frontend IP. - * @property {array} [loadBalancingRules] Gets load balancing rules URIs that - * use this frontend IP. - * @property {string} [privateIPAddress] The private IP address of the IP - * configuration. - * @property {string} [privateIPAllocationMethod] The Private IP allocation - * method. Possible values are: 'Static' and 'Dynamic'. Possible values - * include: 'Static', 'Dynamic' - * @property {object} [subnet] The reference of the subnet resource. - * @property {string} [subnet.addressPrefix] The address prefix for the - * subnet. - * @property {array} [subnet.addressPrefixes] List of address prefixes for - * the subnet. - * @property {object} [subnet.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * @property {array} [subnet.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * @property {array} [subnet.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * @property {array} [subnet.networkSecurityGroup.networkInterfaces] A - * collection of references to network interfaces. - * @property {array} [subnet.networkSecurityGroup.subnets] A collection of - * references to subnets. - * @property {string} [subnet.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. - * @property {string} [subnet.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [subnet.networkSecurityGroup.etag] A unique read-only - * string that changes whenever the resource is updated. - * @property {object} [subnet.routeTable] The reference of the RouteTable - * resource. - * @property {array} [subnet.routeTable.routes] Collection of routes - * contained within a route table. - * @property {array} [subnet.routeTable.subnets] A collection of references - * to subnets. - * @property {boolean} [subnet.routeTable.disableBgpRoutePropagation] Gets or - * sets whether to disable the routes learned by BGP on that route table. - * True means disable. - * @property {string} [subnet.routeTable.provisioningState] The provisioning - * state of the resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [subnet.routeTable.etag] Gets a unique read-only string - * that changes whenever the resource is updated. - * @property {array} [subnet.serviceEndpoints] An array of service endpoints. - * @property {array} [subnet.serviceEndpointPolicies] An array of service - * endpoint policies. - * @property {array} [subnet.interfaceEndpoints] An array of references to - * interface endpoints - * @property {array} [subnet.ipConfigurations] Gets an array of references to - * the network interface IP configurations using subnet. - * @property {array} [subnet.ipConfigurationProfiles] Array of IP - * configuration profiles which reference this subnet. - * @property {array} [subnet.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * @property {array} [subnet.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * @property {array} [subnet.delegations] Gets an array of references to the - * delegations on the subnet. - * @property {string} [subnet.purpose] A read-only string identifying the - * intention of use for this subnet based on delegations and other - * user-defined properties. - * @property {string} [subnet.provisioningState] The provisioning state of - * the resource. - * @property {string} [subnet.name] The name of the resource that is unique - * within a resource group. This name can be used to access the resource. - * @property {string} [subnet.etag] A unique read-only string that changes - * whenever the resource is updated. - * @property {object} [publicIPAddress] The reference of the Public IP - * resource. - * @property {object} [publicIPAddress.sku] The public IP address SKU. - * @property {string} [publicIPAddress.sku.name] Name of a public IP address - * SKU. Possible values include: 'Basic', 'Standard' - * @property {string} [publicIPAddress.publicIPAllocationMethod] The public - * IP allocation method. Possible values are: 'Static' and 'Dynamic'. - * Possible values include: 'Static', 'Dynamic' - * @property {string} [publicIPAddress.publicIPAddressVersion] The public IP - * address version. Possible values are: 'IPv4' and 'IPv6'. Possible values - * include: 'IPv4', 'IPv6' - * @property {object} [publicIPAddress.ipConfiguration] The IP configuration - * associated with the public IP address. - * @property {string} [publicIPAddress.ipConfiguration.privateIPAddress] The - * private IP address of the IP configuration. - * @property {string} - * [publicIPAddress.ipConfiguration.privateIPAllocationMethod] The private IP - * allocation method. Possible values are 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' - * @property {object} [publicIPAddress.ipConfiguration.subnet] The reference - * of the subnet resource. - * @property {string} [publicIPAddress.ipConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * @property {array} [publicIPAddress.ipConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * @property {object} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup] The - * reference of the NetworkSecurityGroup resource. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] - * A collection of references to network interfaces. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.subnets] A - * collection of references to subnets. - * @property {string} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * @property {string} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.etag] A - * unique read-only string that changes whenever the resource is updated. - * @property {object} [publicIPAddress.ipConfiguration.subnet.routeTable] The - * reference of the RouteTable resource. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.routeTable.routes] Collection of - * routes contained within a route table. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.routeTable.subnets] A collection - * of references to subnets. - * @property {boolean} - * [publicIPAddress.ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * @property {string} - * [publicIPAddress.ipConfiguration.subnet.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} - * [publicIPAddress.ipConfiguration.subnet.routeTable.etag] Gets a unique - * read-only string that changes whenever the resource is updated. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.serviceEndpoints] An array of - * service endpoints. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.serviceEndpointPolicies] An array - * of service endpoint policies. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.interfaceEndpoints] An array of - * references to interface endpoints - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.ipConfigurations] Gets an array of - * references to the network interface IP configurations using subnet. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.ipConfigurationProfiles] Array of - * IP configuration profiles which reference this subnet. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.resourceNavigationLinks] Gets an - * array of references to the external resources using subnet. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.serviceAssociationLinks] Gets an - * array of references to services injecting into this subnet. - * @property {array} [publicIPAddress.ipConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * @property {string} [publicIPAddress.ipConfiguration.subnet.purpose] A - * read-only string identifying the intention of use for this subnet based on - * delegations and other user-defined properties. - * @property {string} - * [publicIPAddress.ipConfiguration.subnet.provisioningState] The - * provisioning state of the resource. - * @property {string} [publicIPAddress.ipConfiguration.subnet.name] The name - * of the resource that is unique within a resource group. This name can be - * used to access the resource. - * @property {string} [publicIPAddress.ipConfiguration.subnet.etag] A unique - * read-only string that changes whenever the resource is updated. - * @property {object} [publicIPAddress.ipConfiguration.publicIPAddress] The - * reference of the public IP resource. - * @property {string} [publicIPAddress.ipConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [publicIPAddress.ipConfiguration.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * @property {string} [publicIPAddress.ipConfiguration.etag] A unique - * read-only string that changes whenever the resource is updated. - * @property {object} [publicIPAddress.dnsSettings] The FQDN of the DNS - * record associated with the public IP address. - * @property {string} [publicIPAddress.dnsSettings.domainNameLabel] Gets or - * sets the Domain name label.The concatenation of the domain name label and - * the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is - * specified, an A DNS record is created for the public IP in the Microsoft - * Azure DNS system. - * @property {string} [publicIPAddress.dnsSettings.fqdn] Gets the FQDN, Fully - * qualified domain name of the A DNS record associated with the public IP. - * This is the concatenation of the domainNameLabel and the regionalized DNS - * zone. - * @property {string} [publicIPAddress.dnsSettings.reverseFqdn] Gets or Sets - * the Reverse FQDN. A user-visible, fully qualified domain name that - * resolves to this public IP address. If the reverseFqdn is specified, then - * a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * @property {array} [publicIPAddress.ipTags] The list of tags associated - * with the public IP address. - * @property {string} [publicIPAddress.ipAddress] The IP address associated - * with the public IP address resource. - * @property {object} [publicIPAddress.publicIPPrefix] The Public IP Prefix - * this Public IP Address should be allocated from. - * @property {string} [publicIPAddress.publicIPPrefix.id] Resource ID. - * @property {number} [publicIPAddress.idleTimeoutInMinutes] The idle timeout - * of the public IP address. - * @property {string} [publicIPAddress.resourceGuid] The resource GUID - * property of the public IP resource. - * @property {string} [publicIPAddress.provisioningState] The provisioning - * state of the PublicIP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [publicIPAddress.etag] A unique read-only string that - * changes whenever the resource is updated. - * @property {array} [publicIPAddress.zones] A list of availability zones - * denoting the IP allocated for the resource needs to come from. - * @property {object} [publicIPPrefix] The reference of the Public IP Prefix - * resource. - * @property {string} [publicIPPrefix.id] Resource ID. - * @property {string} [provisioningState] Gets the provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [name] The 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. - * @property {array} [zones] A list of availability zones denoting the IP - * allocated for the resource needs to come from. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of FrontendIPConfiguration - * - * @returns {object} metadata of FrontendIPConfiguration - * - */ - mapper() { - return { - required: false, - serializedName: 'FrontendIPConfiguration', - type: { - name: 'Composite', - className: 'FrontendIPConfiguration', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - inboundNatRules: { - required: false, - readOnly: true, - serializedName: 'properties.inboundNatRules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SubResourceElementType', - type: { - name: 'Composite', - className: 'SubResource' - } - } - } - }, - inboundNatPools: { - required: false, - readOnly: true, - serializedName: 'properties.inboundNatPools', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SubResourceElementType', - type: { - name: 'Composite', - className: 'SubResource' - } - } - } - }, - outboundRules: { - required: false, - readOnly: true, - serializedName: 'properties.outboundRules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SubResourceElementType', - type: { - name: 'Composite', - className: 'SubResource' - } - } - } - }, - loadBalancingRules: { - required: false, - readOnly: true, - serializedName: 'properties.loadBalancingRules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SubResourceElementType', - type: { - name: 'Composite', - className: 'SubResource' - } - } - } - }, - privateIPAddress: { - required: false, - serializedName: 'properties.privateIPAddress', - type: { - name: 'String' - } - }, - privateIPAllocationMethod: { - required: false, - serializedName: 'properties.privateIPAllocationMethod', - type: { - name: 'String' - } - }, - subnet: { - required: false, - serializedName: 'properties.subnet', - type: { - name: 'Composite', - className: 'Subnet' - } - }, - publicIPAddress: { - required: false, - serializedName: 'properties.publicIPAddress', - type: { - name: 'Composite', - className: 'PublicIPAddress' - } - }, - publicIPPrefix: { - required: false, - serializedName: 'properties.publicIPPrefix', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - }, - zones: { - required: false, - serializedName: 'zones', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - } - } - } - }; - } -} - -module.exports = FrontendIPConfiguration; diff --git a/lib/services/networkManagement2/lib/models/gatewayRoute.js b/lib/services/networkManagement2/lib/models/gatewayRoute.js deleted file mode 100644 index 129e19d69..000000000 --- a/lib/services/networkManagement2/lib/models/gatewayRoute.js +++ /dev/null @@ -1,107 +0,0 @@ -/* - * 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'; - -/** - * Gateway routing details - * - */ -class GatewayRoute { - /** - * Create a GatewayRoute. - * @property {string} [localAddress] The gateway's local address - * @property {string} [network] The route's network prefix - * @property {string} [nextHop] The route's next hop - * @property {string} [sourcePeer] The peer this route was learned from - * @property {string} [origin] The source this route was learned from - * @property {string} [asPath] The route's AS path sequence - * @property {number} [weight] The route's weight - */ - constructor() { - } - - /** - * Defines the metadata of GatewayRoute - * - * @returns {object} metadata of GatewayRoute - * - */ - mapper() { - return { - required: false, - serializedName: 'GatewayRoute', - type: { - name: 'Composite', - className: 'GatewayRoute', - modelProperties: { - localAddress: { - required: false, - readOnly: true, - serializedName: 'localAddress', - type: { - name: 'String' - } - }, - network: { - required: false, - readOnly: true, - serializedName: 'network', - type: { - name: 'String' - } - }, - nextHop: { - required: false, - readOnly: true, - serializedName: 'nextHop', - type: { - name: 'String' - } - }, - sourcePeer: { - required: false, - readOnly: true, - serializedName: 'sourcePeer', - type: { - name: 'String' - } - }, - origin: { - required: false, - readOnly: true, - serializedName: 'origin', - type: { - name: 'String' - } - }, - asPath: { - required: false, - readOnly: true, - serializedName: 'asPath', - type: { - name: 'String' - } - }, - weight: { - required: false, - readOnly: true, - serializedName: 'weight', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = GatewayRoute; diff --git a/lib/services/networkManagement2/lib/models/gatewayRouteListResult.js b/lib/services/networkManagement2/lib/models/gatewayRouteListResult.js deleted file mode 100644 index 4dbc77982..000000000 --- a/lib/services/networkManagement2/lib/models/gatewayRouteListResult.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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'; - -/** - * List of virtual network gateway routes - * - */ -class GatewayRouteListResult { - /** - * Create a GatewayRouteListResult. - * @property {array} [value] List of gateway routes - */ - constructor() { - } - - /** - * Defines the metadata of GatewayRouteListResult - * - * @returns {object} metadata of GatewayRouteListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'GatewayRouteListResult', - type: { - name: 'Composite', - className: 'GatewayRouteListResult', - modelProperties: { - value: { - required: false, - serializedName: 'value', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'GatewayRouteElementType', - type: { - name: 'Composite', - className: 'GatewayRoute' - } - } - } - } - } - } - }; - } -} - -module.exports = GatewayRouteListResult; diff --git a/lib/services/networkManagement2/lib/models/getVpnSitesConfigurationRequest.js b/lib/services/networkManagement2/lib/models/getVpnSitesConfigurationRequest.js deleted file mode 100644 index 26d9b8323..000000000 --- a/lib/services/networkManagement2/lib/models/getVpnSitesConfigurationRequest.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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'; - -/** - * List of Vpn-Sites - * - */ -class GetVpnSitesConfigurationRequest { - /** - * Create a GetVpnSitesConfigurationRequest. - * @property {array} [vpnSites] List of resource-ids of the vpn-sites for - * which config is to be downloaded. - * @property {string} [outputBlobSasUrl] The sas-url to download the - * configurations for vpn-sites - */ - constructor() { - } - - /** - * Defines the metadata of GetVpnSitesConfigurationRequest - * - * @returns {object} metadata of GetVpnSitesConfigurationRequest - * - */ - mapper() { - return { - required: false, - serializedName: 'GetVpnSitesConfigurationRequest', - type: { - name: 'Composite', - className: 'GetVpnSitesConfigurationRequest', - modelProperties: { - vpnSites: { - required: false, - serializedName: 'vpnSites', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - outputBlobSasUrl: { - required: false, - serializedName: 'outputBlobSasUrl', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = GetVpnSitesConfigurationRequest; diff --git a/lib/services/networkManagement2/lib/models/hTTPConfiguration.js b/lib/services/networkManagement2/lib/models/hTTPConfiguration.js deleted file mode 100644 index cca495db7..000000000 --- a/lib/services/networkManagement2/lib/models/hTTPConfiguration.js +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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'; - -/** - * HTTP configuration of the connectivity check. - * - */ -class HTTPConfiguration { - /** - * Create a HTTPConfiguration. - * @property {string} [method] HTTP method. Possible values include: 'Get' - * @property {array} [headers] List of HTTP headers. - * @property {array} [validStatusCodes] Valid status codes. - */ - constructor() { - } - - /** - * Defines the metadata of HTTPConfiguration - * - * @returns {object} metadata of HTTPConfiguration - * - */ - mapper() { - return { - required: false, - serializedName: 'HTTPConfiguration', - type: { - name: 'Composite', - className: 'HTTPConfiguration', - modelProperties: { - method: { - required: false, - serializedName: 'method', - type: { - name: 'String' - } - }, - headers: { - required: false, - serializedName: 'headers', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'HTTPHeaderElementType', - type: { - name: 'Composite', - className: 'HTTPHeader' - } - } - } - }, - validStatusCodes: { - required: false, - serializedName: 'validStatusCodes', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'NumberElementType', - type: { - name: 'Number' - } - } - } - } - } - } - }; - } -} - -module.exports = HTTPConfiguration; diff --git a/lib/services/networkManagement2/lib/models/hTTPHeader.js b/lib/services/networkManagement2/lib/models/hTTPHeader.js deleted file mode 100644 index 82feacb93..000000000 --- a/lib/services/networkManagement2/lib/models/hTTPHeader.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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'; - -/** - * Describes the HTTP header. - * - */ -class HTTPHeader { - /** - * Create a HTTPHeader. - * @property {string} [name] The name in HTTP header. - * @property {string} [value] The value in HTTP header. - */ - constructor() { - } - - /** - * Defines the metadata of HTTPHeader - * - * @returns {object} metadata of HTTPHeader - * - */ - mapper() { - return { - required: false, - serializedName: 'HTTPHeader', - type: { - name: 'Composite', - className: 'HTTPHeader', - modelProperties: { - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - value: { - required: false, - serializedName: 'value', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = HTTPHeader; diff --git a/lib/services/networkManagement2/lib/models/httpConfiguration.js b/lib/services/networkManagement2/lib/models/httpConfiguration.js deleted file mode 100644 index 1cf98671a..000000000 --- a/lib/services/networkManagement2/lib/models/httpConfiguration.js +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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'; - -/** - * HTTP configuration of the connectivity check. - * - */ -class HTTPConfiguration { - /** - * Create a HTTPConfiguration. - * @member {string} [method] HTTP method. Possible values include: 'Get' - * @member {array} [headers] List of HTTP headers. - * @member {array} [validStatusCodes] Valid status codes. - */ - constructor() { - } - - /** - * Defines the metadata of HTTPConfiguration - * - * @returns {object} metadata of HTTPConfiguration - * - */ - mapper() { - return { - required: false, - serializedName: 'HTTPConfiguration', - type: { - name: 'Composite', - className: 'HTTPConfiguration', - modelProperties: { - method: { - required: false, - serializedName: 'method', - type: { - name: 'String' - } - }, - headers: { - required: false, - serializedName: 'headers', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'HTTPHeaderElementType', - type: { - name: 'Composite', - className: 'HTTPHeader' - } - } - } - }, - validStatusCodes: { - required: false, - serializedName: 'validStatusCodes', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'NumberElementType', - type: { - name: 'Number' - } - } - } - } - } - } - }; - } -} - -module.exports = HTTPConfiguration; diff --git a/lib/services/networkManagement2/lib/models/hubVirtualNetworkConnection.js b/lib/services/networkManagement2/lib/models/hubVirtualNetworkConnection.js deleted file mode 100644 index 15bca23eb..000000000 --- a/lib/services/networkManagement2/lib/models/hubVirtualNetworkConnection.js +++ /dev/null @@ -1,121 +0,0 @@ -/* - * 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'); - -/** - * HubVirtualNetworkConnection Resource. - * - * @extends models['SubResource'] - */ -class HubVirtualNetworkConnection extends models['SubResource'] { - /** - * Create a HubVirtualNetworkConnection. - * @property {object} [remoteVirtualNetwork] Reference to the remote virtual - * network. - * @property {string} [remoteVirtualNetwork.id] Resource ID. - * @property {boolean} [allowHubToRemoteVnetTransit] VirtualHub to RemoteVnet - * transit to enabled or not. - * @property {boolean} [allowRemoteVnetToUseHubVnetGateways] Allow RemoteVnet - * to use Virtual Hub's gateways. - * @property {boolean} [enableInternetSecurity] Enable internet security - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * @property {string} [name] The name of the resource that is unique within a - * resource group. This name can be used to access the resource. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of HubVirtualNetworkConnection - * - * @returns {object} metadata of HubVirtualNetworkConnection - * - */ - mapper() { - return { - required: false, - serializedName: 'HubVirtualNetworkConnection', - type: { - name: 'Composite', - className: 'HubVirtualNetworkConnection', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - remoteVirtualNetwork: { - required: false, - serializedName: 'properties.remoteVirtualNetwork', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - allowHubToRemoteVnetTransit: { - required: false, - serializedName: 'properties.allowHubToRemoteVnetTransit', - type: { - name: 'Boolean' - } - }, - allowRemoteVnetToUseHubVnetGateways: { - required: false, - serializedName: 'properties.allowRemoteVnetToUseHubVnetGateways', - type: { - name: 'Boolean' - } - }, - enableInternetSecurity: { - required: false, - serializedName: 'properties.enableInternetSecurity', - type: { - name: 'Boolean' - } - }, - provisioningState: { - required: false, - 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 = HubVirtualNetworkConnection; diff --git a/lib/services/networkManagement2/lib/models/iPAddressAvailabilityResult.js b/lib/services/networkManagement2/lib/models/iPAddressAvailabilityResult.js deleted file mode 100644 index c5df5c58a..000000000 --- a/lib/services/networkManagement2/lib/models/iPAddressAvailabilityResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 CheckIPAddressAvailability API service call - * - */ -class IPAddressAvailabilityResult { - /** - * Create a IPAddressAvailabilityResult. - * @property {boolean} [available] Private IP address availability. - * @property {array} [availableIPAddresses] Contains other available private - * IP addresses if the asked for address is taken. - */ - constructor() { - } - - /** - * Defines the metadata of IPAddressAvailabilityResult - * - * @returns {object} metadata of IPAddressAvailabilityResult - * - */ - mapper() { - return { - required: false, - serializedName: 'IPAddressAvailabilityResult', - type: { - name: 'Composite', - className: 'IPAddressAvailabilityResult', - modelProperties: { - available: { - required: false, - serializedName: 'available', - type: { - name: 'Boolean' - } - }, - availableIPAddresses: { - required: false, - serializedName: 'availableIPAddresses', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - } - } - } - }; - } -} - -module.exports = IPAddressAvailabilityResult; diff --git a/lib/services/networkManagement2/lib/models/iPConfiguration.js b/lib/services/networkManagement2/lib/models/iPConfiguration.js deleted file mode 100644 index 8fb1f9cc9..000000000 --- a/lib/services/networkManagement2/lib/models/iPConfiguration.js +++ /dev/null @@ -1,226 +0,0 @@ -/* - * 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'); - -/** - * IP configuration - * - * @extends models['SubResource'] - */ -class IPConfiguration extends models['SubResource'] { - /** - * Create a IPConfiguration. - * @property {string} [privateIPAddress] The private IP address of the IP - * configuration. - * @property {string} [privateIPAllocationMethod] The private IP allocation - * method. Possible values are 'Static' and 'Dynamic'. Possible values - * include: 'Static', 'Dynamic' - * @property {object} [subnet] The reference of the subnet resource. - * @property {string} [subnet.addressPrefix] The address prefix for the - * subnet. - * @property {array} [subnet.addressPrefixes] List of address prefixes for - * the subnet. - * @property {object} [subnet.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * @property {array} [subnet.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * @property {array} [subnet.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * @property {array} [subnet.networkSecurityGroup.networkInterfaces] A - * collection of references to network interfaces. - * @property {array} [subnet.networkSecurityGroup.subnets] A collection of - * references to subnets. - * @property {string} [subnet.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. - * @property {string} [subnet.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [subnet.networkSecurityGroup.etag] A unique read-only - * string that changes whenever the resource is updated. - * @property {object} [subnet.routeTable] The reference of the RouteTable - * resource. - * @property {array} [subnet.routeTable.routes] Collection of routes - * contained within a route table. - * @property {array} [subnet.routeTable.subnets] A collection of references - * to subnets. - * @property {boolean} [subnet.routeTable.disableBgpRoutePropagation] Gets or - * sets whether to disable the routes learned by BGP on that route table. - * True means disable. - * @property {string} [subnet.routeTable.provisioningState] The provisioning - * state of the resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [subnet.routeTable.etag] Gets a unique read-only string - * that changes whenever the resource is updated. - * @property {array} [subnet.serviceEndpoints] An array of service endpoints. - * @property {array} [subnet.serviceEndpointPolicies] An array of service - * endpoint policies. - * @property {array} [subnet.interfaceEndpoints] An array of references to - * interface endpoints - * @property {array} [subnet.ipConfigurations] Gets an array of references to - * the network interface IP configurations using subnet. - * @property {array} [subnet.ipConfigurationProfiles] Array of IP - * configuration profiles which reference this subnet. - * @property {array} [subnet.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * @property {array} [subnet.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * @property {array} [subnet.delegations] Gets an array of references to the - * delegations on the subnet. - * @property {string} [subnet.purpose] A read-only string identifying the - * intention of use for this subnet based on delegations and other - * user-defined properties. - * @property {string} [subnet.provisioningState] The provisioning state of - * the resource. - * @property {string} [subnet.name] The name of the resource that is unique - * within a resource group. This name can be used to access the resource. - * @property {string} [subnet.etag] A unique read-only string that changes - * whenever the resource is updated. - * @property {object} [publicIPAddress] The reference of the public IP - * resource. - * @property {object} [publicIPAddress.sku] The public IP address SKU. - * @property {string} [publicIPAddress.sku.name] Name of a public IP address - * SKU. Possible values include: 'Basic', 'Standard' - * @property {string} [publicIPAddress.publicIPAllocationMethod] The public - * IP allocation method. Possible values are: 'Static' and 'Dynamic'. - * Possible values include: 'Static', 'Dynamic' - * @property {string} [publicIPAddress.publicIPAddressVersion] The public IP - * address version. Possible values are: 'IPv4' and 'IPv6'. Possible values - * include: 'IPv4', 'IPv6' - * @property {object} [publicIPAddress.ipConfiguration] The IP configuration - * associated with the public IP address. - * @property {object} [publicIPAddress.dnsSettings] The FQDN of the DNS - * record associated with the public IP address. - * @property {string} [publicIPAddress.dnsSettings.domainNameLabel] Gets or - * sets the Domain name label.The concatenation of the domain name label and - * the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is - * specified, an A DNS record is created for the public IP in the Microsoft - * Azure DNS system. - * @property {string} [publicIPAddress.dnsSettings.fqdn] Gets the FQDN, Fully - * qualified domain name of the A DNS record associated with the public IP. - * This is the concatenation of the domainNameLabel and the regionalized DNS - * zone. - * @property {string} [publicIPAddress.dnsSettings.reverseFqdn] Gets or Sets - * the Reverse FQDN. A user-visible, fully qualified domain name that - * resolves to this public IP address. If the reverseFqdn is specified, then - * a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * @property {array} [publicIPAddress.ipTags] The list of tags associated - * with the public IP address. - * @property {string} [publicIPAddress.ipAddress] The IP address associated - * with the public IP address resource. - * @property {object} [publicIPAddress.publicIPPrefix] The Public IP Prefix - * this Public IP Address should be allocated from. - * @property {string} [publicIPAddress.publicIPPrefix.id] Resource ID. - * @property {number} [publicIPAddress.idleTimeoutInMinutes] The idle timeout - * of the public IP address. - * @property {string} [publicIPAddress.resourceGuid] The resource GUID - * property of the public IP resource. - * @property {string} [publicIPAddress.provisioningState] The provisioning - * state of the PublicIP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [publicIPAddress.etag] A unique read-only string that - * changes whenever the resource is updated. - * @property {array} [publicIPAddress.zones] A list of availability zones - * denoting the IP allocated for the resource needs to come from. - * @property {string} [provisioningState] Gets the provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [name] The 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 IPConfiguration - * - * @returns {object} metadata of IPConfiguration - * - */ - mapper() { - return { - required: false, - serializedName: 'IPConfiguration', - type: { - name: 'Composite', - className: 'IPConfiguration', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - privateIPAddress: { - required: false, - serializedName: 'properties.privateIPAddress', - type: { - name: 'String' - } - }, - privateIPAllocationMethod: { - required: false, - serializedName: 'properties.privateIPAllocationMethod', - type: { - name: 'String' - } - }, - subnet: { - required: false, - serializedName: 'properties.subnet', - type: { - name: 'Composite', - className: 'Subnet' - } - }, - publicIPAddress: { - required: false, - serializedName: 'properties.publicIPAddress', - type: { - name: 'Composite', - className: 'PublicIPAddress' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = IPConfiguration; diff --git a/lib/services/networkManagement2/lib/models/iPConfigurationProfile.js b/lib/services/networkManagement2/lib/models/iPConfigurationProfile.js deleted file mode 100644 index 8099172bb..000000000 --- a/lib/services/networkManagement2/lib/models/iPConfigurationProfile.js +++ /dev/null @@ -1,161 +0,0 @@ -/* - * 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'); - -/** - * IP configuration profile child resource. - * - * @extends models['SubResource'] - */ -class IPConfigurationProfile extends models['SubResource'] { - /** - * Create a IPConfigurationProfile. - * @property {object} [subnet] The reference of the subnet resource to create - * a contatainer network interface ip configruation. - * @property {string} [subnet.addressPrefix] The address prefix for the - * subnet. - * @property {array} [subnet.addressPrefixes] List of address prefixes for - * the subnet. - * @property {object} [subnet.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * @property {array} [subnet.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * @property {array} [subnet.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * @property {array} [subnet.networkSecurityGroup.networkInterfaces] A - * collection of references to network interfaces. - * @property {array} [subnet.networkSecurityGroup.subnets] A collection of - * references to subnets. - * @property {string} [subnet.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. - * @property {string} [subnet.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [subnet.networkSecurityGroup.etag] A unique read-only - * string that changes whenever the resource is updated. - * @property {object} [subnet.routeTable] The reference of the RouteTable - * resource. - * @property {array} [subnet.routeTable.routes] Collection of routes - * contained within a route table. - * @property {array} [subnet.routeTable.subnets] A collection of references - * to subnets. - * @property {boolean} [subnet.routeTable.disableBgpRoutePropagation] Gets or - * sets whether to disable the routes learned by BGP on that route table. - * True means disable. - * @property {string} [subnet.routeTable.provisioningState] The provisioning - * state of the resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [subnet.routeTable.etag] Gets a unique read-only string - * that changes whenever the resource is updated. - * @property {array} [subnet.serviceEndpoints] An array of service endpoints. - * @property {array} [subnet.serviceEndpointPolicies] An array of service - * endpoint policies. - * @property {array} [subnet.interfaceEndpoints] An array of references to - * interface endpoints - * @property {array} [subnet.ipConfigurations] Gets an array of references to - * the network interface IP configurations using subnet. - * @property {array} [subnet.ipConfigurationProfiles] Array of IP - * configuration profiles which reference this subnet. - * @property {array} [subnet.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * @property {array} [subnet.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * @property {array} [subnet.delegations] Gets an array of references to the - * delegations on the subnet. - * @property {string} [subnet.purpose] A read-only string identifying the - * intention of use for this subnet based on delegations and other - * user-defined properties. - * @property {string} [subnet.provisioningState] The provisioning state of - * the resource. - * @property {string} [subnet.name] The name of the resource that is unique - * within a resource group. This name can be used to access the resource. - * @property {string} [subnet.etag] A unique read-only string that changes - * whenever the resource is updated. - * @property {string} [provisioningState] The provisioning state of the - * resource. - * @property {string} [name] The name of the resource. This name can be used - * to access the resource. - * @property {string} [type] Sub Resource type. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of IPConfigurationProfile - * - * @returns {object} metadata of IPConfigurationProfile - * - */ - mapper() { - return { - required: false, - serializedName: 'IPConfigurationProfile', - type: { - name: 'Composite', - className: 'IPConfigurationProfile', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - subnet: { - required: false, - serializedName: 'properties.subnet', - type: { - name: 'Composite', - className: 'Subnet' - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = IPConfigurationProfile; diff --git a/lib/services/networkManagement2/lib/models/inboundNatPool.js b/lib/services/networkManagement2/lib/models/inboundNatPool.js deleted file mode 100644 index 230aa8e08..000000000 --- a/lib/services/networkManagement2/lib/models/inboundNatPool.js +++ /dev/null @@ -1,166 +0,0 @@ -/* - * 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'); - -/** - * Inbound NAT pool of the load balancer. - * - * @extends models['SubResource'] - */ -class InboundNatPool extends models['SubResource'] { - /** - * Create a InboundNatPool. - * @property {object} [frontendIPConfiguration] A reference to frontend IP - * addresses. - * @property {string} [frontendIPConfiguration.id] Resource ID. - * @property {string} protocol Possible values include: 'Udp', 'Tcp', 'All' - * @property {number} frontendPortRangeStart The first port number in the - * range of external ports that will be used to provide Inbound Nat to NICs - * associated with a load balancer. Acceptable values range between 1 and - * 65534. - * @property {number} frontendPortRangeEnd The last port number in the range - * of external ports that will be used to provide Inbound Nat to NICs - * associated with a load balancer. Acceptable values range between 1 and - * 65535. - * @property {number} backendPort The port used for internal connections on - * the endpoint. Acceptable values are between 1 and 65535. - * @property {number} [idleTimeoutInMinutes] The timeout for the TCP idle - * connection. The value can be set between 4 and 30 minutes. The default - * value is 4 minutes. This element is only used when the protocol is set to - * TCP. - * @property {boolean} [enableFloatingIP] Configures a virtual machine's - * endpoint for the floating IP capability required to configure a SQL - * AlwaysOn Availability Group. This setting is required when using the SQL - * AlwaysOn Availability Groups in SQL server. This setting can't be changed - * after you create the endpoint. - * @property {boolean} [enableTcpReset] Receive bidirectional TCP Reset on - * TCP flow idle timeout or unexpected connection termination. This element - * is only used when the protocol is set to TCP. - * @property {string} [provisioningState] Gets the provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [name] The 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 InboundNatPool - * - * @returns {object} metadata of InboundNatPool - * - */ - mapper() { - return { - required: false, - serializedName: 'InboundNatPool', - type: { - name: 'Composite', - className: 'InboundNatPool', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - frontendIPConfiguration: { - required: false, - serializedName: 'properties.frontendIPConfiguration', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - protocol: { - required: true, - serializedName: 'properties.protocol', - type: { - name: 'String' - } - }, - frontendPortRangeStart: { - required: true, - serializedName: 'properties.frontendPortRangeStart', - type: { - name: 'Number' - } - }, - frontendPortRangeEnd: { - required: true, - serializedName: 'properties.frontendPortRangeEnd', - type: { - name: 'Number' - } - }, - backendPort: { - required: true, - serializedName: 'properties.backendPort', - type: { - name: 'Number' - } - }, - idleTimeoutInMinutes: { - required: false, - serializedName: 'properties.idleTimeoutInMinutes', - type: { - name: 'Number' - } - }, - enableFloatingIP: { - required: false, - serializedName: 'properties.enableFloatingIP', - type: { - name: 'Boolean' - } - }, - enableTcpReset: { - required: false, - serializedName: 'properties.enableTcpReset', - type: { - name: 'Boolean' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = InboundNatPool; diff --git a/lib/services/networkManagement2/lib/models/inboundNatRule.js b/lib/services/networkManagement2/lib/models/inboundNatRule.js deleted file mode 100644 index 691ac8bea..000000000 --- a/lib/services/networkManagement2/lib/models/inboundNatRule.js +++ /dev/null @@ -1,445 +0,0 @@ -/* - * 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'); - -/** - * Inbound NAT rule of the load balancer. - * - * @extends models['SubResource'] - */ -class InboundNatRule extends models['SubResource'] { - /** - * Create a InboundNatRule. - * @property {object} [frontendIPConfiguration] A reference to frontend IP - * addresses. - * @property {string} [frontendIPConfiguration.id] Resource ID. - * @property {object} [backendIPConfiguration] A reference to a private IP - * address defined on a network interface of a VM. Traffic sent to the - * frontend port of each of the frontend IP configurations is forwarded to - * the backend IP. - * @property {array} [backendIPConfiguration.virtualNetworkTaps] The - * reference to Virtual Network Taps. - * @property {array} - * [backendIPConfiguration.applicationGatewayBackendAddressPools] The - * reference of ApplicationGatewayBackendAddressPool resource. - * @property {array} [backendIPConfiguration.loadBalancerBackendAddressPools] - * The reference of LoadBalancerBackendAddressPool resource. - * @property {array} [backendIPConfiguration.loadBalancerInboundNatRules] A - * list of references of LoadBalancerInboundNatRules. - * @property {string} [backendIPConfiguration.privateIPAddress] Private IP - * address of the IP configuration. - * @property {string} [backendIPConfiguration.privateIPAllocationMethod] - * Defines how a private IP address is assigned. Possible values are: - * 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {string} [backendIPConfiguration.privateIPAddressVersion] - * Available from Api-Version 2016-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * @property {object} [backendIPConfiguration.subnet] Subnet bound to the IP - * configuration. - * @property {string} [backendIPConfiguration.subnet.addressPrefix] The - * address prefix for the subnet. - * @property {array} [backendIPConfiguration.subnet.addressPrefixes] List of - * address prefixes for the subnet. - * @property {object} [backendIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * @property {array} - * [backendIPConfiguration.subnet.networkSecurityGroup.securityRules] A - * collection of security rules of the network security group. - * @property {array} - * [backendIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * @property {array} - * [backendIPConfiguration.subnet.networkSecurityGroup.networkInterfaces] A - * collection of references to network interfaces. - * @property {array} - * [backendIPConfiguration.subnet.networkSecurityGroup.subnets] A collection - * of references to subnets. - * @property {string} - * [backendIPConfiguration.subnet.networkSecurityGroup.resourceGuid] The - * resource GUID property of the network security group resource. - * @property {string} - * [backendIPConfiguration.subnet.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [backendIPConfiguration.subnet.networkSecurityGroup.etag] A unique - * read-only string that changes whenever the resource is updated. - * @property {object} [backendIPConfiguration.subnet.routeTable] The - * reference of the RouteTable resource. - * @property {array} [backendIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * @property {array} [backendIPConfiguration.subnet.routeTable.subnets] A - * collection of references to subnets. - * @property {boolean} - * [backendIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] Gets - * or sets whether to disable the routes learned by BGP on that route table. - * True means disable. - * @property {string} - * [backendIPConfiguration.subnet.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [backendIPConfiguration.subnet.routeTable.etag] Gets a - * unique read-only string that changes whenever the resource is updated. - * @property {array} [backendIPConfiguration.subnet.serviceEndpoints] An - * array of service endpoints. - * @property {array} [backendIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * @property {array} [backendIPConfiguration.subnet.interfaceEndpoints] An - * array of references to interface endpoints - * @property {array} [backendIPConfiguration.subnet.ipConfigurations] Gets an - * array of references to the network interface IP configurations using - * subnet. - * @property {array} [backendIPConfiguration.subnet.ipConfigurationProfiles] - * Array of IP configuration profiles which reference this subnet. - * @property {array} [backendIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * @property {array} [backendIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * @property {array} [backendIPConfiguration.subnet.delegations] Gets an - * array of references to the delegations on the subnet. - * @property {string} [backendIPConfiguration.subnet.purpose] A read-only - * string identifying the intention of use for this subnet based on - * delegations and other user-defined properties. - * @property {string} [backendIPConfiguration.subnet.provisioningState] The - * provisioning state of the resource. - * @property {string} [backendIPConfiguration.subnet.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * @property {string} [backendIPConfiguration.subnet.etag] A unique read-only - * string that changes whenever the resource is updated. - * @property {boolean} [backendIPConfiguration.primary] Gets whether this is - * a primary customer address on the network interface. - * @property {object} [backendIPConfiguration.publicIPAddress] Public IP - * address bound to the IP configuration. - * @property {object} [backendIPConfiguration.publicIPAddress.sku] The public - * IP address SKU. - * @property {string} [backendIPConfiguration.publicIPAddress.sku.name] Name - * of a public IP address SKU. Possible values include: 'Basic', 'Standard' - * @property {string} - * [backendIPConfiguration.publicIPAddress.publicIPAllocationMethod] The - * public IP allocation method. Possible values are: 'Static' and 'Dynamic'. - * Possible values include: 'Static', 'Dynamic' - * @property {string} - * [backendIPConfiguration.publicIPAddress.publicIPAddressVersion] The public - * IP address version. Possible values are: 'IPv4' and 'IPv6'. Possible - * values include: 'IPv4', 'IPv6' - * @property {object} - * [backendIPConfiguration.publicIPAddress.ipConfiguration] The IP - * configuration associated with the public IP address. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.privateIPAllocationMethod] - * The private IP allocation method. Possible values are 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {object} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet] The - * reference of the subnet resource. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * @property {object} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] - * A collection of references to network interfaces. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.subnets] - * A collection of references to subnets. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.subnets] - * A collection of references to subnets. - * @property {boolean} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.interfaceEndpoints] - * An array of references to interface endpoints - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurations] - * Gets an array of references to the network interface IP configurations - * using subnet. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurationProfiles] - * Array of IP configuration profiles which reference this subnet. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.purpose] A - * read-only string identifying the intention of use for this subnet based on - * delegations and other user-defined properties. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.name] The - * name of the resource that is unique within a resource group. This name can - * be used to access the resource. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.etag] A - * unique read-only string that changes whenever the resource is updated. - * @property {object} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.publicIPAddress] - * The reference of the public IP resource. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.name] The name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.etag] A unique - * read-only string that changes whenever the resource is updated. - * @property {object} [backendIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * @property {string} - * [backendIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] Gets - * or sets the Domain name label.The concatenation of the domain name label - * and the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is - * specified, an A DNS record is created for the public IP in the Microsoft - * Azure DNS system. - * @property {string} - * [backendIPConfiguration.publicIPAddress.dnsSettings.fqdn] Gets the FQDN, - * Fully qualified domain name of the A DNS record associated with the public - * IP. This is the concatenation of the domainNameLabel and the regionalized - * DNS zone. - * @property {string} - * [backendIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] Gets or - * Sets the Reverse FQDN. A user-visible, fully qualified domain name that - * resolves to this public IP address. If the reverseFqdn is specified, then - * a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * @property {array} [backendIPConfiguration.publicIPAddress.ipTags] The list - * of tags associated with the public IP address. - * @property {string} [backendIPConfiguration.publicIPAddress.ipAddress] The - * IP address associated with the public IP address resource. - * @property {object} [backendIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * @property {string} - * [backendIPConfiguration.publicIPAddress.publicIPPrefix.id] Resource ID. - * @property {number} - * [backendIPConfiguration.publicIPAddress.idleTimeoutInMinutes] The idle - * timeout of the public IP address. - * @property {string} [backendIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * @property {string} - * [backendIPConfiguration.publicIPAddress.provisioningState] The - * provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [backendIPConfiguration.publicIPAddress.etag] A unique - * read-only string that changes whenever the resource is updated. - * @property {array} [backendIPConfiguration.publicIPAddress.zones] A list of - * availability zones denoting the IP allocated for the resource needs to - * come from. - * @property {array} [backendIPConfiguration.applicationSecurityGroups] - * Application security groups in which the IP configuration is included. - * @property {string} [backendIPConfiguration.provisioningState] The - * provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [backendIPConfiguration.name] The name of the resource - * that is unique within a resource group. This name can be used to access - * the resource. - * @property {string} [backendIPConfiguration.etag] A unique read-only string - * that changes whenever the resource is updated. - * @property {string} [protocol] Possible values include: 'Udp', 'Tcp', 'All' - * @property {number} [frontendPort] The port for the external endpoint. Port - * numbers for each rule must be unique within the Load Balancer. Acceptable - * values range from 1 to 65534. - * @property {number} [backendPort] The port used for the internal endpoint. - * Acceptable values range from 1 to 65535. - * @property {number} [idleTimeoutInMinutes] The timeout for the TCP idle - * connection. The value can be set between 4 and 30 minutes. The default - * value is 4 minutes. This element is only used when the protocol is set to - * TCP. - * @property {boolean} [enableFloatingIP] Configures a virtual machine's - * endpoint for the floating IP capability required to configure a SQL - * AlwaysOn Availability Group. This setting is required when using the SQL - * AlwaysOn Availability Groups in SQL server. This setting can't be changed - * after you create the endpoint. - * @property {boolean} [enableTcpReset] Receive bidirectional TCP Reset on - * TCP flow idle timeout or unexpected connection termination. This element - * is only used when the protocol is set to TCP. - * @property {string} [provisioningState] Gets the provisioning state of the - * public IP resource. Possible values are: '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 InboundNatRule - * - * @returns {object} metadata of InboundNatRule - * - */ - mapper() { - return { - required: false, - serializedName: 'InboundNatRule', - type: { - name: 'Composite', - className: 'InboundNatRule', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - frontendIPConfiguration: { - required: false, - serializedName: 'properties.frontendIPConfiguration', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - backendIPConfiguration: { - required: false, - readOnly: true, - serializedName: 'properties.backendIPConfiguration', - type: { - name: 'Composite', - className: 'NetworkInterfaceIPConfiguration' - } - }, - protocol: { - required: false, - serializedName: 'properties.protocol', - type: { - name: 'String' - } - }, - frontendPort: { - required: false, - serializedName: 'properties.frontendPort', - type: { - name: 'Number' - } - }, - backendPort: { - required: false, - serializedName: 'properties.backendPort', - type: { - name: 'Number' - } - }, - idleTimeoutInMinutes: { - required: false, - serializedName: 'properties.idleTimeoutInMinutes', - type: { - name: 'Number' - } - }, - enableFloatingIP: { - required: false, - serializedName: 'properties.enableFloatingIP', - type: { - name: 'Boolean' - } - }, - enableTcpReset: { - required: false, - serializedName: 'properties.enableTcpReset', - type: { - name: 'Boolean' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = InboundNatRule; diff --git a/lib/services/networkManagement2/lib/models/inboundNatRuleListResult.js b/lib/services/networkManagement2/lib/models/inboundNatRuleListResult.js deleted file mode 100644 index 89492f3a0..000000000 --- a/lib/services/networkManagement2/lib/models/inboundNatRuleListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 ListInboundNatRule API service call. - */ -class InboundNatRuleListResult extends Array { - /** - * Create a InboundNatRuleListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of InboundNatRuleListResult - * - * @returns {object} metadata of InboundNatRuleListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'InboundNatRuleListResult', - type: { - name: 'Composite', - className: 'InboundNatRuleListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'InboundNatRuleElementType', - type: { - name: 'Composite', - className: 'InboundNatRule' - } - } - } - }, - nextLink: { - required: false, - readOnly: true, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = InboundNatRuleListResult; diff --git a/lib/services/networkManagement2/lib/models/index.d.ts b/lib/services/networkManagement2/lib/models/index.d.ts deleted file mode 100644 index 2ab52865a..000000000 --- a/lib/services/networkManagement2/lib/models/index.d.ts +++ /dev/null @@ -1,11150 +0,0 @@ -/* - * 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 } from 'ms-rest-azure'; -import { CloudError } from 'ms-rest-azure'; -import * as moment from 'moment'; - -export { BaseResource } from 'ms-rest-azure'; -export { CloudError } from 'ms-rest-azure'; - - -/** - * @class - * Initializes a new instance of the SubResource class. - * @constructor - * Reference to another subresource. - * - * @property {string} [id] Resource ID. - */ -export interface SubResource extends BaseResource { - id?: string; -} - -/** - * @class - * Initializes a new instance of the NetworkInterfaceTapConfiguration class. - * @constructor - * Tap configuration in a Network Interface - * - * @property {object} [virtualNetworkTap] The reference of the Virtual Network - * Tap resource. - * @property {array} [virtualNetworkTap.networkInterfaceTapConfigurations] - * Specifies the list of resource IDs for the network interface IP - * configuration that needs to be tapped. - * @property {string} [virtualNetworkTap.resourceGuid] The resourceGuid - * property of the virtual network tap. - * @property {string} [virtualNetworkTap.provisioningState] The provisioning - * state of the virtual network tap. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {object} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration] The reference - * to the private IP Address of the collector nic that will receive the tap - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.virtualNetworkTaps] - * The reference to Virtual Network Taps. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.applicationGatewayBackendAddressPools] - * The reference of ApplicationGatewayBackendAddressPool resource. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.loadBalancerBackendAddressPools] - * The reference of LoadBalancerBackendAddressPool resource. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.loadBalancerInboundNatRules] - * A list of references of LoadBalancerInboundNatRules. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAddress] - * Private IP address of the IP configuration. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAllocationMethod] - * Defines how a private IP address is assigned. Possible values are: 'Static' - * and 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAddressVersion] - * Available from Api-Version 2016-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * @property {object} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet] Subnet - * bound to the IP configuration. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * @property {object} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.networkInterfaces] - * A collection of references to network interfaces. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.subnets] - * A collection of references to subnets. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.routeTable.subnets] - * A collection of references to subnets. - * @property {boolean} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.interfaceEndpoints] - * An array of references to interface endpoints - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.ipConfigurations] - * Gets an array of references to the network interface IP configurations using - * subnet. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.ipConfigurationProfiles] - * Array of IP configuration profiles which reference this subnet. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.purpose] - * A read-only string identifying the intention of use for this subnet based on - * delegations and other user-defined properties. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.etag] A - * unique read-only string that changes whenever the resource is updated. - * @property {boolean} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.primary] Gets - * whether this is a primary customer address on the network interface. - * @property {object} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress] - * Public IP address bound to the IP configuration. - * @property {object} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.sku] - * The public IP address SKU. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.sku.name] - * Name of a public IP address SKU. Possible values include: 'Basic', - * 'Standard' - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * @property {object} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration] - * The IP configuration associated with the public IP address. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.privateIPAllocationMethod] - * The private IP allocation method. Possible values are 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {object} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet] - * The reference of the subnet resource. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * @property {object} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] - * A collection of references to network interfaces. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.subnets] - * A collection of references to subnets. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.subnets] - * A collection of references to subnets. - * @property {boolean} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.interfaceEndpoints] - * An array of references to interface endpoints - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurations] - * Gets an array of references to the network interface IP configurations using - * subnet. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurationProfiles] - * Array of IP configuration profiles which reference this subnet. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.purpose] - * A read-only string identifying the intention of use for this subnet based on - * delegations and other user-defined properties. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.publicIPAddress] - * The reference of the public IP resource. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is specified, - * an A DNS record is created for the public IP in the Microsoft Azure DNS - * system. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and the - * regionalized DNS zone. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipTags] - * The list of tags associated with the public IP address. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipAddress] - * The IP address associated with the public IP address resource. - * @property {object} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.publicIPPrefix.id] - * Resource ID. - * @property {number} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.applicationSecurityGroups] - * Application security groups in which the IP configuration is included. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.provisioningState] - * The provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.name] The name - * of the resource that is unique within a resource group. This name can be - * used to access the resource. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.etag] A unique - * read-only string that changes whenever the resource is updated. - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration] The - * reference to the private IP address on the internal Load Balancer that will - * receive the tap - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.inboundNatRules] - * Read only. Inbound rules URIs that use this frontend IP. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.inboundNatPools] - * Read only. Inbound pools URIs that use this frontend IP. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.outboundRules] - * Read only. Outbound rules URIs that use this frontend IP. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.loadBalancingRules] - * Gets load balancing rules URIs that use this frontend IP. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.privateIPAllocationMethod] - * The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet] - * The reference of the subnet resource. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.networkInterfaces] - * A collection of references to network interfaces. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.subnets] - * A collection of references to subnets. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.subnets] - * A collection of references to subnets. - * @property {boolean} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.interfaceEndpoints] - * An array of references to interface endpoints - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.ipConfigurations] - * Gets an array of references to the network interface IP configurations using - * subnet. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.ipConfigurationProfiles] - * Array of IP configuration profiles which reference this subnet. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.purpose] - * A read-only string identifying the intention of use for this subnet based on - * delegations and other user-defined properties. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress] - * The reference of the Public IP resource. - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku] - * The public IP address SKU. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku.name] - * Name of a public IP address SKU. Possible values include: 'Basic', - * 'Standard' - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration] - * The IP configuration associated with the public IP address. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.privateIPAllocationMethod] - * The private IP allocation method. Possible values are 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet] - * The reference of the subnet resource. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] - * A collection of references to network interfaces. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.subnets] - * A collection of references to subnets. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.subnets] - * A collection of references to subnets. - * @property {boolean} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.interfaceEndpoints] - * An array of references to interface endpoints - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurations] - * Gets an array of references to the network interface IP configurations using - * subnet. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurationProfiles] - * Array of IP configuration profiles which reference this subnet. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.purpose] - * A read-only string identifying the intention of use for this subnet based on - * delegations and other user-defined properties. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.publicIPAddress] - * The reference of the public IP resource. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is specified, - * an A DNS record is created for the public IP in the Microsoft Azure DNS - * system. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and the - * regionalized DNS zone. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipTags] - * The list of tags associated with the public IP address. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipAddress] - * The IP address associated with the public IP address resource. - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix.id] - * Resource ID. - * @property {number} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix] - * The reference of the Public IP Prefix resource. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix.id] - * Resource ID. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.name] The - * name of the resource that is unique within a resource group. This name can - * be used to access the resource. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.etag] A - * unique read-only string that changes whenever the resource is updated. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.zones] A - * list of availability zones denoting the IP allocated for the resource needs - * to come from. - * @property {number} [virtualNetworkTap.destinationPort] The VXLAN destination - * port that will receive the tapped traffic. - * @property {string} [virtualNetworkTap.etag] Gets a unique read-only string - * that changes whenever the resource is updated. - * @property {string} [provisioningState] The provisioning state of the network - * interface tap configuration. Possible values are: 'Updating', 'Deleting', - * and 'Failed'. - * @property {string} [name] The 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. - * @property {string} [type] Sub Resource type. - */ -export interface NetworkInterfaceTapConfiguration extends SubResource { - virtualNetworkTap?: VirtualNetworkTap; - readonly provisioningState?: string; - name?: string; - etag?: string; - readonly type?: string; -} - -/** - * @class - * Initializes a new instance of the Resource class. - * @constructor - * Common resource representation. - * - * @property {string} [id] Resource ID. - * @property {string} [name] Resource name. - * @property {string} [type] Resource type. - * @property {string} [location] Resource location. - * @property {object} [tags] Resource tags. - */ -export interface Resource extends BaseResource { - id?: string; - readonly name?: string; - readonly type?: string; - location?: string; - tags?: { [propertyName: string]: string }; -} - -/** - * @class - * Initializes a new instance of the ApplicationSecurityGroup class. - * @constructor - * An application security group in a resource group. - * - * @property {string} [resourceGuid] The resource GUID property of the - * application security group resource. It uniquely identifies a resource, even - * if the user changes its name or migrate the resource across subscriptions or - * resource groups. - * @property {string} [provisioningState] The provisioning state of the - * application security group resource. Possible values are: 'Succeeded', - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ -export interface ApplicationSecurityGroup extends Resource { - readonly resourceGuid?: string; - readonly provisioningState?: string; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the SecurityRule class. - * @constructor - * Network security rule. - * - * @property {string} [description] A description for this rule. Restricted to - * 140 chars. - * @property {string} protocol Network protocol this rule applies to. Possible - * values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', 'Udp', '*' - * @property {string} [sourcePortRange] The source port or range. Integer or - * range between 0 and 65535. Asterix '*' can also be used to match all ports. - * @property {string} [destinationPortRange] The destination port or range. - * Integer or range between 0 and 65535. Asterix '*' can also be used to match - * all ports. - * @property {string} [sourceAddressPrefix] The CIDR or source IP range. - * Asterix '*' can also be used to match all source IPs. Default tags such as - * 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If - * this is an ingress rule, specifies where network traffic originates from. - * @property {array} [sourceAddressPrefixes] The CIDR or source IP ranges. - * @property {array} [sourceApplicationSecurityGroups] The application security - * group specified as source. - * @property {string} [destinationAddressPrefix] The destination address - * prefix. CIDR or destination IP range. Asterix '*' can also be used to match - * all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' - * and 'Internet' can also be used. - * @property {array} [destinationAddressPrefixes] The destination address - * prefixes. CIDR or destination IP ranges. - * @property {array} [destinationApplicationSecurityGroups] The application - * security group specified as destination. - * @property {array} [sourcePortRanges] The source port ranges. - * @property {array} [destinationPortRanges] The destination port ranges. - * @property {string} access The network traffic is allowed or denied. Possible - * values are: 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny' - * @property {number} [priority] The priority of the rule. The value can be - * between 100 and 4096. The priority number must be unique for each rule in - * the collection. The lower the priority number, the higher the priority of - * the rule. - * @property {string} direction The direction of the rule. The direction - * specifies if rule will be evaluated on incoming or outcoming traffic. - * Possible values are: 'Inbound' and 'Outbound'. Possible values include: - * 'Inbound', 'Outbound' - * @property {string} [provisioningState] The provisioning state of the public - * IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [name] The 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. - */ -export interface SecurityRule extends SubResource { - description?: string; - protocol: string; - sourcePortRange?: string; - destinationPortRange?: string; - sourceAddressPrefix?: string; - sourceAddressPrefixes?: string[]; - sourceApplicationSecurityGroups?: ApplicationSecurityGroup[]; - destinationAddressPrefix?: string; - destinationAddressPrefixes?: string[]; - destinationApplicationSecurityGroups?: ApplicationSecurityGroup[]; - sourcePortRanges?: string[]; - destinationPortRanges?: string[]; - access: string; - priority?: number; - direction: string; - provisioningState?: string; - name?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the EndpointService class. - * @constructor - * Identifies the service being brought into the virtual network. - * - * @property {string} [id] A unique identifier of the service being referenced - * by the interface endpoint. - */ -export interface EndpointService { - id?: string; -} - -/** - * @class - * Initializes a new instance of the InterfaceEndpoint class. - * @constructor - * Interface endpoint resource. - * - * @property {string} [fqdn] A first-party service's FQDN that is mapped to the - * private IP allocated via this interface endpoint. - * @property {object} [endpointService] A reference to the service being - * brought into the virtual network. - * @property {string} [endpointService.id] A unique identifier of the service - * being referenced by the interface endpoint. - * @property {object} [subnet] The ID of the subnet from which the private IP - * will be allocated. - * @property {string} [subnet.addressPrefix] The address prefix for the subnet. - * @property {array} [subnet.addressPrefixes] List of address prefixes for the - * subnet. - * @property {object} [subnet.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * @property {array} [subnet.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * @property {array} [subnet.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * @property {array} [subnet.networkSecurityGroup.networkInterfaces] A - * collection of references to network interfaces. - * @property {array} [subnet.networkSecurityGroup.subnets] A collection of - * references to subnets. - * @property {string} [subnet.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. - * @property {string} [subnet.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [subnet.networkSecurityGroup.etag] A unique read-only - * string that changes whenever the resource is updated. - * @property {object} [subnet.routeTable] The reference of the RouteTable - * resource. - * @property {array} [subnet.routeTable.routes] Collection of routes contained - * within a route table. - * @property {array} [subnet.routeTable.subnets] A collection of references to - * subnets. - * @property {boolean} [subnet.routeTable.disableBgpRoutePropagation] Gets or - * sets whether to disable the routes learned by BGP on that route table. True - * means disable. - * @property {string} [subnet.routeTable.provisioningState] The provisioning - * state of the resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [subnet.routeTable.etag] Gets a unique read-only string - * that changes whenever the resource is updated. - * @property {array} [subnet.serviceEndpoints] An array of service endpoints. - * @property {array} [subnet.serviceEndpointPolicies] An array of service - * endpoint policies. - * @property {array} [subnet.interfaceEndpoints] An array of references to - * interface endpoints - * @property {array} [subnet.ipConfigurations] Gets an array of references to - * the network interface IP configurations using subnet. - * @property {array} [subnet.ipConfigurationProfiles] Array of IP configuration - * profiles which reference this subnet. - * @property {array} [subnet.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * @property {array} [subnet.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * @property {array} [subnet.delegations] Gets an array of references to the - * delegations on the subnet. - * @property {string} [subnet.purpose] A read-only string identifying the - * intention of use for this subnet based on delegations and other user-defined - * properties. - * @property {string} [subnet.provisioningState] The provisioning state of the - * resource. - * @property {string} [subnet.name] The name of the resource that is unique - * within a resource group. This name can be used to access the resource. - * @property {string} [subnet.etag] A unique read-only string that changes - * whenever the resource is updated. - * @property {array} [networkInterfaces] Gets an array of references to the - * network interfaces created for this interface endpoint. - * @property {string} [owner] A read-only property that identifies who created - * this interface endpoint. - * @property {string} [provisioningState] The provisioning state of the - * interface endpoint. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ -export interface InterfaceEndpoint extends Resource { - fqdn?: string; - endpointService?: EndpointService; - subnet?: Subnet; - readonly networkInterfaces?: NetworkInterface[]; - readonly owner?: string; - readonly provisioningState?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the NetworkInterfaceDnsSettings class. - * @constructor - * DNS settings of a network interface. - * - * @property {array} [dnsServers] List of DNS servers IP addresses. Use - * 'AzureProvidedDNS' to switch to azure provided DNS resolution. - * 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the - * only value in dnsServers collection. - * @property {array} [appliedDnsServers] If the VM that uses this NIC is part - * of an Availability Set, then this list will have the union of all DNS - * servers from all NICs that are part of the Availability Set. This property - * is what is configured on each of those VMs. - * @property {string} [internalDnsNameLabel] Relative DNS name for this NIC - * used for internal communications between VMs in the same virtual network. - * @property {string} [internalFqdn] Fully qualified DNS name supporting - * internal communications between VMs in the same virtual network. - * @property {string} [internalDomainNameSuffix] Even if internalDnsNameLabel - * is not specified, a DNS entry is created for the primary NIC of the VM. This - * DNS name can be constructed by concatenating the VM name with the value of - * internalDomainNameSuffix. - */ -export interface NetworkInterfaceDnsSettings { - dnsServers?: string[]; - appliedDnsServers?: string[]; - internalDnsNameLabel?: string; - internalFqdn?: string; - internalDomainNameSuffix?: string; -} - -/** - * @class - * Initializes a new instance of the NetworkInterface class. - * @constructor - * A network interface in a resource group. - * - * @property {object} [virtualMachine] The reference of a virtual machine. - * @property {string} [virtualMachine.id] Resource ID. - * @property {object} [networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * @property {array} [networkSecurityGroup.securityRules] A collection of - * security rules of the network security group. - * @property {array} [networkSecurityGroup.defaultSecurityRules] The default - * security rules of network security group. - * @property {array} [networkSecurityGroup.networkInterfaces] A collection of - * references to network interfaces. - * @property {array} [networkSecurityGroup.subnets] A collection of references - * to subnets. - * @property {string} [networkSecurityGroup.resourceGuid] The resource GUID - * property of the network security group resource. - * @property {string} [networkSecurityGroup.provisioningState] The provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [networkSecurityGroup.etag] A unique read-only string - * that changes whenever the resource is updated. - * @property {object} [interfaceEndpoint] A reference to the interface endpoint - * to which the network interface is linked. - * @property {string} [interfaceEndpoint.fqdn] A first-party service's FQDN - * that is mapped to the private IP allocated via this interface endpoint. - * @property {object} [interfaceEndpoint.endpointService] A reference to the - * service being brought into the virtual network. - * @property {string} [interfaceEndpoint.endpointService.id] A unique - * identifier of the service being referenced by the interface endpoint. - * @property {object} [interfaceEndpoint.subnet] The ID of the subnet from - * which the private IP will be allocated. - * @property {string} [interfaceEndpoint.subnet.addressPrefix] The address - * prefix for the subnet. - * @property {array} [interfaceEndpoint.subnet.addressPrefixes] List of - * address prefixes for the subnet. - * @property {object} [interfaceEndpoint.subnet.networkSecurityGroup] The - * reference of the NetworkSecurityGroup resource. - * @property {array} - * [interfaceEndpoint.subnet.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * @property {array} - * [interfaceEndpoint.subnet.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * @property {array} - * [interfaceEndpoint.subnet.networkSecurityGroup.networkInterfaces] A - * collection of references to network interfaces. - * @property {array} [interfaceEndpoint.subnet.networkSecurityGroup.subnets] A - * collection of references to subnets. - * @property {string} - * [interfaceEndpoint.subnet.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. - * @property {string} - * [interfaceEndpoint.subnet.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [interfaceEndpoint.subnet.networkSecurityGroup.etag] A - * unique read-only string that changes whenever the resource is updated. - * @property {object} [interfaceEndpoint.subnet.routeTable] The reference of - * the RouteTable resource. - * @property {array} [interfaceEndpoint.subnet.routeTable.routes] Collection of - * routes contained within a route table. - * @property {array} [interfaceEndpoint.subnet.routeTable.subnets] A collection - * of references to subnets. - * @property {boolean} - * [interfaceEndpoint.subnet.routeTable.disableBgpRoutePropagation] Gets or - * sets whether to disable the routes learned by BGP on that route table. True - * means disable. - * @property {string} [interfaceEndpoint.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [interfaceEndpoint.subnet.routeTable.etag] Gets a unique - * read-only string that changes whenever the resource is updated. - * @property {array} [interfaceEndpoint.subnet.serviceEndpoints] An array of - * service endpoints. - * @property {array} [interfaceEndpoint.subnet.serviceEndpointPolicies] An - * array of service endpoint policies. - * @property {array} [interfaceEndpoint.subnet.interfaceEndpoints] An array of - * references to interface endpoints - * @property {array} [interfaceEndpoint.subnet.ipConfigurations] Gets an array - * of references to the network interface IP configurations using subnet. - * @property {array} [interfaceEndpoint.subnet.ipConfigurationProfiles] Array - * of IP configuration profiles which reference this subnet. - * @property {array} [interfaceEndpoint.subnet.resourceNavigationLinks] Gets an - * array of references to the external resources using subnet. - * @property {array} [interfaceEndpoint.subnet.serviceAssociationLinks] Gets an - * array of references to services injecting into this subnet. - * @property {array} [interfaceEndpoint.subnet.delegations] Gets an array of - * references to the delegations on the subnet. - * @property {string} [interfaceEndpoint.subnet.purpose] A read-only string - * identifying the intention of use for this subnet based on delegations and - * other user-defined properties. - * @property {string} [interfaceEndpoint.subnet.provisioningState] The - * provisioning state of the resource. - * @property {string} [interfaceEndpoint.subnet.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * @property {string} [interfaceEndpoint.subnet.etag] A unique read-only string - * that changes whenever the resource is updated. - * @property {array} [interfaceEndpoint.networkInterfaces] Gets an array of - * references to the network interfaces created for this interface endpoint. - * @property {string} [interfaceEndpoint.owner] A read-only property that - * identifies who created this interface endpoint. - * @property {string} [interfaceEndpoint.provisioningState] The provisioning - * state of the interface endpoint. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [interfaceEndpoint.etag] Gets a unique read-only string - * that changes whenever the resource is updated. - * @property {array} [ipConfigurations] A list of IPConfigurations of the - * network interface. - * @property {array} [tapConfigurations] A list of TapConfigurations of the - * network interface. - * @property {object} [dnsSettings] The DNS settings in network interface. - * @property {array} [dnsSettings.dnsServers] List of DNS servers IP addresses. - * Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. - * 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the - * only value in dnsServers collection. - * @property {array} [dnsSettings.appliedDnsServers] If the VM that uses this - * NIC is part of an Availability Set, then this list will have the union of - * all DNS servers from all NICs that are part of the Availability Set. This - * property is what is configured on each of those VMs. - * @property {string} [dnsSettings.internalDnsNameLabel] Relative DNS name for - * this NIC used for internal communications between VMs in the same virtual - * network. - * @property {string} [dnsSettings.internalFqdn] Fully qualified DNS name - * supporting internal communications between VMs in the same virtual network. - * @property {string} [dnsSettings.internalDomainNameSuffix] Even if - * internalDnsNameLabel is not specified, a DNS entry is created for the - * primary NIC of the VM. This DNS name can be constructed by concatenating the - * VM name with the value of internalDomainNameSuffix. - * @property {string} [macAddress] The MAC address of the network interface. - * @property {boolean} [primary] Gets whether this is a primary network - * interface on a virtual machine. - * @property {boolean} [enableAcceleratedNetworking] If the network interface - * is accelerated networking enabled. - * @property {boolean} [enableIPForwarding] Indicates whether IP forwarding is - * enabled on this network interface. - * @property {array} [hostedWorkloads] A list of references to linked BareMetal - * resources - * @property {string} [resourceGuid] The resource GUID property of the network - * interface resource. - * @property {string} [provisioningState] The provisioning state of the public - * IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ -export interface NetworkInterface extends Resource { - readonly virtualMachine?: SubResource; - networkSecurityGroup?: NetworkSecurityGroup; - readonly interfaceEndpoint?: InterfaceEndpoint; - ipConfigurations?: NetworkInterfaceIPConfiguration[]; - tapConfigurations?: NetworkInterfaceTapConfiguration[]; - dnsSettings?: NetworkInterfaceDnsSettings; - macAddress?: string; - primary?: boolean; - enableAcceleratedNetworking?: boolean; - enableIPForwarding?: boolean; - readonly hostedWorkloads?: string[]; - resourceGuid?: string; - provisioningState?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the NetworkSecurityGroup class. - * @constructor - * NetworkSecurityGroup resource. - * - * @property {array} [securityRules] A collection of security rules of the - * network security group. - * @property {array} [defaultSecurityRules] The default security rules of - * network security group. - * @property {array} [networkInterfaces] A collection of references to network - * interfaces. - * @property {array} [subnets] A collection of references to subnets. - * @property {string} [resourceGuid] The resource GUID property of the network - * security group resource. - * @property {string} [provisioningState] The provisioning state of the public - * IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ -export interface NetworkSecurityGroup extends Resource { - securityRules?: SecurityRule[]; - defaultSecurityRules?: SecurityRule[]; - readonly networkInterfaces?: NetworkInterface[]; - readonly subnets?: Subnet[]; - resourceGuid?: string; - provisioningState?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the Route class. - * @constructor - * Route resource - * - * @property {string} [addressPrefix] The destination CIDR to which the route - * applies. - * @property {string} nextHopType The type of Azure hop the packet should be - * sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', - * 'Internet', 'VirtualAppliance', and 'None'. Possible values include: - * 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None' - * @property {string} [nextHopIpAddress] The IP address packets should be - * forwarded to. Next hop values are only allowed in routes where the next hop - * type is VirtualAppliance. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [name] The 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. - */ -export interface Route extends SubResource { - addressPrefix?: string; - nextHopType: string; - nextHopIpAddress?: string; - provisioningState?: string; - name?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the RouteTable class. - * @constructor - * Route table resource. - * - * @property {array} [routes] Collection of routes contained within a route - * table. - * @property {array} [subnets] A collection of references to subnets. - * @property {boolean} [disableBgpRoutePropagation] Gets or sets whether to - * disable the routes learned by BGP on that route table. True means disable. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ -export interface RouteTable extends Resource { - routes?: Route[]; - readonly subnets?: Subnet[]; - disableBgpRoutePropagation?: boolean; - provisioningState?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the ServiceEndpointPropertiesFormat class. - * @constructor - * The service endpoint properties. - * - * @property {string} [service] The type of the endpoint service. - * @property {array} [locations] A list of locations. - * @property {string} [provisioningState] The provisioning state of the - * resource. - */ -export interface ServiceEndpointPropertiesFormat { - service?: string; - locations?: string[]; - provisioningState?: string; -} - -/** - * @class - * Initializes a new instance of the ServiceEndpointPolicyDefinition class. - * @constructor - * Service Endpoint policy definitions. - * - * @property {string} [description] A description for this rule. Restricted to - * 140 chars. - * @property {string} [service] service endpoint name. - * @property {array} [serviceResources] A list of service resources. - * @property {string} [provisioningState] The provisioning state of the service - * end point policy definition. Possible values are: 'Updating', 'Deleting', - * and 'Failed'. - * @property {string} [name] The 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. - */ -export interface ServiceEndpointPolicyDefinition extends SubResource { - description?: string; - service?: string; - serviceResources?: string[]; - readonly provisioningState?: string; - name?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the ServiceEndpointPolicy class. - * @constructor - * Service End point policy resource. - * - * @property {array} [serviceEndpointPolicyDefinitions] A collection of service - * endpoint policy definitions of the service endpoint policy. - * @property {array} [subnets] A collection of references to subnets. - * @property {string} [resourceGuid] The resource GUID property of the service - * endpoint policy resource. - * @property {string} [provisioningState] The provisioning state of the service - * endpoint policy. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ -export interface ServiceEndpointPolicy extends Resource { - serviceEndpointPolicyDefinitions?: ServiceEndpointPolicyDefinition[]; - readonly subnets?: Subnet[]; - readonly resourceGuid?: string; - readonly provisioningState?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the PublicIPAddressSku class. - * @constructor - * SKU of a public IP address - * - * @property {string} [name] Name of a public IP address SKU. Possible values - * include: 'Basic', 'Standard' - */ -export interface PublicIPAddressSku { - name?: string; -} - -/** - * @class - * Initializes a new instance of the PublicIPAddressDnsSettings class. - * @constructor - * Contains FQDN of the DNS record associated with the public IP address - * - * @property {string} [domainNameLabel] Gets or sets the Domain name label.The - * concatenation of the domain name label and the regionalized DNS zone make up - * the fully qualified domain name associated with the public IP address. If a - * domain name label is specified, an A DNS record is created for the public IP - * in the Microsoft Azure DNS system. - * @property {string} [fqdn] Gets the FQDN, Fully qualified domain name of the - * A DNS record associated with the public IP. This is the concatenation of the - * domainNameLabel and the regionalized DNS zone. - * @property {string} [reverseFqdn] Gets or Sets the Reverse FQDN. A - * user-visible, fully qualified domain name that resolves to this public IP - * address. If the reverseFqdn is specified, then a PTR DNS record is created - * pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. - */ -export interface PublicIPAddressDnsSettings { - domainNameLabel?: string; - fqdn?: string; - reverseFqdn?: string; -} - -/** - * @class - * Initializes a new instance of the IpTag class. - * @constructor - * Contains the IpTag associated with the object - * - * @property {string} [ipTagType] Gets or sets the ipTag type: Example - * FirstPartyUsage. - * @property {string} [tag] Gets or sets value of the IpTag associated with the - * public IP. Example SQL, Storage etc - */ -export interface IpTag { - ipTagType?: string; - tag?: string; -} - -/** - * @class - * Initializes a new instance of the PublicIPAddress class. - * @constructor - * Public IP address resource. - * - * @property {object} [sku] The public IP address SKU. - * @property {string} [sku.name] Name of a public IP address SKU. Possible - * values include: 'Basic', 'Standard' - * @property {string} [publicIPAllocationMethod] The public IP allocation - * method. Possible values are: 'Static' and 'Dynamic'. Possible values - * include: 'Static', 'Dynamic' - * @property {string} [publicIPAddressVersion] The public IP address version. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * @property {object} [ipConfiguration] The IP configuration associated with - * the public IP address. - * @property {string} [ipConfiguration.privateIPAddress] The private IP address - * of the IP configuration. - * @property {string} [ipConfiguration.privateIPAllocationMethod] The private - * IP allocation method. Possible values are 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' - * @property {object} [ipConfiguration.subnet] The reference of the subnet - * resource. - * @property {string} [ipConfiguration.subnet.addressPrefix] The address prefix - * for the subnet. - * @property {array} [ipConfiguration.subnet.addressPrefixes] List of address - * prefixes for the subnet. - * @property {object} [ipConfiguration.subnet.networkSecurityGroup] The - * reference of the NetworkSecurityGroup resource. - * @property {array} - * [ipConfiguration.subnet.networkSecurityGroup.securityRules] A collection of - * security rules of the network security group. - * @property {array} - * [ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * @property {array} - * [ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] A collection - * of references to network interfaces. - * @property {array} [ipConfiguration.subnet.networkSecurityGroup.subnets] A - * collection of references to subnets. - * @property {string} - * [ipConfiguration.subnet.networkSecurityGroup.resourceGuid] The resource GUID - * property of the network security group resource. - * @property {string} - * [ipConfiguration.subnet.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [ipConfiguration.subnet.networkSecurityGroup.etag] A - * unique read-only string that changes whenever the resource is updated. - * @property {object} [ipConfiguration.subnet.routeTable] The reference of the - * RouteTable resource. - * @property {array} [ipConfiguration.subnet.routeTable.routes] Collection of - * routes contained within a route table. - * @property {array} [ipConfiguration.subnet.routeTable.subnets] A collection - * of references to subnets. - * @property {boolean} - * [ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] Gets or sets - * whether to disable the routes learned by BGP on that route table. True means - * disable. - * @property {string} [ipConfiguration.subnet.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [ipConfiguration.subnet.routeTable.etag] Gets a unique - * read-only string that changes whenever the resource is updated. - * @property {array} [ipConfiguration.subnet.serviceEndpoints] An array of - * service endpoints. - * @property {array} [ipConfiguration.subnet.serviceEndpointPolicies] An array - * of service endpoint policies. - * @property {array} [ipConfiguration.subnet.interfaceEndpoints] An array of - * references to interface endpoints - * @property {array} [ipConfiguration.subnet.ipConfigurations] Gets an array of - * references to the network interface IP configurations using subnet. - * @property {array} [ipConfiguration.subnet.ipConfigurationProfiles] Array of - * IP configuration profiles which reference this subnet. - * @property {array} [ipConfiguration.subnet.resourceNavigationLinks] Gets an - * array of references to the external resources using subnet. - * @property {array} [ipConfiguration.subnet.serviceAssociationLinks] Gets an - * array of references to services injecting into this subnet. - * @property {array} [ipConfiguration.subnet.delegations] Gets an array of - * references to the delegations on the subnet. - * @property {string} [ipConfiguration.subnet.purpose] A read-only string - * identifying the intention of use for this subnet based on delegations and - * other user-defined properties. - * @property {string} [ipConfiguration.subnet.provisioningState] The - * provisioning state of the resource. - * @property {string} [ipConfiguration.subnet.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * @property {string} [ipConfiguration.subnet.etag] A unique read-only string - * that changes whenever the resource is updated. - * @property {object} [ipConfiguration.publicIPAddress] The reference of the - * public IP resource. - * @property {string} [ipConfiguration.provisioningState] Gets the provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [ipConfiguration.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * @property {string} [ipConfiguration.etag] A unique read-only string that - * changes whenever the resource is updated. - * @property {object} [dnsSettings] The FQDN of the DNS record associated with - * the public IP address. - * @property {string} [dnsSettings.domainNameLabel] Gets or sets the Domain - * name label.The concatenation of the domain name label and the regionalized - * DNS zone make up the fully qualified domain name associated with the public - * IP address. If a domain name label is specified, an A DNS record is created - * for the public IP in the Microsoft Azure DNS system. - * @property {string} [dnsSettings.fqdn] Gets the FQDN, Fully qualified domain - * name of the A DNS record associated with the public IP. This is the - * concatenation of the domainNameLabel and the regionalized DNS zone. - * @property {string} [dnsSettings.reverseFqdn] Gets or Sets the Reverse FQDN. - * A user-visible, fully qualified domain name that resolves to this public IP - * address. If the reverseFqdn is specified, then a PTR DNS record is created - * pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. - * @property {array} [ipTags] The list of tags associated with the public IP - * address. - * @property {string} [ipAddress] The IP address associated with the public IP - * address resource. - * @property {object} [publicIPPrefix] The Public IP Prefix this Public IP - * Address should be allocated from. - * @property {string} [publicIPPrefix.id] Resource ID. - * @property {number} [idleTimeoutInMinutes] The idle timeout of the public IP - * address. - * @property {string} [resourceGuid] The resource GUID property of the public - * IP resource. - * @property {string} [provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {array} [zones] A list of availability zones denoting the IP - * allocated for the resource needs to come from. - */ -export interface PublicIPAddress extends Resource { - sku?: PublicIPAddressSku; - publicIPAllocationMethod?: string; - publicIPAddressVersion?: string; - readonly ipConfiguration?: IPConfiguration; - dnsSettings?: PublicIPAddressDnsSettings; - ipTags?: IpTag[]; - ipAddress?: string; - publicIPPrefix?: SubResource; - idleTimeoutInMinutes?: number; - resourceGuid?: string; - provisioningState?: string; - etag?: string; - zones?: string[]; -} - -/** - * @class - * Initializes a new instance of the IPConfiguration class. - * @constructor - * IP configuration - * - * @property {string} [privateIPAddress] The private IP address of the IP - * configuration. - * @property {string} [privateIPAllocationMethod] The private IP allocation - * method. Possible values are 'Static' and 'Dynamic'. Possible values include: - * 'Static', 'Dynamic' - * @property {object} [subnet] The reference of the subnet resource. - * @property {string} [subnet.addressPrefix] The address prefix for the subnet. - * @property {array} [subnet.addressPrefixes] List of address prefixes for the - * subnet. - * @property {object} [subnet.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * @property {array} [subnet.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * @property {array} [subnet.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * @property {array} [subnet.networkSecurityGroup.networkInterfaces] A - * collection of references to network interfaces. - * @property {array} [subnet.networkSecurityGroup.subnets] A collection of - * references to subnets. - * @property {string} [subnet.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. - * @property {string} [subnet.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [subnet.networkSecurityGroup.etag] A unique read-only - * string that changes whenever the resource is updated. - * @property {object} [subnet.routeTable] The reference of the RouteTable - * resource. - * @property {array} [subnet.routeTable.routes] Collection of routes contained - * within a route table. - * @property {array} [subnet.routeTable.subnets] A collection of references to - * subnets. - * @property {boolean} [subnet.routeTable.disableBgpRoutePropagation] Gets or - * sets whether to disable the routes learned by BGP on that route table. True - * means disable. - * @property {string} [subnet.routeTable.provisioningState] The provisioning - * state of the resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [subnet.routeTable.etag] Gets a unique read-only string - * that changes whenever the resource is updated. - * @property {array} [subnet.serviceEndpoints] An array of service endpoints. - * @property {array} [subnet.serviceEndpointPolicies] An array of service - * endpoint policies. - * @property {array} [subnet.interfaceEndpoints] An array of references to - * interface endpoints - * @property {array} [subnet.ipConfigurations] Gets an array of references to - * the network interface IP configurations using subnet. - * @property {array} [subnet.ipConfigurationProfiles] Array of IP configuration - * profiles which reference this subnet. - * @property {array} [subnet.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * @property {array} [subnet.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * @property {array} [subnet.delegations] Gets an array of references to the - * delegations on the subnet. - * @property {string} [subnet.purpose] A read-only string identifying the - * intention of use for this subnet based on delegations and other user-defined - * properties. - * @property {string} [subnet.provisioningState] The provisioning state of the - * resource. - * @property {string} [subnet.name] The name of the resource that is unique - * within a resource group. This name can be used to access the resource. - * @property {string} [subnet.etag] A unique read-only string that changes - * whenever the resource is updated. - * @property {object} [publicIPAddress] The reference of the public IP - * resource. - * @property {object} [publicIPAddress.sku] The public IP address SKU. - * @property {string} [publicIPAddress.sku.name] Name of a public IP address - * SKU. Possible values include: 'Basic', 'Standard' - * @property {string} [publicIPAddress.publicIPAllocationMethod] The public IP - * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' - * @property {string} [publicIPAddress.publicIPAddressVersion] The public IP - * address version. Possible values are: 'IPv4' and 'IPv6'. Possible values - * include: 'IPv4', 'IPv6' - * @property {object} [publicIPAddress.ipConfiguration] The IP configuration - * associated with the public IP address. - * @property {object} [publicIPAddress.dnsSettings] The FQDN of the DNS record - * associated with the public IP address. - * @property {string} [publicIPAddress.dnsSettings.domainNameLabel] Gets or - * sets the Domain name label.The concatenation of the domain name label and - * the regionalized DNS zone make up the fully qualified domain name associated - * with the public IP address. If a domain name label is specified, an A DNS - * record is created for the public IP in the Microsoft Azure DNS system. - * @property {string} [publicIPAddress.dnsSettings.fqdn] Gets the FQDN, Fully - * qualified domain name of the A DNS record associated with the public IP. - * This is the concatenation of the domainNameLabel and the regionalized DNS - * zone. - * @property {string} [publicIPAddress.dnsSettings.reverseFqdn] Gets or Sets - * the Reverse FQDN. A user-visible, fully qualified domain name that resolves - * to this public IP address. If the reverseFqdn is specified, then a PTR DNS - * record is created pointing from the IP address in the in-addr.arpa domain to - * the reverse FQDN. - * @property {array} [publicIPAddress.ipTags] The list of tags associated with - * the public IP address. - * @property {string} [publicIPAddress.ipAddress] The IP address associated - * with the public IP address resource. - * @property {object} [publicIPAddress.publicIPPrefix] The Public IP Prefix - * this Public IP Address should be allocated from. - * @property {string} [publicIPAddress.publicIPPrefix.id] Resource ID. - * @property {number} [publicIPAddress.idleTimeoutInMinutes] The idle timeout - * of the public IP address. - * @property {string} [publicIPAddress.resourceGuid] The resource GUID property - * of the public IP resource. - * @property {string} [publicIPAddress.provisioningState] The provisioning - * state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', - * and 'Failed'. - * @property {string} [publicIPAddress.etag] A unique read-only string that - * changes whenever the resource is updated. - * @property {array} [publicIPAddress.zones] A list of availability zones - * denoting the IP allocated for the resource needs to come from. - * @property {string} [provisioningState] Gets the provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [name] The 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. - */ -export interface IPConfiguration extends SubResource { - privateIPAddress?: string; - privateIPAllocationMethod?: string; - subnet?: Subnet; - publicIPAddress?: PublicIPAddress; - provisioningState?: string; - name?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the IPConfigurationProfile class. - * @constructor - * IP configuration profile child resource. - * - * @property {object} [subnet] The reference of the subnet resource to create a - * contatainer network interface ip configruation. - * @property {string} [subnet.addressPrefix] The address prefix for the subnet. - * @property {array} [subnet.addressPrefixes] List of address prefixes for the - * subnet. - * @property {object} [subnet.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * @property {array} [subnet.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * @property {array} [subnet.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * @property {array} [subnet.networkSecurityGroup.networkInterfaces] A - * collection of references to network interfaces. - * @property {array} [subnet.networkSecurityGroup.subnets] A collection of - * references to subnets. - * @property {string} [subnet.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. - * @property {string} [subnet.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [subnet.networkSecurityGroup.etag] A unique read-only - * string that changes whenever the resource is updated. - * @property {object} [subnet.routeTable] The reference of the RouteTable - * resource. - * @property {array} [subnet.routeTable.routes] Collection of routes contained - * within a route table. - * @property {array} [subnet.routeTable.subnets] A collection of references to - * subnets. - * @property {boolean} [subnet.routeTable.disableBgpRoutePropagation] Gets or - * sets whether to disable the routes learned by BGP on that route table. True - * means disable. - * @property {string} [subnet.routeTable.provisioningState] The provisioning - * state of the resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [subnet.routeTable.etag] Gets a unique read-only string - * that changes whenever the resource is updated. - * @property {array} [subnet.serviceEndpoints] An array of service endpoints. - * @property {array} [subnet.serviceEndpointPolicies] An array of service - * endpoint policies. - * @property {array} [subnet.interfaceEndpoints] An array of references to - * interface endpoints - * @property {array} [subnet.ipConfigurations] Gets an array of references to - * the network interface IP configurations using subnet. - * @property {array} [subnet.ipConfigurationProfiles] Array of IP configuration - * profiles which reference this subnet. - * @property {array} [subnet.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * @property {array} [subnet.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * @property {array} [subnet.delegations] Gets an array of references to the - * delegations on the subnet. - * @property {string} [subnet.purpose] A read-only string identifying the - * intention of use for this subnet based on delegations and other user-defined - * properties. - * @property {string} [subnet.provisioningState] The provisioning state of the - * resource. - * @property {string} [subnet.name] The name of the resource that is unique - * within a resource group. This name can be used to access the resource. - * @property {string} [subnet.etag] A unique read-only string that changes - * whenever the resource is updated. - * @property {string} [provisioningState] The provisioning state of the - * resource. - * @property {string} [name] The name of the resource. This name can be used to - * access the resource. - * @property {string} [type] Sub Resource type. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ -export interface IPConfigurationProfile extends SubResource { - subnet?: Subnet; - readonly provisioningState?: string; - name?: string; - readonly type?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the ResourceNavigationLink class. - * @constructor - * ResourceNavigationLink resource. - * - * @property {string} [linkedResourceType] Resource type of the linked - * resource. - * @property {string} [link] Link to the external resource - * @property {string} [provisioningState] Provisioning state of the - * ResourceNavigationLink resource. - * @property {string} [name] 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. - */ -export interface ResourceNavigationLink extends SubResource { - linkedResourceType?: string; - link?: string; - readonly provisioningState?: string; - name?: string; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the ServiceAssociationLink class. - * @constructor - * ServiceAssociationLink resource. - * - * @property {string} [linkedResourceType] Resource type of the linked - * resource. - * @property {string} [link] Link to the external resource. - * @property {string} [provisioningState] Provisioning state of the - * ServiceAssociationLink resource. - * @property {string} [name] 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. - */ -export interface ServiceAssociationLink extends SubResource { - linkedResourceType?: string; - link?: string; - readonly provisioningState?: string; - name?: string; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the Delegation class. - * @constructor - * Details the service to which the subnet is delegated. - * - * @property {string} [serviceName] The name of the service to whom the subnet - * should be delegated (e.g. Microsoft.Sql/servers) - * @property {array} [actions] Describes the actions permitted to the service - * upon delegation - * @property {string} [provisioningState] The provisioning state of the - * resource. - * @property {string} [name] The name of the resource that is unique within a - * subnet. This name can be used to access the resource. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ -export interface Delegation extends SubResource { - serviceName?: string; - actions?: string[]; - readonly provisioningState?: string; - name?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the Subnet class. - * @constructor - * Subnet in a virtual network resource. - * - * @property {string} [addressPrefix] The address prefix for the subnet. - * @property {array} [addressPrefixes] List of address prefixes for the - * subnet. - * @property {object} [networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * @property {array} [networkSecurityGroup.securityRules] A collection of - * security rules of the network security group. - * @property {array} [networkSecurityGroup.defaultSecurityRules] The default - * security rules of network security group. - * @property {array} [networkSecurityGroup.networkInterfaces] A collection of - * references to network interfaces. - * @property {array} [networkSecurityGroup.subnets] A collection of references - * to subnets. - * @property {string} [networkSecurityGroup.resourceGuid] The resource GUID - * property of the network security group resource. - * @property {string} [networkSecurityGroup.provisioningState] The provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [networkSecurityGroup.etag] A unique read-only string - * that changes whenever the resource is updated. - * @property {object} [routeTable] The reference of the RouteTable resource. - * @property {array} [routeTable.routes] Collection of routes contained within - * a route table. - * @property {array} [routeTable.subnets] A collection of references to - * subnets. - * @property {boolean} [routeTable.disableBgpRoutePropagation] Gets or sets - * whether to disable the routes learned by BGP on that route table. True means - * disable. - * @property {string} [routeTable.provisioningState] The provisioning state of - * the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [routeTable.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * @property {array} [serviceEndpoints] An array of service endpoints. - * @property {array} [serviceEndpointPolicies] An array of service endpoint - * policies. - * @property {array} [interfaceEndpoints] An array of references to interface - * endpoints - * @property {array} [ipConfigurations] Gets an array of references to the - * network interface IP configurations using subnet. - * @property {array} [ipConfigurationProfiles] Array of IP configuration - * profiles which reference this subnet. - * @property {array} [resourceNavigationLinks] Gets an array of references to - * the external resources using subnet. - * @property {array} [serviceAssociationLinks] Gets an array of references to - * services injecting into this subnet. - * @property {array} [delegations] Gets an array of references to the - * delegations on the subnet. - * @property {string} [purpose] A read-only string identifying the intention of - * use for this subnet based on delegations and other user-defined properties. - * @property {string} [provisioningState] The provisioning state of the - * resource. - * @property {string} [name] The 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. - */ -export interface Subnet extends SubResource { - addressPrefix?: string; - addressPrefixes?: string[]; - networkSecurityGroup?: NetworkSecurityGroup; - routeTable?: RouteTable; - serviceEndpoints?: ServiceEndpointPropertiesFormat[]; - serviceEndpointPolicies?: ServiceEndpointPolicy[]; - readonly interfaceEndpoints?: InterfaceEndpoint[]; - readonly ipConfigurations?: IPConfiguration[]; - readonly ipConfigurationProfiles?: IPConfigurationProfile[]; - resourceNavigationLinks?: ResourceNavigationLink[]; - serviceAssociationLinks?: ServiceAssociationLink[]; - delegations?: Delegation[]; - readonly purpose?: string; - provisioningState?: string; - name?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the FrontendIPConfiguration class. - * @constructor - * Frontend IP address of the load balancer. - * - * @property {array} [inboundNatRules] Read only. Inbound rules URIs that use - * this frontend IP. - * @property {array} [inboundNatPools] Read only. Inbound pools URIs that use - * this frontend IP. - * @property {array} [outboundRules] Read only. Outbound rules URIs that use - * this frontend IP. - * @property {array} [loadBalancingRules] Gets load balancing rules URIs that - * use this frontend IP. - * @property {string} [privateIPAddress] The private IP address of the IP - * configuration. - * @property {string} [privateIPAllocationMethod] The Private IP allocation - * method. Possible values are: 'Static' and 'Dynamic'. Possible values - * include: 'Static', 'Dynamic' - * @property {object} [subnet] The reference of the subnet resource. - * @property {string} [subnet.addressPrefix] The address prefix for the subnet. - * @property {array} [subnet.addressPrefixes] List of address prefixes for the - * subnet. - * @property {object} [subnet.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * @property {array} [subnet.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * @property {array} [subnet.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * @property {array} [subnet.networkSecurityGroup.networkInterfaces] A - * collection of references to network interfaces. - * @property {array} [subnet.networkSecurityGroup.subnets] A collection of - * references to subnets. - * @property {string} [subnet.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. - * @property {string} [subnet.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [subnet.networkSecurityGroup.etag] A unique read-only - * string that changes whenever the resource is updated. - * @property {object} [subnet.routeTable] The reference of the RouteTable - * resource. - * @property {array} [subnet.routeTable.routes] Collection of routes contained - * within a route table. - * @property {array} [subnet.routeTable.subnets] A collection of references to - * subnets. - * @property {boolean} [subnet.routeTable.disableBgpRoutePropagation] Gets or - * sets whether to disable the routes learned by BGP on that route table. True - * means disable. - * @property {string} [subnet.routeTable.provisioningState] The provisioning - * state of the resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [subnet.routeTable.etag] Gets a unique read-only string - * that changes whenever the resource is updated. - * @property {array} [subnet.serviceEndpoints] An array of service endpoints. - * @property {array} [subnet.serviceEndpointPolicies] An array of service - * endpoint policies. - * @property {array} [subnet.interfaceEndpoints] An array of references to - * interface endpoints - * @property {array} [subnet.ipConfigurations] Gets an array of references to - * the network interface IP configurations using subnet. - * @property {array} [subnet.ipConfigurationProfiles] Array of IP configuration - * profiles which reference this subnet. - * @property {array} [subnet.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * @property {array} [subnet.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * @property {array} [subnet.delegations] Gets an array of references to the - * delegations on the subnet. - * @property {string} [subnet.purpose] A read-only string identifying the - * intention of use for this subnet based on delegations and other user-defined - * properties. - * @property {string} [subnet.provisioningState] The provisioning state of the - * resource. - * @property {string} [subnet.name] The name of the resource that is unique - * within a resource group. This name can be used to access the resource. - * @property {string} [subnet.etag] A unique read-only string that changes - * whenever the resource is updated. - * @property {object} [publicIPAddress] The reference of the Public IP - * resource. - * @property {object} [publicIPAddress.sku] The public IP address SKU. - * @property {string} [publicIPAddress.sku.name] Name of a public IP address - * SKU. Possible values include: 'Basic', 'Standard' - * @property {string} [publicIPAddress.publicIPAllocationMethod] The public IP - * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' - * @property {string} [publicIPAddress.publicIPAddressVersion] The public IP - * address version. Possible values are: 'IPv4' and 'IPv6'. Possible values - * include: 'IPv4', 'IPv6' - * @property {object} [publicIPAddress.ipConfiguration] The IP configuration - * associated with the public IP address. - * @property {string} [publicIPAddress.ipConfiguration.privateIPAddress] The - * private IP address of the IP configuration. - * @property {string} - * [publicIPAddress.ipConfiguration.privateIPAllocationMethod] The private IP - * allocation method. Possible values are 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' - * @property {object} [publicIPAddress.ipConfiguration.subnet] The reference of - * the subnet resource. - * @property {string} [publicIPAddress.ipConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * @property {array} [publicIPAddress.ipConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * @property {object} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup] The reference - * of the NetworkSecurityGroup resource. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] - * A collection of references to network interfaces. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.subnets] A - * collection of references to subnets. - * @property {string} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * @property {string} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.etag] A unique - * read-only string that changes whenever the resource is updated. - * @property {object} [publicIPAddress.ipConfiguration.subnet.routeTable] The - * reference of the RouteTable resource. - * @property {array} [publicIPAddress.ipConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.routeTable.subnets] A collection of - * references to subnets. - * @property {boolean} - * [publicIPAddress.ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * @property {string} - * [publicIPAddress.ipConfiguration.subnet.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [publicIPAddress.ipConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * @property {array} [publicIPAddress.ipConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.serviceEndpointPolicies] An array of - * service endpoint policies. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.interfaceEndpoints] An array of - * references to interface endpoints - * @property {array} [publicIPAddress.ipConfiguration.subnet.ipConfigurations] - * Gets an array of references to the network interface IP configurations using - * subnet. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.ipConfigurationProfiles] Array of IP - * configuration profiles which reference this subnet. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.resourceNavigationLinks] Gets an - * array of references to the external resources using subnet. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.serviceAssociationLinks] Gets an - * array of references to services injecting into this subnet. - * @property {array} [publicIPAddress.ipConfiguration.subnet.delegations] Gets - * an array of references to the delegations on the subnet. - * @property {string} [publicIPAddress.ipConfiguration.subnet.purpose] A - * read-only string identifying the intention of use for this subnet based on - * delegations and other user-defined properties. - * @property {string} - * [publicIPAddress.ipConfiguration.subnet.provisioningState] The provisioning - * state of the resource. - * @property {string} [publicIPAddress.ipConfiguration.subnet.name] The name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. - * @property {string} [publicIPAddress.ipConfiguration.subnet.etag] A unique - * read-only string that changes whenever the resource is updated. - * @property {object} [publicIPAddress.ipConfiguration.publicIPAddress] The - * reference of the public IP resource. - * @property {string} [publicIPAddress.ipConfiguration.provisioningState] Gets - * the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [publicIPAddress.ipConfiguration.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * @property {string} [publicIPAddress.ipConfiguration.etag] A unique read-only - * string that changes whenever the resource is updated. - * @property {object} [publicIPAddress.dnsSettings] The FQDN of the DNS record - * associated with the public IP address. - * @property {string} [publicIPAddress.dnsSettings.domainNameLabel] Gets or - * sets the Domain name label.The concatenation of the domain name label and - * the regionalized DNS zone make up the fully qualified domain name associated - * with the public IP address. If a domain name label is specified, an A DNS - * record is created for the public IP in the Microsoft Azure DNS system. - * @property {string} [publicIPAddress.dnsSettings.fqdn] Gets the FQDN, Fully - * qualified domain name of the A DNS record associated with the public IP. - * This is the concatenation of the domainNameLabel and the regionalized DNS - * zone. - * @property {string} [publicIPAddress.dnsSettings.reverseFqdn] Gets or Sets - * the Reverse FQDN. A user-visible, fully qualified domain name that resolves - * to this public IP address. If the reverseFqdn is specified, then a PTR DNS - * record is created pointing from the IP address in the in-addr.arpa domain to - * the reverse FQDN. - * @property {array} [publicIPAddress.ipTags] The list of tags associated with - * the public IP address. - * @property {string} [publicIPAddress.ipAddress] The IP address associated - * with the public IP address resource. - * @property {object} [publicIPAddress.publicIPPrefix] The Public IP Prefix - * this Public IP Address should be allocated from. - * @property {string} [publicIPAddress.publicIPPrefix.id] Resource ID. - * @property {number} [publicIPAddress.idleTimeoutInMinutes] The idle timeout - * of the public IP address. - * @property {string} [publicIPAddress.resourceGuid] The resource GUID property - * of the public IP resource. - * @property {string} [publicIPAddress.provisioningState] The provisioning - * state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', - * and 'Failed'. - * @property {string} [publicIPAddress.etag] A unique read-only string that - * changes whenever the resource is updated. - * @property {array} [publicIPAddress.zones] A list of availability zones - * denoting the IP allocated for the resource needs to come from. - * @property {object} [publicIPPrefix] The reference of the Public IP Prefix - * resource. - * @property {string} [publicIPPrefix.id] Resource ID. - * @property {string} [provisioningState] Gets the provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [name] The 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. - * @property {array} [zones] A list of availability zones denoting the IP - * allocated for the resource needs to come from. - */ -export interface FrontendIPConfiguration extends SubResource { - readonly inboundNatRules?: SubResource[]; - readonly inboundNatPools?: SubResource[]; - readonly outboundRules?: SubResource[]; - readonly loadBalancingRules?: SubResource[]; - privateIPAddress?: string; - privateIPAllocationMethod?: string; - subnet?: Subnet; - publicIPAddress?: PublicIPAddress; - publicIPPrefix?: SubResource; - provisioningState?: string; - name?: string; - etag?: string; - zones?: string[]; -} - -/** - * @class - * Initializes a new instance of the VirtualNetworkTap class. - * @constructor - * Virtual Network Tap resource - * - * @property {array} [networkInterfaceTapConfigurations] Specifies the list of - * resource IDs for the network interface IP configuration that needs to be - * tapped. - * @property {string} [resourceGuid] The resourceGuid property of the virtual - * network tap. - * @property {string} [provisioningState] The provisioning state of the virtual - * network tap. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * @property {object} [destinationNetworkInterfaceIPConfiguration] The - * reference to the private IP Address of the collector nic that will receive - * the tap - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.virtualNetworkTaps] The - * reference to Virtual Network Taps. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.applicationGatewayBackendAddressPools] - * The reference of ApplicationGatewayBackendAddressPool resource. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.loadBalancerBackendAddressPools] - * The reference of LoadBalancerBackendAddressPool resource. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.loadBalancerInboundNatRules] A - * list of references of LoadBalancerInboundNatRules. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.privateIPAddress] Private IP - * address of the IP configuration. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.privateIPAllocationMethod] - * Defines how a private IP address is assigned. Possible values are: 'Static' - * and 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.privateIPAddressVersion] - * Available from Api-Version 2016-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * @property {object} [destinationNetworkInterfaceIPConfiguration.subnet] - * Subnet bound to the IP configuration. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.subnet.addressPrefix] The - * address prefix for the subnet. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.addressPrefixes] List of - * address prefixes for the subnet. - * @property {object} - * [destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup] The - * reference of the NetworkSecurityGroup resource. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.networkInterfaces] - * A collection of references to network interfaces. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.subnets] - * A collection of references to subnets. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [destinationNetworkInterfaceIPConfiguration.subnet.routeTable] The reference - * of the RouteTable resource. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.routeTable.subnets] A - * collection of references to subnets. - * @property {boolean} - * [destinationNetworkInterfaceIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.subnet.routeTable.etag] Gets a - * unique read-only string that changes whenever the resource is updated. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.serviceEndpoints] An - * array of service endpoints. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.interfaceEndpoints] An - * array of references to interface endpoints - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.ipConfigurations] Gets an - * array of references to the network interface IP configurations using subnet. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.ipConfigurationProfiles] - * Array of IP configuration profiles which reference this subnet. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.delegations] Gets an - * array of references to the delegations on the subnet. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.subnet.purpose] A read-only - * string identifying the intention of use for this subnet based on delegations - * and other user-defined properties. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.subnet.provisioningState] The - * provisioning state of the resource. - * @property {string} [destinationNetworkInterfaceIPConfiguration.subnet.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * @property {string} [destinationNetworkInterfaceIPConfiguration.subnet.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {boolean} [destinationNetworkInterfaceIPConfiguration.primary] - * Gets whether this is a primary customer address on the network interface. - * @property {object} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress] Public IP - * address bound to the IP configuration. - * @property {object} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.sku] The public - * IP address SKU. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.sku.name] Name - * of a public IP address SKU. Possible values include: 'Basic', 'Standard' - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * @property {object} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration] - * The IP configuration associated with the public IP address. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.privateIPAllocationMethod] - * The private IP allocation method. Possible values are 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {object} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet] - * The reference of the subnet resource. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * @property {object} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] - * A collection of references to network interfaces. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.subnets] - * A collection of references to subnets. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.subnets] - * A collection of references to subnets. - * @property {boolean} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.interfaceEndpoints] - * An array of references to interface endpoints - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurations] - * Gets an array of references to the network interface IP configurations using - * subnet. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurationProfiles] - * Array of IP configuration profiles which reference this subnet. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.purpose] - * A read-only string identifying the intention of use for this subnet based on - * delegations and other user-defined properties. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.publicIPAddress] - * The reference of the public IP resource. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.dnsSettings] The - * FQDN of the DNS record associated with the public IP address. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is specified, - * an A DNS record is created for the public IP in the Microsoft Azure DNS - * system. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and the - * regionalized DNS zone. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipTags] The list - * of tags associated with the public IP address. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipAddress] The - * IP address associated with the public IP address resource. - * @property {object} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.publicIPPrefix.id] - * Resource ID. - * @property {number} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.etag] A unique - * read-only string that changes whenever the resource is updated. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.zones] A list of - * availability zones denoting the IP allocated for the resource needs to come - * from. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.applicationSecurityGroups] - * Application security groups in which the IP configuration is included. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.provisioningState] The - * provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [destinationNetworkInterfaceIPConfiguration.name] The - * name of the resource that is unique within a resource group. This name can - * be used to access the resource. - * @property {string} [destinationNetworkInterfaceIPConfiguration.etag] A - * unique read-only string that changes whenever the resource is updated. - * @property {object} [destinationLoadBalancerFrontEndIPConfiguration] The - * reference to the private IP address on the internal Load Balancer that will - * receive the tap - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.inboundNatRules] Read only. - * Inbound rules URIs that use this frontend IP. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.inboundNatPools] Read only. - * Inbound pools URIs that use this frontend IP. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.outboundRules] Read only. - * Outbound rules URIs that use this frontend IP. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.loadBalancingRules] Gets - * load balancing rules URIs that use this frontend IP. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.privateIPAddress] The - * private IP address of the IP configuration. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.privateIPAllocationMethod] - * The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {object} [destinationLoadBalancerFrontEndIPConfiguration.subnet] - * The reference of the subnet resource. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefix] The - * address prefix for the subnet. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefixes] List - * of address prefixes for the subnet. - * @property {object} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.networkInterfaces] - * A collection of references to network interfaces. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.subnets] - * A collection of references to subnets. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable] The - * reference of the RouteTable resource. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.subnets] A - * collection of references to subnets. - * @property {boolean} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.etag] Gets - * a unique read-only string that changes whenever the resource is updated. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpoints] An - * array of service endpoints. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.interfaceEndpoints] - * An array of references to interface endpoints - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.ipConfigurations] - * Gets an array of references to the network interface IP configurations using - * subnet. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.ipConfigurationProfiles] - * Array of IP configuration profiles which reference this subnet. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.delegations] Gets an - * array of references to the delegations on the subnet. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.purpose] A read-only - * string identifying the intention of use for this subnet based on delegations - * and other user-defined properties. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.etag] A unique - * read-only string that changes whenever the resource is updated. - * @property {object} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress] The - * reference of the Public IP resource. - * @property {object} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku] The - * public IP address SKU. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku.name] - * Name of a public IP address SKU. Possible values include: 'Basic', - * 'Standard' - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * @property {object} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration] - * The IP configuration associated with the public IP address. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.privateIPAllocationMethod] - * The private IP allocation method. Possible values are 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {object} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet] - * The reference of the subnet resource. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * @property {object} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] - * A collection of references to network interfaces. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.subnets] - * A collection of references to subnets. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.subnets] - * A collection of references to subnets. - * @property {boolean} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.interfaceEndpoints] - * An array of references to interface endpoints - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurations] - * Gets an array of references to the network interface IP configurations using - * subnet. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurationProfiles] - * Array of IP configuration profiles which reference this subnet. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.purpose] - * A read-only string identifying the intention of use for this subnet based on - * delegations and other user-defined properties. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.publicIPAddress] - * The reference of the public IP resource. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is specified, - * an A DNS record is created for the public IP in the Microsoft Azure DNS - * system. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and the - * regionalized DNS zone. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipTags] The - * list of tags associated with the public IP address. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipAddress] - * The IP address associated with the public IP address resource. - * @property {object} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix.id] - * Resource ID. - * @property {number} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.etag] A - * unique read-only string that changes whenever the resource is updated. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.zones] A - * list of availability zones denoting the IP allocated for the resource needs - * to come from. - * @property {object} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix] The - * reference of the Public IP Prefix resource. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix.id] Resource - * ID. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [destinationLoadBalancerFrontEndIPConfiguration.name] The - * name of the resource that is unique within a resource group. This name can - * be used to access the resource. - * @property {string} [destinationLoadBalancerFrontEndIPConfiguration.etag] A - * unique read-only string that changes whenever the resource is updated. - * @property {array} [destinationLoadBalancerFrontEndIPConfiguration.zones] A - * list of availability zones denoting the IP allocated for the resource needs - * to come from. - * @property {number} [destinationPort] The VXLAN destination port that will - * receive the tapped traffic. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ -export interface VirtualNetworkTap extends Resource { - readonly networkInterfaceTapConfigurations?: NetworkInterfaceTapConfiguration[]; - readonly resourceGuid?: string; - readonly provisioningState?: string; - destinationNetworkInterfaceIPConfiguration?: NetworkInterfaceIPConfiguration; - destinationLoadBalancerFrontEndIPConfiguration?: FrontendIPConfiguration; - destinationPort?: number; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the BackendAddressPool class. - * @constructor - * Pool of backend IP addresses. - * - * @property {array} [backendIPConfigurations] Gets collection of references to - * IP addresses defined in network interfaces. - * @property {array} [loadBalancingRules] Gets load balancing rules that use - * this backend address pool. - * @property {object} [outboundRule] Gets outbound rules that use this backend - * address pool. - * @property {string} [outboundRule.id] Resource ID. - * @property {string} [provisioningState] Get provisioning state of the public - * IP resource. Possible values are: '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. - */ -export interface BackendAddressPool extends SubResource { - readonly backendIPConfigurations?: NetworkInterfaceIPConfiguration[]; - readonly loadBalancingRules?: SubResource[]; - readonly outboundRule?: SubResource; - provisioningState?: string; - name?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the InboundNatRule class. - * @constructor - * Inbound NAT rule of the load balancer. - * - * @property {object} [frontendIPConfiguration] A reference to frontend IP - * addresses. - * @property {string} [frontendIPConfiguration.id] Resource ID. - * @property {object} [backendIPConfiguration] A reference to a private IP - * address defined on a network interface of a VM. Traffic sent to the frontend - * port of each of the frontend IP configurations is forwarded to the backend - * IP. - * @property {array} [backendIPConfiguration.virtualNetworkTaps] The reference - * to Virtual Network Taps. - * @property {array} - * [backendIPConfiguration.applicationGatewayBackendAddressPools] The reference - * of ApplicationGatewayBackendAddressPool resource. - * @property {array} [backendIPConfiguration.loadBalancerBackendAddressPools] - * The reference of LoadBalancerBackendAddressPool resource. - * @property {array} [backendIPConfiguration.loadBalancerInboundNatRules] A - * list of references of LoadBalancerInboundNatRules. - * @property {string} [backendIPConfiguration.privateIPAddress] Private IP - * address of the IP configuration. - * @property {string} [backendIPConfiguration.privateIPAllocationMethod] - * Defines how a private IP address is assigned. Possible values are: 'Static' - * and 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {string} [backendIPConfiguration.privateIPAddressVersion] - * Available from Api-Version 2016-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * @property {object} [backendIPConfiguration.subnet] Subnet bound to the IP - * configuration. - * @property {string} [backendIPConfiguration.subnet.addressPrefix] The address - * prefix for the subnet. - * @property {array} [backendIPConfiguration.subnet.addressPrefixes] List of - * address prefixes for the subnet. - * @property {object} [backendIPConfiguration.subnet.networkSecurityGroup] The - * reference of the NetworkSecurityGroup resource. - * @property {array} - * [backendIPConfiguration.subnet.networkSecurityGroup.securityRules] A - * collection of security rules of the network security group. - * @property {array} - * [backendIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * @property {array} - * [backendIPConfiguration.subnet.networkSecurityGroup.networkInterfaces] A - * collection of references to network interfaces. - * @property {array} - * [backendIPConfiguration.subnet.networkSecurityGroup.subnets] A collection of - * references to subnets. - * @property {string} - * [backendIPConfiguration.subnet.networkSecurityGroup.resourceGuid] The - * resource GUID property of the network security group resource. - * @property {string} - * [backendIPConfiguration.subnet.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [backendIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} [backendIPConfiguration.subnet.routeTable] The reference - * of the RouteTable resource. - * @property {array} [backendIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * @property {array} [backendIPConfiguration.subnet.routeTable.subnets] A - * collection of references to subnets. - * @property {boolean} - * [backendIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] Gets - * or sets whether to disable the routes learned by BGP on that route table. - * True means disable. - * @property {string} - * [backendIPConfiguration.subnet.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [backendIPConfiguration.subnet.routeTable.etag] Gets a - * unique read-only string that changes whenever the resource is updated. - * @property {array} [backendIPConfiguration.subnet.serviceEndpoints] An array - * of service endpoints. - * @property {array} [backendIPConfiguration.subnet.serviceEndpointPolicies] An - * array of service endpoint policies. - * @property {array} [backendIPConfiguration.subnet.interfaceEndpoints] An - * array of references to interface endpoints - * @property {array} [backendIPConfiguration.subnet.ipConfigurations] Gets an - * array of references to the network interface IP configurations using subnet. - * @property {array} [backendIPConfiguration.subnet.ipConfigurationProfiles] - * Array of IP configuration profiles which reference this subnet. - * @property {array} [backendIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * @property {array} [backendIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * @property {array} [backendIPConfiguration.subnet.delegations] Gets an array - * of references to the delegations on the subnet. - * @property {string} [backendIPConfiguration.subnet.purpose] A read-only - * string identifying the intention of use for this subnet based on delegations - * and other user-defined properties. - * @property {string} [backendIPConfiguration.subnet.provisioningState] The - * provisioning state of the resource. - * @property {string} [backendIPConfiguration.subnet.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * @property {string} [backendIPConfiguration.subnet.etag] A unique read-only - * string that changes whenever the resource is updated. - * @property {boolean} [backendIPConfiguration.primary] Gets whether this is a - * primary customer address on the network interface. - * @property {object} [backendIPConfiguration.publicIPAddress] Public IP - * address bound to the IP configuration. - * @property {object} [backendIPConfiguration.publicIPAddress.sku] The public - * IP address SKU. - * @property {string} [backendIPConfiguration.publicIPAddress.sku.name] Name of - * a public IP address SKU. Possible values include: 'Basic', 'Standard' - * @property {string} - * [backendIPConfiguration.publicIPAddress.publicIPAllocationMethod] The public - * IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' - * @property {string} - * [backendIPConfiguration.publicIPAddress.publicIPAddressVersion] The public - * IP address version. Possible values are: 'IPv4' and 'IPv6'. Possible values - * include: 'IPv4', 'IPv6' - * @property {object} [backendIPConfiguration.publicIPAddress.ipConfiguration] - * The IP configuration associated with the public IP address. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.privateIPAllocationMethod] - * The private IP allocation method. Possible values are 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {object} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet] The - * reference of the subnet resource. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * @property {object} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] - * A collection of references to network interfaces. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.subnets] - * A collection of references to subnets. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.subnets] - * A collection of references to subnets. - * @property {boolean} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.interfaceEndpoints] - * An array of references to interface endpoints - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurations] - * Gets an array of references to the network interface IP configurations using - * subnet. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurationProfiles] - * Array of IP configuration profiles which reference this subnet. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * @property {array} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.purpose] A - * read-only string identifying the intention of use for this subnet based on - * delegations and other user-defined properties. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.name] The - * name of the resource that is unique within a resource group. This name can - * be used to access the resource. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.subnet.etag] A - * unique read-only string that changes whenever the resource is updated. - * @property {object} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.publicIPAddress] The - * reference of the public IP resource. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.name] The name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. - * @property {string} - * [backendIPConfiguration.publicIPAddress.ipConfiguration.etag] A unique - * read-only string that changes whenever the resource is updated. - * @property {object} [backendIPConfiguration.publicIPAddress.dnsSettings] The - * FQDN of the DNS record associated with the public IP address. - * @property {string} - * [backendIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] Gets or - * sets the Domain name label.The concatenation of the domain name label and - * the regionalized DNS zone make up the fully qualified domain name associated - * with the public IP address. If a domain name label is specified, an A DNS - * record is created for the public IP in the Microsoft Azure DNS system. - * @property {string} [backendIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and the - * regionalized DNS zone. - * @property {string} - * [backendIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] Gets or - * Sets the Reverse FQDN. A user-visible, fully qualified domain name that - * resolves to this public IP address. If the reverseFqdn is specified, then a - * PTR DNS record is created pointing from the IP address in the in-addr.arpa - * domain to the reverse FQDN. - * @property {array} [backendIPConfiguration.publicIPAddress.ipTags] The list - * of tags associated with the public IP address. - * @property {string} [backendIPConfiguration.publicIPAddress.ipAddress] The IP - * address associated with the public IP address resource. - * @property {object} [backendIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * @property {string} - * [backendIPConfiguration.publicIPAddress.publicIPPrefix.id] Resource ID. - * @property {number} - * [backendIPConfiguration.publicIPAddress.idleTimeoutInMinutes] The idle - * timeout of the public IP address. - * @property {string} [backendIPConfiguration.publicIPAddress.resourceGuid] The - * resource GUID property of the public IP resource. - * @property {string} - * [backendIPConfiguration.publicIPAddress.provisioningState] The provisioning - * state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', - * and 'Failed'. - * @property {string} [backendIPConfiguration.publicIPAddress.etag] A unique - * read-only string that changes whenever the resource is updated. - * @property {array} [backendIPConfiguration.publicIPAddress.zones] A list of - * availability zones denoting the IP allocated for the resource needs to come - * from. - * @property {array} [backendIPConfiguration.applicationSecurityGroups] - * Application security groups in which the IP configuration is included. - * @property {string} [backendIPConfiguration.provisioningState] The - * provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [backendIPConfiguration.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * @property {string} [backendIPConfiguration.etag] A unique read-only string - * that changes whenever the resource is updated. - * @property {string} [protocol] Possible values include: 'Udp', 'Tcp', 'All' - * @property {number} [frontendPort] The port for the external endpoint. Port - * numbers for each rule must be unique within the Load Balancer. Acceptable - * values range from 1 to 65534. - * @property {number} [backendPort] The port used for the internal endpoint. - * Acceptable values range from 1 to 65535. - * @property {number} [idleTimeoutInMinutes] The timeout for the TCP idle - * connection. The value can be set between 4 and 30 minutes. The default value - * is 4 minutes. This element is only used when the protocol is set to TCP. - * @property {boolean} [enableFloatingIP] Configures a virtual machine's - * endpoint for the floating IP capability required to configure a SQL AlwaysOn - * Availability Group. This setting is required when using the SQL AlwaysOn - * Availability Groups in SQL server. This setting can't be changed after you - * create the endpoint. - * @property {boolean} [enableTcpReset] Receive bidirectional TCP Reset on TCP - * flow idle timeout or unexpected connection termination. This element is only - * used when the protocol is set to TCP. - * @property {string} [provisioningState] Gets the provisioning state of the - * public IP resource. Possible values are: '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. - */ -export interface InboundNatRule extends SubResource { - frontendIPConfiguration?: SubResource; - readonly backendIPConfiguration?: NetworkInterfaceIPConfiguration; - protocol?: string; - frontendPort?: number; - backendPort?: number; - idleTimeoutInMinutes?: number; - enableFloatingIP?: boolean; - enableTcpReset?: boolean; - provisioningState?: string; - name?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the NetworkInterfaceIPConfiguration class. - * @constructor - * IPConfiguration in a network interface. - * - * @property {array} [virtualNetworkTaps] The reference to Virtual Network - * Taps. - * @property {array} [applicationGatewayBackendAddressPools] The reference of - * ApplicationGatewayBackendAddressPool resource. - * @property {array} [loadBalancerBackendAddressPools] The reference of - * LoadBalancerBackendAddressPool resource. - * @property {array} [loadBalancerInboundNatRules] A list of references of - * LoadBalancerInboundNatRules. - * @property {string} [privateIPAddress] Private IP address of the IP - * configuration. - * @property {string} [privateIPAllocationMethod] Defines how a private IP - * address is assigned. Possible values are: 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' - * @property {string} [privateIPAddressVersion] Available from Api-Version - * 2016-03-30 onwards, it represents whether the specific ipconfiguration is - * IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and - * 'IPv6'. Possible values include: 'IPv4', 'IPv6' - * @property {object} [subnet] Subnet bound to the IP configuration. - * @property {string} [subnet.addressPrefix] The address prefix for the subnet. - * @property {array} [subnet.addressPrefixes] List of address prefixes for the - * subnet. - * @property {object} [subnet.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * @property {array} [subnet.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * @property {array} [subnet.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * @property {array} [subnet.networkSecurityGroup.networkInterfaces] A - * collection of references to network interfaces. - * @property {array} [subnet.networkSecurityGroup.subnets] A collection of - * references to subnets. - * @property {string} [subnet.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. - * @property {string} [subnet.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [subnet.networkSecurityGroup.etag] A unique read-only - * string that changes whenever the resource is updated. - * @property {object} [subnet.routeTable] The reference of the RouteTable - * resource. - * @property {array} [subnet.routeTable.routes] Collection of routes contained - * within a route table. - * @property {array} [subnet.routeTable.subnets] A collection of references to - * subnets. - * @property {boolean} [subnet.routeTable.disableBgpRoutePropagation] Gets or - * sets whether to disable the routes learned by BGP on that route table. True - * means disable. - * @property {string} [subnet.routeTable.provisioningState] The provisioning - * state of the resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [subnet.routeTable.etag] Gets a unique read-only string - * that changes whenever the resource is updated. - * @property {array} [subnet.serviceEndpoints] An array of service endpoints. - * @property {array} [subnet.serviceEndpointPolicies] An array of service - * endpoint policies. - * @property {array} [subnet.interfaceEndpoints] An array of references to - * interface endpoints - * @property {array} [subnet.ipConfigurations] Gets an array of references to - * the network interface IP configurations using subnet. - * @property {array} [subnet.ipConfigurationProfiles] Array of IP configuration - * profiles which reference this subnet. - * @property {array} [subnet.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * @property {array} [subnet.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * @property {array} [subnet.delegations] Gets an array of references to the - * delegations on the subnet. - * @property {string} [subnet.purpose] A read-only string identifying the - * intention of use for this subnet based on delegations and other user-defined - * properties. - * @property {string} [subnet.provisioningState] The provisioning state of the - * resource. - * @property {string} [subnet.name] The name of the resource that is unique - * within a resource group. This name can be used to access the resource. - * @property {string} [subnet.etag] A unique read-only string that changes - * whenever the resource is updated. - * @property {boolean} [primary] Gets whether this is a primary customer - * address on the network interface. - * @property {object} [publicIPAddress] Public IP address bound to the IP - * configuration. - * @property {object} [publicIPAddress.sku] The public IP address SKU. - * @property {string} [publicIPAddress.sku.name] Name of a public IP address - * SKU. Possible values include: 'Basic', 'Standard' - * @property {string} [publicIPAddress.publicIPAllocationMethod] The public IP - * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' - * @property {string} [publicIPAddress.publicIPAddressVersion] The public IP - * address version. Possible values are: 'IPv4' and 'IPv6'. Possible values - * include: 'IPv4', 'IPv6' - * @property {object} [publicIPAddress.ipConfiguration] The IP configuration - * associated with the public IP address. - * @property {string} [publicIPAddress.ipConfiguration.privateIPAddress] The - * private IP address of the IP configuration. - * @property {string} - * [publicIPAddress.ipConfiguration.privateIPAllocationMethod] The private IP - * allocation method. Possible values are 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' - * @property {object} [publicIPAddress.ipConfiguration.subnet] The reference of - * the subnet resource. - * @property {string} [publicIPAddress.ipConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * @property {array} [publicIPAddress.ipConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * @property {object} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup] The reference - * of the NetworkSecurityGroup resource. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] - * A collection of references to network interfaces. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.subnets] A - * collection of references to subnets. - * @property {string} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * @property {string} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.etag] A unique - * read-only string that changes whenever the resource is updated. - * @property {object} [publicIPAddress.ipConfiguration.subnet.routeTable] The - * reference of the RouteTable resource. - * @property {array} [publicIPAddress.ipConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.routeTable.subnets] A collection of - * references to subnets. - * @property {boolean} - * [publicIPAddress.ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * @property {string} - * [publicIPAddress.ipConfiguration.subnet.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [publicIPAddress.ipConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * @property {array} [publicIPAddress.ipConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.serviceEndpointPolicies] An array of - * service endpoint policies. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.interfaceEndpoints] An array of - * references to interface endpoints - * @property {array} [publicIPAddress.ipConfiguration.subnet.ipConfigurations] - * Gets an array of references to the network interface IP configurations using - * subnet. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.ipConfigurationProfiles] Array of IP - * configuration profiles which reference this subnet. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.resourceNavigationLinks] Gets an - * array of references to the external resources using subnet. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.serviceAssociationLinks] Gets an - * array of references to services injecting into this subnet. - * @property {array} [publicIPAddress.ipConfiguration.subnet.delegations] Gets - * an array of references to the delegations on the subnet. - * @property {string} [publicIPAddress.ipConfiguration.subnet.purpose] A - * read-only string identifying the intention of use for this subnet based on - * delegations and other user-defined properties. - * @property {string} - * [publicIPAddress.ipConfiguration.subnet.provisioningState] The provisioning - * state of the resource. - * @property {string} [publicIPAddress.ipConfiguration.subnet.name] The name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. - * @property {string} [publicIPAddress.ipConfiguration.subnet.etag] A unique - * read-only string that changes whenever the resource is updated. - * @property {object} [publicIPAddress.ipConfiguration.publicIPAddress] The - * reference of the public IP resource. - * @property {string} [publicIPAddress.ipConfiguration.provisioningState] Gets - * the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [publicIPAddress.ipConfiguration.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * @property {string} [publicIPAddress.ipConfiguration.etag] A unique read-only - * string that changes whenever the resource is updated. - * @property {object} [publicIPAddress.dnsSettings] The FQDN of the DNS record - * associated with the public IP address. - * @property {string} [publicIPAddress.dnsSettings.domainNameLabel] Gets or - * sets the Domain name label.The concatenation of the domain name label and - * the regionalized DNS zone make up the fully qualified domain name associated - * with the public IP address. If a domain name label is specified, an A DNS - * record is created for the public IP in the Microsoft Azure DNS system. - * @property {string} [publicIPAddress.dnsSettings.fqdn] Gets the FQDN, Fully - * qualified domain name of the A DNS record associated with the public IP. - * This is the concatenation of the domainNameLabel and the regionalized DNS - * zone. - * @property {string} [publicIPAddress.dnsSettings.reverseFqdn] Gets or Sets - * the Reverse FQDN. A user-visible, fully qualified domain name that resolves - * to this public IP address. If the reverseFqdn is specified, then a PTR DNS - * record is created pointing from the IP address in the in-addr.arpa domain to - * the reverse FQDN. - * @property {array} [publicIPAddress.ipTags] The list of tags associated with - * the public IP address. - * @property {string} [publicIPAddress.ipAddress] The IP address associated - * with the public IP address resource. - * @property {object} [publicIPAddress.publicIPPrefix] The Public IP Prefix - * this Public IP Address should be allocated from. - * @property {string} [publicIPAddress.publicIPPrefix.id] Resource ID. - * @property {number} [publicIPAddress.idleTimeoutInMinutes] The idle timeout - * of the public IP address. - * @property {string} [publicIPAddress.resourceGuid] The resource GUID property - * of the public IP resource. - * @property {string} [publicIPAddress.provisioningState] The provisioning - * state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', - * and 'Failed'. - * @property {string} [publicIPAddress.etag] A unique read-only string that - * changes whenever the resource is updated. - * @property {array} [publicIPAddress.zones] A list of availability zones - * denoting the IP allocated for the resource needs to come from. - * @property {array} [applicationSecurityGroups] Application security groups in - * which the IP configuration is included. - * @property {string} [provisioningState] The provisioning state of the network - * interface IP configuration. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [name] The 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. - */ -export interface NetworkInterfaceIPConfiguration extends SubResource { - virtualNetworkTaps?: VirtualNetworkTap[]; - applicationGatewayBackendAddressPools?: ApplicationGatewayBackendAddressPool[]; - loadBalancerBackendAddressPools?: BackendAddressPool[]; - loadBalancerInboundNatRules?: InboundNatRule[]; - privateIPAddress?: string; - privateIPAllocationMethod?: string; - privateIPAddressVersion?: string; - subnet?: Subnet; - primary?: boolean; - publicIPAddress?: PublicIPAddress; - applicationSecurityGroups?: ApplicationSecurityGroup[]; - provisioningState?: string; - name?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayBackendAddress class. - * @constructor - * Backend address of an application gateway. - * - * @property {string} [fqdn] Fully qualified domain name (FQDN). - * @property {string} [ipAddress] IP address - */ -export interface ApplicationGatewayBackendAddress { - fqdn?: string; - ipAddress?: string; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayBackendAddressPool class. - * @constructor - * Backend Address Pool of an application gateway. - * - * @property {array} [backendIPConfigurations] Collection of references to IPs - * defined in network interfaces. - * @property {array} [backendAddresses] Backend addresses - * @property {string} [provisioningState] Provisioning state of the backend - * address pool resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [name] Name of the backend address pool that is unique - * within an Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ -export interface ApplicationGatewayBackendAddressPool extends SubResource { - backendIPConfigurations?: NetworkInterfaceIPConfiguration[]; - backendAddresses?: ApplicationGatewayBackendAddress[]; - provisioningState?: string; - name?: string; - etag?: string; - type?: string; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayConnectionDraining class. - * @constructor - * Connection draining allows open connections to a backend server to be active - * for a specified time after the backend server got removed from the - * configuration. - * - * @property {boolean} enabled Whether connection draining is enabled or not. - * @property {number} drainTimeoutInSec The number of seconds connection - * draining is active. Acceptable values are from 1 second to 3600 seconds. - */ -export interface ApplicationGatewayConnectionDraining { - enabled: boolean; - drainTimeoutInSec: number; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayBackendHttpSettings class. - * @constructor - * Backend address pool settings of an application gateway. - * - * @property {number} [port] The destination port on the backend. - * @property {string} [protocol] The protocol used to communicate with the - * backend. Possible values are 'Http' and 'Https'. Possible values include: - * 'Http', 'Https' - * @property {string} [cookieBasedAffinity] Cookie based affinity. Possible - * values include: 'Enabled', 'Disabled' - * @property {number} [requestTimeout] Request timeout in seconds. Application - * Gateway will fail the request if response is not received within - * RequestTimeout. Acceptable values are from 1 second to 86400 seconds. - * @property {object} [probe] Probe resource of an application gateway. - * @property {string} [probe.id] Resource ID. - * @property {array} [authenticationCertificates] Array of references to - * application gateway authentication certificates. - * @property {array} [trustedRootCertificates] Array of references to - * application gateway trusted root certificates. - * @property {object} [connectionDraining] Connection draining of the backend - * http settings resource. - * @property {boolean} [connectionDraining.enabled] Whether connection draining - * is enabled or not. - * @property {number} [connectionDraining.drainTimeoutInSec] The number of - * seconds connection draining is active. Acceptable values are from 1 second - * to 3600 seconds. - * @property {string} [hostName] Host header to be sent to the backend servers. - * @property {boolean} [pickHostNameFromBackendAddress] Whether to pick host - * header should be picked from the host name of the backend server. Default - * value is false. - * @property {string} [affinityCookieName] Cookie name to use for the affinity - * cookie. - * @property {boolean} [probeEnabled] Whether the probe is enabled. Default - * value is false. - * @property {string} [path] Path which should be used as a prefix for all HTTP - * requests. Null means no path will be prefixed. Default value is null. - * @property {string} [provisioningState] Provisioning state of the backend - * http settings resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [name] Name of the backend http settings that is unique - * within an Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ -export interface ApplicationGatewayBackendHttpSettings extends SubResource { - port?: number; - protocol?: string; - cookieBasedAffinity?: string; - requestTimeout?: number; - probe?: SubResource; - authenticationCertificates?: SubResource[]; - trustedRootCertificates?: SubResource[]; - connectionDraining?: ApplicationGatewayConnectionDraining; - hostName?: string; - pickHostNameFromBackendAddress?: boolean; - affinityCookieName?: string; - probeEnabled?: boolean; - path?: string; - provisioningState?: string; - name?: string; - etag?: string; - type?: string; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayBackendHealthServer class. - * @constructor - * Application gateway backendhealth http settings. - * - * @property {string} [address] IP address or FQDN of backend server. - * @property {object} [ipConfiguration] Reference of IP configuration of - * backend server. - * @property {array} [ipConfiguration.virtualNetworkTaps] The reference to - * Virtual Network Taps. - * @property {array} [ipConfiguration.applicationGatewayBackendAddressPools] - * The reference of ApplicationGatewayBackendAddressPool resource. - * @property {array} [ipConfiguration.loadBalancerBackendAddressPools] The - * reference of LoadBalancerBackendAddressPool resource. - * @property {array} [ipConfiguration.loadBalancerInboundNatRules] A list of - * references of LoadBalancerInboundNatRules. - * @property {string} [ipConfiguration.privateIPAddress] Private IP address of - * the IP configuration. - * @property {string} [ipConfiguration.privateIPAllocationMethod] Defines how a - * private IP address is assigned. Possible values are: 'Static' and 'Dynamic'. - * Possible values include: 'Static', 'Dynamic' - * @property {string} [ipConfiguration.privateIPAddressVersion] Available from - * Api-Version 2016-03-30 onwards, it represents whether the specific - * ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values - * are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' - * @property {object} [ipConfiguration.subnet] Subnet bound to the IP - * configuration. - * @property {string} [ipConfiguration.subnet.addressPrefix] The address prefix - * for the subnet. - * @property {array} [ipConfiguration.subnet.addressPrefixes] List of address - * prefixes for the subnet. - * @property {object} [ipConfiguration.subnet.networkSecurityGroup] The - * reference of the NetworkSecurityGroup resource. - * @property {array} - * [ipConfiguration.subnet.networkSecurityGroup.securityRules] A collection of - * security rules of the network security group. - * @property {array} - * [ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * @property {array} - * [ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] A collection - * of references to network interfaces. - * @property {array} [ipConfiguration.subnet.networkSecurityGroup.subnets] A - * collection of references to subnets. - * @property {string} - * [ipConfiguration.subnet.networkSecurityGroup.resourceGuid] The resource GUID - * property of the network security group resource. - * @property {string} - * [ipConfiguration.subnet.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [ipConfiguration.subnet.networkSecurityGroup.etag] A - * unique read-only string that changes whenever the resource is updated. - * @property {object} [ipConfiguration.subnet.routeTable] The reference of the - * RouteTable resource. - * @property {array} [ipConfiguration.subnet.routeTable.routes] Collection of - * routes contained within a route table. - * @property {array} [ipConfiguration.subnet.routeTable.subnets] A collection - * of references to subnets. - * @property {boolean} - * [ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] Gets or sets - * whether to disable the routes learned by BGP on that route table. True means - * disable. - * @property {string} [ipConfiguration.subnet.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [ipConfiguration.subnet.routeTable.etag] Gets a unique - * read-only string that changes whenever the resource is updated. - * @property {array} [ipConfiguration.subnet.serviceEndpoints] An array of - * service endpoints. - * @property {array} [ipConfiguration.subnet.serviceEndpointPolicies] An array - * of service endpoint policies. - * @property {array} [ipConfiguration.subnet.interfaceEndpoints] An array of - * references to interface endpoints - * @property {array} [ipConfiguration.subnet.ipConfigurations] Gets an array of - * references to the network interface IP configurations using subnet. - * @property {array} [ipConfiguration.subnet.ipConfigurationProfiles] Array of - * IP configuration profiles which reference this subnet. - * @property {array} [ipConfiguration.subnet.resourceNavigationLinks] Gets an - * array of references to the external resources using subnet. - * @property {array} [ipConfiguration.subnet.serviceAssociationLinks] Gets an - * array of references to services injecting into this subnet. - * @property {array} [ipConfiguration.subnet.delegations] Gets an array of - * references to the delegations on the subnet. - * @property {string} [ipConfiguration.subnet.purpose] A read-only string - * identifying the intention of use for this subnet based on delegations and - * other user-defined properties. - * @property {string} [ipConfiguration.subnet.provisioningState] The - * provisioning state of the resource. - * @property {string} [ipConfiguration.subnet.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * @property {string} [ipConfiguration.subnet.etag] A unique read-only string - * that changes whenever the resource is updated. - * @property {boolean} [ipConfiguration.primary] Gets whether this is a primary - * customer address on the network interface. - * @property {object} [ipConfiguration.publicIPAddress] Public IP address bound - * to the IP configuration. - * @property {object} [ipConfiguration.publicIPAddress.sku] The public IP - * address SKU. - * @property {string} [ipConfiguration.publicIPAddress.sku.name] Name of a - * public IP address SKU. Possible values include: 'Basic', 'Standard' - * @property {string} - * [ipConfiguration.publicIPAddress.publicIPAllocationMethod] The public IP - * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' - * @property {string} [ipConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * @property {object} [ipConfiguration.publicIPAddress.ipConfiguration] The IP - * configuration associated with the public IP address. - * @property {string} - * [ipConfiguration.publicIPAddress.ipConfiguration.privateIPAddress] The - * private IP address of the IP configuration. - * @property {string} - * [ipConfiguration.publicIPAddress.ipConfiguration.privateIPAllocationMethod] - * The private IP allocation method. Possible values are 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {object} [ipConfiguration.publicIPAddress.ipConfiguration.subnet] - * The reference of the subnet resource. - * @property {string} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefix] The - * address prefix for the subnet. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * @property {object} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] - * A collection of references to network interfaces. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.subnets] - * A collection of references to subnets. - * @property {string} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * @property {string} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable] The - * reference of the RouteTable resource. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.subnets] - * A collection of references to subnets. - * @property {boolean} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * @property {string} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpoints] An - * array of service endpoints. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.interfaceEndpoints] - * An array of references to interface endpoints - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurations] - * Gets an array of references to the network interface IP configurations using - * subnet. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurationProfiles] - * Array of IP configuration profiles which reference this subnet. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * @property {array} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.delegations] Gets an - * array of references to the delegations on the subnet. - * @property {string} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.purpose] A read-only - * string identifying the intention of use for this subnet based on delegations - * and other user-defined properties. - * @property {string} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * @property {string} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.name] The name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. - * @property {string} - * [ipConfiguration.publicIPAddress.ipConfiguration.subnet.etag] A unique - * read-only string that changes whenever the resource is updated. - * @property {object} - * [ipConfiguration.publicIPAddress.ipConfiguration.publicIPAddress] The - * reference of the public IP resource. - * @property {string} - * [ipConfiguration.publicIPAddress.ipConfiguration.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [ipConfiguration.publicIPAddress.ipConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * @property {string} [ipConfiguration.publicIPAddress.ipConfiguration.etag] A - * unique read-only string that changes whenever the resource is updated. - * @property {object} [ipConfiguration.publicIPAddress.dnsSettings] The FQDN of - * the DNS record associated with the public IP address. - * @property {string} - * [ipConfiguration.publicIPAddress.dnsSettings.domainNameLabel] Gets or sets - * the Domain name label.The concatenation of the domain name label and the - * regionalized DNS zone make up the fully qualified domain name associated - * with the public IP address. If a domain name label is specified, an A DNS - * record is created for the public IP in the Microsoft Azure DNS system. - * @property {string} [ipConfiguration.publicIPAddress.dnsSettings.fqdn] Gets - * the FQDN, Fully qualified domain name of the A DNS record associated with - * the public IP. This is the concatenation of the domainNameLabel and the - * regionalized DNS zone. - * @property {string} [ipConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * @property {array} [ipConfiguration.publicIPAddress.ipTags] The list of tags - * associated with the public IP address. - * @property {string} [ipConfiguration.publicIPAddress.ipAddress] The IP - * address associated with the public IP address resource. - * @property {object} [ipConfiguration.publicIPAddress.publicIPPrefix] The - * Public IP Prefix this Public IP Address should be allocated from. - * @property {string} [ipConfiguration.publicIPAddress.publicIPPrefix.id] - * Resource ID. - * @property {number} [ipConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * @property {string} [ipConfiguration.publicIPAddress.resourceGuid] The - * resource GUID property of the public IP resource. - * @property {string} [ipConfiguration.publicIPAddress.provisioningState] The - * provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [ipConfiguration.publicIPAddress.etag] A unique read-only - * string that changes whenever the resource is updated. - * @property {array} [ipConfiguration.publicIPAddress.zones] A list of - * availability zones denoting the IP allocated for the resource needs to come - * from. - * @property {array} [ipConfiguration.applicationSecurityGroups] Application - * security groups in which the IP configuration is included. - * @property {string} [ipConfiguration.provisioningState] The provisioning - * state of the network interface IP configuration. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [ipConfiguration.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * @property {string} [ipConfiguration.etag] A unique read-only string that - * changes whenever the resource is updated. - * @property {string} [health] Health of backend server. Possible values - * include: 'Unknown', 'Up', 'Down', 'Partial', 'Draining' - */ -export interface ApplicationGatewayBackendHealthServer { - address?: string; - ipConfiguration?: NetworkInterfaceIPConfiguration; - health?: string; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayBackendHealthHttpSettings class. - * @constructor - * Application gateway BackendHealthHttp settings. - * - * @property {object} [backendHttpSettings] Reference of an - * ApplicationGatewayBackendHttpSettings resource. - * @property {number} [backendHttpSettings.port] The destination port on the - * backend. - * @property {string} [backendHttpSettings.protocol] The protocol used to - * communicate with the backend. Possible values are 'Http' and 'Https'. - * Possible values include: 'Http', 'Https' - * @property {string} [backendHttpSettings.cookieBasedAffinity] Cookie based - * affinity. Possible values include: 'Enabled', 'Disabled' - * @property {number} [backendHttpSettings.requestTimeout] Request timeout in - * seconds. Application Gateway will fail the request if response is not - * received within RequestTimeout. Acceptable values are from 1 second to 86400 - * seconds. - * @property {object} [backendHttpSettings.probe] Probe resource of an - * application gateway. - * @property {string} [backendHttpSettings.probe.id] Resource ID. - * @property {array} [backendHttpSettings.authenticationCertificates] Array of - * references to application gateway authentication certificates. - * @property {array} [backendHttpSettings.trustedRootCertificates] Array of - * references to application gateway trusted root certificates. - * @property {object} [backendHttpSettings.connectionDraining] Connection - * draining of the backend http settings resource. - * @property {boolean} [backendHttpSettings.connectionDraining.enabled] Whether - * connection draining is enabled or not. - * @property {number} - * [backendHttpSettings.connectionDraining.drainTimeoutInSec] The number of - * seconds connection draining is active. Acceptable values are from 1 second - * to 3600 seconds. - * @property {string} [backendHttpSettings.hostName] Host header to be sent to - * the backend servers. - * @property {boolean} [backendHttpSettings.pickHostNameFromBackendAddress] - * Whether to pick host header should be picked from the host name of the - * backend server. Default value is false. - * @property {string} [backendHttpSettings.affinityCookieName] Cookie name to - * use for the affinity cookie. - * @property {boolean} [backendHttpSettings.probeEnabled] Whether the probe is - * enabled. Default value is false. - * @property {string} [backendHttpSettings.path] Path which should be used as a - * prefix for all HTTP requests. Null means no path will be prefixed. Default - * value is null. - * @property {string} [backendHttpSettings.provisioningState] Provisioning - * state of the backend http settings resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [backendHttpSettings.name] Name of the backend http - * settings that is unique within an Application Gateway. - * @property {string} [backendHttpSettings.etag] A unique read-only string that - * changes whenever the resource is updated. - * @property {string} [backendHttpSettings.type] Type of the resource. - * @property {array} [servers] List of ApplicationGatewayBackendHealthServer - * resources. - */ -export interface ApplicationGatewayBackendHealthHttpSettings { - backendHttpSettings?: ApplicationGatewayBackendHttpSettings; - servers?: ApplicationGatewayBackendHealthServer[]; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayBackendHealthPool class. - * @constructor - * Application gateway BackendHealth pool. - * - * @property {object} [backendAddressPool] Reference of an - * ApplicationGatewayBackendAddressPool resource. - * @property {array} [backendAddressPool.backendIPConfigurations] Collection of - * references to IPs defined in network interfaces. - * @property {array} [backendAddressPool.backendAddresses] Backend addresses - * @property {string} [backendAddressPool.provisioningState] Provisioning state - * of the backend address pool resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [backendAddressPool.name] Name of the backend address - * pool that is unique within an Application Gateway. - * @property {string} [backendAddressPool.etag] A unique read-only string that - * changes whenever the resource is updated. - * @property {string} [backendAddressPool.type] Type of the resource. - * @property {array} [backendHttpSettingsCollection] List of - * ApplicationGatewayBackendHealthHttpSettings resources. - */ -export interface ApplicationGatewayBackendHealthPool { - backendAddressPool?: ApplicationGatewayBackendAddressPool; - backendHttpSettingsCollection?: ApplicationGatewayBackendHealthHttpSettings[]; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayBackendHealth class. - * @constructor - * List of ApplicationGatewayBackendHealthPool resources. - * - * @property {array} [backendAddressPools] - */ -export interface ApplicationGatewayBackendHealth { - backendAddressPools?: ApplicationGatewayBackendHealthPool[]; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewaySku class. - * @constructor - * SKU of an application gateway - * - * @property {string} [name] Name of an application gateway SKU. Possible - * values include: 'Standard_Small', 'Standard_Medium', 'Standard_Large', - * 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' - * @property {string} [tier] Tier of an application gateway. Possible values - * include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' - * @property {number} [capacity] Capacity (instance count) of an application - * gateway. - */ -export interface ApplicationGatewaySku { - name?: string; - tier?: string; - capacity?: number; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewaySslPolicy class. - * @constructor - * Application Gateway Ssl policy. - * - * @property {array} [disabledSslProtocols] Ssl protocols to be disabled on - * application gateway. - * @property {string} [policyType] Type of Ssl Policy. Possible values include: - * 'Predefined', 'Custom' - * @property {string} [policyName] Name of Ssl predefined policy. Possible - * values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', - * 'AppGwSslPolicy20170401S' - * @property {array} [cipherSuites] Ssl cipher suites to be enabled in the - * specified order to application gateway. - * @property {string} [minProtocolVersion] Minimum version of Ssl protocol to - * be supported on application gateway. Possible values include: 'TLSv1_0', - * 'TLSv1_1', 'TLSv1_2' - */ -export interface ApplicationGatewaySslPolicy { - disabledSslProtocols?: string[]; - policyType?: string; - policyName?: string; - cipherSuites?: string[]; - minProtocolVersion?: string; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayIPConfiguration class. - * @constructor - * IP configuration of an application gateway. Currently 1 public and 1 private - * IP configuration is allowed. - * - * @property {object} [subnet] Reference of the subnet resource. A subnet from - * where application gateway gets its private address. - * @property {string} [subnet.id] Resource ID. - * @property {string} [provisioningState] Provisioning state of the application - * gateway subnet resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [name] Name of the IP configuration that is unique within - * an Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ -export interface ApplicationGatewayIPConfiguration extends SubResource { - subnet?: SubResource; - provisioningState?: string; - name?: string; - etag?: string; - type?: string; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayAuthenticationCertificate class. - * @constructor - * Authentication certificates of an application gateway. - * - * @property {string} [data] Certificate public data. - * @property {string} [provisioningState] Provisioning state of the - * authentication certificate resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [name] Name of the authentication certificate that is - * unique within an Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ -export interface ApplicationGatewayAuthenticationCertificate extends SubResource { - data?: string; - provisioningState?: string; - name?: string; - etag?: string; - type?: string; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayTrustedRootCertificate class. - * @constructor - * Trusted Root certificates of an application gateway. - * - * @property {string} [data] Certificate public data. - * @property {string} [keyVaultSecretId] Secret Id of (base-64 encoded - * unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. - * @property {string} [provisioningState] Provisioning state of the trusted - * root certificate resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [name] Name of the trusted root certificate that is - * unique within an Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ -export interface ApplicationGatewayTrustedRootCertificate extends SubResource { - data?: string; - keyVaultSecretId?: string; - provisioningState?: string; - name?: string; - etag?: string; - type?: string; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewaySslCertificate class. - * @constructor - * SSL certificates of an application gateway. - * - * @property {string} [data] Base-64 encoded pfx certificate. Only applicable - * in PUT Request. - * @property {string} [password] Password for the pfx file specified in data. - * Only applicable in PUT request. - * @property {string} [publicCertData] Base-64 encoded Public cert data - * corresponding to pfx specified in data. Only applicable in GET request. - * @property {string} [keyVaultSecretId] Secret Id of (base-64 encoded - * unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. - * @property {string} [provisioningState] Provisioning state of the SSL - * certificate resource Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [name] Name of the SSL certificate that is unique within - * an Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ -export interface ApplicationGatewaySslCertificate extends SubResource { - data?: string; - password?: string; - publicCertData?: string; - keyVaultSecretId?: string; - provisioningState?: string; - name?: string; - etag?: string; - type?: string; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayFrontendIPConfiguration class. - * @constructor - * Frontend IP configuration of an application gateway. - * - * @property {string} [privateIPAddress] PrivateIPAddress of the network - * interface IP Configuration. - * @property {string} [privateIPAllocationMethod] PrivateIP allocation method. - * Possible values include: 'Static', 'Dynamic' - * @property {object} [subnet] Reference of the subnet resource. - * @property {string} [subnet.id] Resource ID. - * @property {object} [publicIPAddress] Reference of the PublicIP resource. - * @property {string} [publicIPAddress.id] Resource ID. - * @property {string} [provisioningState] Provisioning state of the public IP - * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [name] Name of the frontend IP configuration that is - * unique within an Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ -export interface ApplicationGatewayFrontendIPConfiguration extends SubResource { - privateIPAddress?: string; - privateIPAllocationMethod?: string; - subnet?: SubResource; - publicIPAddress?: SubResource; - provisioningState?: string; - name?: string; - etag?: string; - type?: string; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayFrontendPort class. - * @constructor - * Frontend port of an application gateway. - * - * @property {number} [port] Frontend port - * @property {string} [provisioningState] Provisioning state of the frontend - * port resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [name] Name of the frontend port that is unique within an - * Application Gateway - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ -export interface ApplicationGatewayFrontendPort extends SubResource { - port?: number; - provisioningState?: string; - name?: string; - etag?: string; - type?: string; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayCustomError class. - * @constructor - * Customer error of an application gateway. - * - * @property {string} [statusCode] Status code of the application gateway - * customer error. Possible values include: 'HttpStatus403', 'HttpStatus502' - * @property {string} [customErrorPageUrl] Error page URL of the application - * gateway customer error. - */ -export interface ApplicationGatewayCustomError { - statusCode?: string; - customErrorPageUrl?: string; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayHttpListener class. - * @constructor - * Http listener of an application gateway. - * - * @property {object} [frontendIPConfiguration] Frontend IP configuration - * resource of an application gateway. - * @property {string} [frontendIPConfiguration.id] Resource ID. - * @property {object} [frontendPort] Frontend port resource of an application - * gateway. - * @property {string} [frontendPort.id] Resource ID. - * @property {string} [protocol] Protocol of the HTTP listener. Possible values - * are 'Http' and 'Https'. Possible values include: 'Http', 'Https' - * @property {string} [hostName] Host name of HTTP listener. - * @property {object} [sslCertificate] SSL certificate resource of an - * application gateway. - * @property {string} [sslCertificate.id] Resource ID. - * @property {boolean} [requireServerNameIndication] Applicable only if - * protocol is https. Enables SNI for multi-hosting. - * @property {string} [provisioningState] Provisioning state of the HTTP - * listener resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {array} [customErrorConfigurations] Custom error configurations of - * the HTTP listener. - * @property {string} [name] Name of the HTTP listener that is unique within an - * Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ -export interface ApplicationGatewayHttpListener extends SubResource { - frontendIPConfiguration?: SubResource; - frontendPort?: SubResource; - protocol?: string; - hostName?: string; - sslCertificate?: SubResource; - requireServerNameIndication?: boolean; - provisioningState?: string; - customErrorConfigurations?: ApplicationGatewayCustomError[]; - name?: string; - etag?: string; - type?: string; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayPathRule class. - * @constructor - * Path rule of URL path map of an application gateway. - * - * @property {array} [paths] Path rules of URL path map. - * @property {object} [backendAddressPool] Backend address pool resource of URL - * path map path rule. - * @property {string} [backendAddressPool.id] Resource ID. - * @property {object} [backendHttpSettings] Backend http settings resource of - * URL path map path rule. - * @property {string} [backendHttpSettings.id] Resource ID. - * @property {object} [redirectConfiguration] Redirect configuration resource - * of URL path map path rule. - * @property {string} [redirectConfiguration.id] Resource ID. - * @property {object} [rewriteRuleSet] Rewrite rule set resource of URL path - * map path rule. - * @property {string} [rewriteRuleSet.id] Resource ID. - * @property {string} [provisioningState] Path rule of URL path map resource. - * Possible values are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [name] Name of the path rule that is unique within an - * Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ -export interface ApplicationGatewayPathRule extends SubResource { - paths?: string[]; - backendAddressPool?: SubResource; - backendHttpSettings?: SubResource; - redirectConfiguration?: SubResource; - rewriteRuleSet?: SubResource; - provisioningState?: string; - name?: string; - etag?: string; - type?: string; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayProbeHealthResponseMatch class. - * @constructor - * Application gateway probe health response match - * - * @property {string} [body] Body that must be contained in the health - * response. Default value is empty. - * @property {array} [statusCodes] Allowed ranges of healthy status codes. - * Default range of healthy status codes is 200-399. - */ -export interface ApplicationGatewayProbeHealthResponseMatch { - body?: string; - statusCodes?: string[]; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayProbe class. - * @constructor - * Probe of the application gateway. - * - * @property {string} [protocol] The protocol used for the probe. Possible - * values are 'Http' and 'Https'. Possible values include: 'Http', 'Https' - * @property {string} [host] Host name to send the probe to. - * @property {string} [path] Relative path of probe. Valid path starts from - * '/'. Probe is sent to ://: - * @property {number} [interval] The probing interval in seconds. This is the - * time interval between two consecutive probes. Acceptable values are from 1 - * second to 86400 seconds. - * @property {number} [timeout] the probe timeout in seconds. Probe marked as - * failed if valid response is not received with this timeout period. - * Acceptable values are from 1 second to 86400 seconds. - * @property {number} [unhealthyThreshold] The probe retry count. Backend - * server is marked down after consecutive probe failure count reaches - * UnhealthyThreshold. Acceptable values are from 1 second to 20. - * @property {boolean} [pickHostNameFromBackendHttpSettings] Whether the host - * header should be picked from the backend http settings. Default value is - * false. - * @property {number} [minServers] Minimum number of servers that are always - * marked healthy. Default value is 0. - * @property {object} [match] Criterion for classifying a healthy probe - * response. - * @property {string} [match.body] Body that must be contained in the health - * response. Default value is empty. - * @property {array} [match.statusCodes] Allowed ranges of healthy status - * codes. Default range of healthy status codes is 200-399. - * @property {string} [provisioningState] Provisioning state of the backend - * http settings resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [name] Name of the probe that is unique within an - * Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ -export interface ApplicationGatewayProbe extends SubResource { - protocol?: string; - host?: string; - path?: string; - interval?: number; - timeout?: number; - unhealthyThreshold?: number; - pickHostNameFromBackendHttpSettings?: boolean; - minServers?: number; - match?: ApplicationGatewayProbeHealthResponseMatch; - provisioningState?: string; - name?: string; - etag?: string; - type?: string; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayRequestRoutingRule class. - * @constructor - * Request routing rule of an application gateway. - * - * @property {string} [ruleType] Rule type. Possible values include: 'Basic', - * 'PathBasedRouting' - * @property {object} [backendAddressPool] Backend address pool resource of the - * application gateway. - * @property {string} [backendAddressPool.id] Resource ID. - * @property {object} [backendHttpSettings] Backend http settings resource of - * the application gateway. - * @property {string} [backendHttpSettings.id] Resource ID. - * @property {object} [httpListener] Http listener resource of the application - * gateway. - * @property {string} [httpListener.id] Resource ID. - * @property {object} [urlPathMap] URL path map resource of the application - * gateway. - * @property {string} [urlPathMap.id] Resource ID. - * @property {object} [rewriteRuleSet] Rewrite Rule Set resource in Basic rule - * of the application gateway. - * @property {string} [rewriteRuleSet.id] Resource ID. - * @property {object} [redirectConfiguration] Redirect configuration resource - * of the application gateway. - * @property {string} [redirectConfiguration.id] Resource ID. - * @property {string} [provisioningState] Provisioning state of the request - * routing rule resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [name] Name of the request routing rule that is unique - * within an Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ -export interface ApplicationGatewayRequestRoutingRule extends SubResource { - ruleType?: string; - backendAddressPool?: SubResource; - backendHttpSettings?: SubResource; - httpListener?: SubResource; - urlPathMap?: SubResource; - rewriteRuleSet?: SubResource; - redirectConfiguration?: SubResource; - provisioningState?: string; - name?: string; - etag?: string; - type?: string; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayHeaderConfiguration class. - * @constructor - * Header configuration of the Actions set in Application Gateway. - * - * @property {string} [headerName] Header name of the header configuration - * @property {string} [headerValue] Header value of the header configuration - */ -export interface ApplicationGatewayHeaderConfiguration { - headerName?: string; - headerValue?: string; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayRewriteRuleActionSet class. - * @constructor - * Set of actions in the Rewrite Rule in Application Gateway. - * - * @property {array} [requestHeaderConfigurations] Request Header Actions in - * the Action Set - * @property {array} [responseHeaderConfigurations] Response Header Actions in - * the Action Set - */ -export interface ApplicationGatewayRewriteRuleActionSet { - requestHeaderConfigurations?: ApplicationGatewayHeaderConfiguration[]; - responseHeaderConfigurations?: ApplicationGatewayHeaderConfiguration[]; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayRewriteRule class. - * @constructor - * Rewrite rule of an application gateway. - * - * @property {string} [name] Name of the rewrite rule that is unique within an - * Application Gateway. - * @property {object} [actionSet] Set of actions to be done as part of the - * rewrite Rule. - * @property {array} [actionSet.requestHeaderConfigurations] Request Header - * Actions in the Action Set - * @property {array} [actionSet.responseHeaderConfigurations] Response Header - * Actions in the Action Set - */ -export interface ApplicationGatewayRewriteRule { - name?: string; - actionSet?: ApplicationGatewayRewriteRuleActionSet; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayRewriteRuleSet class. - * @constructor - * Rewrite rule set of an application gateway. - * - * @property {array} [rewriteRules] Rewrite rules in the rewrite rule set. - * @property {string} [provisioningState] Provisioning state of the rewrite - * rule set resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [name] Name of the rewrite rule set that is unique within - * an Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ -export interface ApplicationGatewayRewriteRuleSet extends SubResource { - rewriteRules?: ApplicationGatewayRewriteRule[]; - readonly provisioningState?: string; - name?: string; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayRedirectConfiguration class. - * @constructor - * Redirect configuration of an application gateway. - * - * @property {string} [redirectType] Supported http redirection types - - * Permanent, Temporary, Found, SeeOther. Possible values include: 'Permanent', - * 'Found', 'SeeOther', 'Temporary' - * @property {object} [targetListener] Reference to a listener to redirect the - * request to. - * @property {string} [targetListener.id] Resource ID. - * @property {string} [targetUrl] Url to redirect the request to. - * @property {boolean} [includePath] Include path in the redirected url. - * @property {boolean} [includeQueryString] Include query string in the - * redirected url. - * @property {array} [requestRoutingRules] Request routing specifying redirect - * configuration. - * @property {array} [urlPathMaps] Url path maps specifying default redirect - * configuration. - * @property {array} [pathRules] Path rules specifying redirect configuration. - * @property {string} [name] Name of the redirect configuration that is unique - * within an Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ -export interface ApplicationGatewayRedirectConfiguration extends SubResource { - redirectType?: string; - targetListener?: SubResource; - targetUrl?: string; - includePath?: boolean; - includeQueryString?: boolean; - requestRoutingRules?: SubResource[]; - urlPathMaps?: SubResource[]; - pathRules?: SubResource[]; - name?: string; - etag?: string; - type?: string; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayUrlPathMap class. - * @constructor - * UrlPathMaps give a url path to the backend mapping information for - * PathBasedRouting. - * - * @property {object} [defaultBackendAddressPool] Default backend address pool - * resource of URL path map. - * @property {string} [defaultBackendAddressPool.id] Resource ID. - * @property {object} [defaultBackendHttpSettings] Default backend http - * settings resource of URL path map. - * @property {string} [defaultBackendHttpSettings.id] Resource ID. - * @property {object} [defaultRewriteRuleSet] Default Rewrite rule set resource - * of URL path map. - * @property {string} [defaultRewriteRuleSet.id] Resource ID. - * @property {object} [defaultRedirectConfiguration] Default redirect - * configuration resource of URL path map. - * @property {string} [defaultRedirectConfiguration.id] Resource ID. - * @property {array} [pathRules] Path rule of URL path map resource. - * @property {string} [provisioningState] Provisioning state of the backend - * http settings resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [name] Name of the URL path map that is unique within an - * Application Gateway. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [type] Type of the resource. - */ -export interface ApplicationGatewayUrlPathMap extends SubResource { - defaultBackendAddressPool?: SubResource; - defaultBackendHttpSettings?: SubResource; - defaultRewriteRuleSet?: SubResource; - defaultRedirectConfiguration?: SubResource; - pathRules?: ApplicationGatewayPathRule[]; - provisioningState?: string; - name?: string; - etag?: string; - type?: string; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayFirewallDisabledRuleGroup class. - * @constructor - * Allows to disable rules within a rule group or an entire rule group. - * - * @property {string} ruleGroupName The name of the rule group that will be - * disabled. - * @property {array} [rules] The list of rules that will be disabled. If null, - * all rules of the rule group will be disabled. - */ -export interface ApplicationGatewayFirewallDisabledRuleGroup { - ruleGroupName: string; - rules?: number[]; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayFirewallExclusion class. - * @constructor - * Allow to exclude some variable satisfy the condition for the WAF check - * - * @property {string} matchVariable The variable to be excluded. - * @property {string} selectorMatchOperator When matchVariable is a collection, - * operate on the selector to specify which elements in the collection this - * exclusion applies to. - * @property {string} selector When matchVariable is a collection, operator - * used to specify which elements in the collection this exclusion applies to. - */ -export interface ApplicationGatewayFirewallExclusion { - matchVariable: string; - selectorMatchOperator: string; - selector: string; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayWebApplicationFirewallConfiguration class. - * @constructor - * Application gateway web application firewall configuration. - * - * @property {boolean} enabled Whether the web application firewall is enabled - * or not. - * @property {string} firewallMode Web application firewall mode. Possible - * values include: 'Detection', 'Prevention' - * @property {string} ruleSetType The type of the web application firewall rule - * set. Possible values are: 'OWASP'. - * @property {string} ruleSetVersion The version of the rule set type. - * @property {array} [disabledRuleGroups] The disabled rule groups. - * @property {boolean} [requestBodyCheck] Whether allow WAF to check request - * Body. - * @property {number} [maxRequestBodySize] Maxium request body size for WAF. - * @property {number} [maxRequestBodySizeInKb] Maxium request body size in Kb - * for WAF. - * @property {number} [fileUploadLimitInMb] Maxium file upload size in Mb for - * WAF. - * @property {array} [exclusions] The exclusion list. - */ -export interface ApplicationGatewayWebApplicationFirewallConfiguration { - enabled: boolean; - firewallMode: string; - ruleSetType: string; - ruleSetVersion: string; - disabledRuleGroups?: ApplicationGatewayFirewallDisabledRuleGroup[]; - requestBodyCheck?: boolean; - maxRequestBodySize?: number; - maxRequestBodySizeInKb?: number; - fileUploadLimitInMb?: number; - exclusions?: ApplicationGatewayFirewallExclusion[]; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayAutoscaleConfiguration class. - * @constructor - * Application Gateway autoscale configuration. - * - * @property {number} minCapacity Lower bound on number of Application Gateway - * instances - */ -export interface ApplicationGatewayAutoscaleConfiguration { - minCapacity: number; -} - -/** - * @class - * Initializes a new instance of the ManagedServiceIdentityUserAssignedIdentitiesValue class. - * @constructor - * @property {string} [principalId] The principal id of user assigned identity. - * @property {string} [clientId] The client id of user assigned identity. - */ -export interface ManagedServiceIdentityUserAssignedIdentitiesValue { - readonly principalId?: string; - readonly clientId?: string; -} - -/** - * @class - * Initializes a new instance of the ManagedServiceIdentity class. - * @constructor - * Identity for the resource. - * - * @property {string} [principalId] The principal id of the system assigned - * identity. This property will only be provided for a system assigned - * identity. - * @property {string} [tenantId] The tenant id of the system assigned identity. - * This property will only be provided for a system assigned identity. - * @property {string} [type] The type of identity used for the resource. The - * type 'SystemAssigned, UserAssigned' includes both an implicitly created - * identity and a set of user assigned identities. The type 'None' will remove - * any identities from the virtual machine. Possible values include: - * 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' - * @property {object} [userAssignedIdentities] The list of user identities - * associated with resource. The user identity dictionary key references will - * be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - */ -export interface ManagedServiceIdentity { - readonly principalId?: string; - readonly tenantId?: string; - type?: string; - userAssignedIdentities?: { [propertyName: string]: ManagedServiceIdentityUserAssignedIdentitiesValue }; -} - -/** - * @class - * Initializes a new instance of the ApplicationGateway class. - * @constructor - * Application gateway resource - * - * @property {object} [sku] SKU of the application gateway resource. - * @property {string} [sku.name] Name of an application gateway SKU. Possible - * values include: 'Standard_Small', 'Standard_Medium', 'Standard_Large', - * 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' - * @property {string} [sku.tier] Tier of an application gateway. Possible - * values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' - * @property {number} [sku.capacity] Capacity (instance count) of an - * application gateway. - * @property {object} [sslPolicy] SSL policy of the application gateway - * resource. - * @property {array} [sslPolicy.disabledSslProtocols] Ssl protocols to be - * disabled on application gateway. - * @property {string} [sslPolicy.policyType] Type of Ssl Policy. Possible - * values include: 'Predefined', 'Custom' - * @property {string} [sslPolicy.policyName] Name of Ssl predefined policy. - * Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', - * 'AppGwSslPolicy20170401S' - * @property {array} [sslPolicy.cipherSuites] Ssl cipher suites to be enabled - * in the specified order to application gateway. - * @property {string} [sslPolicy.minProtocolVersion] Minimum version of Ssl - * protocol to be supported on application gateway. Possible values include: - * 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' - * @property {string} [operationalState] Operational state of the application - * gateway resource. Possible values include: 'Stopped', 'Starting', 'Running', - * 'Stopping' - * @property {array} [gatewayIPConfigurations] Subnets of application the - * gateway resource. - * @property {array} [authenticationCertificates] Authentication certificates - * of the application gateway resource. - * @property {array} [trustedRootCertificates] Trusted Root certificates of the - * application gateway resource. - * @property {array} [sslCertificates] SSL certificates of the application - * gateway resource. - * @property {array} [frontendIPConfigurations] Frontend IP addresses of the - * application gateway resource. - * @property {array} [frontendPorts] Frontend ports of the application gateway - * resource. - * @property {array} [probes] Probes of the application gateway resource. - * @property {array} [backendAddressPools] Backend address pool of the - * application gateway resource. - * @property {array} [backendHttpSettingsCollection] Backend http settings of - * the application gateway resource. - * @property {array} [httpListeners] Http listeners of the application gateway - * resource. - * @property {array} [urlPathMaps] URL path map of the application gateway - * resource. - * @property {array} [requestRoutingRules] Request routing rules of the - * application gateway resource. - * @property {array} [rewriteRuleSets] Rewrite rules for the application - * gateway resource. - * @property {array} [redirectConfigurations] Redirect configurations of the - * application gateway resource. - * @property {object} [webApplicationFirewallConfiguration] Web application - * firewall configuration. - * @property {boolean} [webApplicationFirewallConfiguration.enabled] Whether - * the web application firewall is enabled or not. - * @property {string} [webApplicationFirewallConfiguration.firewallMode] Web - * application firewall mode. Possible values include: 'Detection', - * 'Prevention' - * @property {string} [webApplicationFirewallConfiguration.ruleSetType] The - * type of the web application firewall rule set. Possible values are: 'OWASP'. - * @property {string} [webApplicationFirewallConfiguration.ruleSetVersion] The - * version of the rule set type. - * @property {array} [webApplicationFirewallConfiguration.disabledRuleGroups] - * The disabled rule groups. - * @property {boolean} [webApplicationFirewallConfiguration.requestBodyCheck] - * Whether allow WAF to check request Body. - * @property {number} [webApplicationFirewallConfiguration.maxRequestBodySize] - * Maxium request body size for WAF. - * @property {number} - * [webApplicationFirewallConfiguration.maxRequestBodySizeInKb] Maxium request - * body size in Kb for WAF. - * @property {number} [webApplicationFirewallConfiguration.fileUploadLimitInMb] - * Maxium file upload size in Mb for WAF. - * @property {array} [webApplicationFirewallConfiguration.exclusions] The - * exclusion list. - * @property {boolean} [enableHttp2] Whether HTTP2 is enabled on the - * application gateway resource. - * @property {boolean} [enableFips] Whether FIPS is enabled on the application - * gateway resource. - * @property {object} [autoscaleConfiguration] Autoscale Configuration. - * @property {number} [autoscaleConfiguration.minCapacity] Lower bound on - * number of Application Gateway instances - * @property {string} [resourceGuid] Resource GUID property of the application - * gateway resource. - * @property {string} [provisioningState] Provisioning state of the application - * gateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * @property {array} [customErrorConfigurations] Custom error configurations of - * the application gateway resource. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {array} [zones] A list of availability zones denoting where the - * resource needs to come from. - * @property {object} [identity] The identity of the application gateway, if - * configured. - * @property {string} [identity.principalId] The principal id of the system - * assigned identity. This property will only be provided for a system assigned - * identity. - * @property {string} [identity.tenantId] The tenant id of the system assigned - * identity. This property will only be provided for a system assigned - * identity. - * @property {string} [identity.type] The type of identity used for the - * resource. The type 'SystemAssigned, UserAssigned' includes both an - * implicitly created identity and a set of user assigned identities. The type - * 'None' will remove any identities from the virtual machine. Possible values - * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', - * 'None' - * @property {object} [identity.userAssignedIdentities] The list of user - * identities associated with resource. The user identity dictionary key - * references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - */ -export interface ApplicationGateway extends Resource { - sku?: ApplicationGatewaySku; - sslPolicy?: ApplicationGatewaySslPolicy; - readonly operationalState?: string; - gatewayIPConfigurations?: ApplicationGatewayIPConfiguration[]; - authenticationCertificates?: ApplicationGatewayAuthenticationCertificate[]; - trustedRootCertificates?: ApplicationGatewayTrustedRootCertificate[]; - sslCertificates?: ApplicationGatewaySslCertificate[]; - frontendIPConfigurations?: ApplicationGatewayFrontendIPConfiguration[]; - frontendPorts?: ApplicationGatewayFrontendPort[]; - probes?: ApplicationGatewayProbe[]; - backendAddressPools?: ApplicationGatewayBackendAddressPool[]; - backendHttpSettingsCollection?: ApplicationGatewayBackendHttpSettings[]; - httpListeners?: ApplicationGatewayHttpListener[]; - urlPathMaps?: ApplicationGatewayUrlPathMap[]; - requestRoutingRules?: ApplicationGatewayRequestRoutingRule[]; - rewriteRuleSets?: ApplicationGatewayRewriteRuleSet[]; - redirectConfigurations?: ApplicationGatewayRedirectConfiguration[]; - webApplicationFirewallConfiguration?: ApplicationGatewayWebApplicationFirewallConfiguration; - enableHttp2?: boolean; - enableFips?: boolean; - autoscaleConfiguration?: ApplicationGatewayAutoscaleConfiguration; - resourceGuid?: string; - provisioningState?: string; - customErrorConfigurations?: ApplicationGatewayCustomError[]; - etag?: string; - zones?: string[]; - identity?: ManagedServiceIdentity; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayFirewallRule class. - * @constructor - * A web application firewall rule. - * - * @property {number} ruleId The identifier of the web application firewall - * rule. - * @property {string} [description] The description of the web application - * firewall rule. - */ -export interface ApplicationGatewayFirewallRule { - ruleId: number; - description?: string; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayFirewallRuleGroup class. - * @constructor - * A web application firewall rule group. - * - * @property {string} ruleGroupName The name of the web application firewall - * rule group. - * @property {string} [description] The description of the web application - * firewall rule group. - * @property {array} rules The rules of the web application firewall rule - * group. - */ -export interface ApplicationGatewayFirewallRuleGroup { - ruleGroupName: string; - description?: string; - rules: ApplicationGatewayFirewallRule[]; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayFirewallRuleSet class. - * @constructor - * A web application firewall rule set. - * - * @property {string} [provisioningState] The provisioning state of the web - * application firewall rule set. - * @property {string} ruleSetType The type of the web application firewall rule - * set. - * @property {string} ruleSetVersion The version of the web application - * firewall rule set type. - * @property {array} ruleGroups The rule groups of the web application firewall - * rule set. - */ -export interface ApplicationGatewayFirewallRuleSet extends Resource { - provisioningState?: string; - ruleSetType: string; - ruleSetVersion: string; - ruleGroups: ApplicationGatewayFirewallRuleGroup[]; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayAvailableWafRuleSetsResult class. - * @constructor - * Response for ApplicationGatewayAvailableWafRuleSets API service call. - * - * @property {array} [value] The list of application gateway rule sets. - */ -export interface ApplicationGatewayAvailableWafRuleSetsResult { - value?: ApplicationGatewayFirewallRuleSet[]; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayAvailableSslOptions class. - * @constructor - * Response for ApplicationGatewayAvailableSslOptions API service call. - * - * @property {array} [predefinedPolicies] List of available Ssl predefined - * policy. - * @property {string} [defaultPolicy] Name of the Ssl predefined policy applied - * by default to application gateway. Possible values include: - * 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', - * 'AppGwSslPolicy20170401S' - * @property {array} [availableCipherSuites] List of available Ssl cipher - * suites. - * @property {array} [availableProtocols] List of available Ssl protocols. - */ -export interface ApplicationGatewayAvailableSslOptions extends Resource { - predefinedPolicies?: SubResource[]; - defaultPolicy?: string; - availableCipherSuites?: string[]; - availableProtocols?: string[]; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewaySslPredefinedPolicy class. - * @constructor - * An Ssl predefined policy - * - * @property {string} [name] Name of the Ssl predefined policy. - * @property {array} [cipherSuites] Ssl cipher suites to be enabled in the - * specified order for application gateway. - * @property {string} [minProtocolVersion] Minimum version of Ssl protocol to - * be supported on application gateway. Possible values include: 'TLSv1_0', - * 'TLSv1_1', 'TLSv1_2' - */ -export interface ApplicationGatewaySslPredefinedPolicy extends SubResource { - name?: string; - cipherSuites?: string[]; - minProtocolVersion?: string; -} - -/** - * @class - * Initializes a new instance of the TagsObject class. - * @constructor - * Tags object for patch operations. - * - * @property {object} [tags] Resource tags. - */ -export interface TagsObject { - tags?: { [propertyName: string]: string }; -} - -/** - * @class - * Initializes a new instance of the AvailableDelegation class. - * @constructor - * The serviceName of an AvailableDelegation indicates a possible delegation - * for a subnet. - * - * @property {string} [name] The name of the AvailableDelegation resource. - * @property {string} [id] A unique identifier of the AvailableDelegation - * resource. - * @property {string} [type] Resource type. - * @property {string} [serviceName] The name of the service and resource - * @property {array} [actions] Describes the actions permitted to the service - * upon delegation - */ -export interface AvailableDelegation { - name?: string; - id?: string; - type?: string; - serviceName?: string; - actions?: string[]; -} - -/** - * @class - * Initializes a new instance of the AzureFirewallIPConfiguration class. - * @constructor - * IP configuration of an Azure Firewall. - * - * @property {string} [privateIPAddress] The Firewall Internal Load Balancer IP - * to be used as the next hop in User Defined Routes. - * @property {object} [subnet] Reference of the subnet resource. This resource - * must be named 'AzureFirewallSubnet'. - * @property {string} [subnet.id] Resource ID. - * @property {object} [publicIPAddress] Reference of the PublicIP resource. - * This field is a mandatory input if subnet is not null. - * @property {string} [publicIPAddress.id] Resource ID. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * @property {string} [name] 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. - */ -export interface AzureFirewallIPConfiguration extends SubResource { - readonly privateIPAddress?: string; - subnet?: SubResource; - publicIPAddress?: SubResource; - provisioningState?: string; - name?: string; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the AzureFirewallRCAction class. - * @constructor - * Properties of the AzureFirewallRCAction. - * - * @property {string} [type] The type of action. Possible values include: - * 'Allow', 'Deny' - */ -export interface AzureFirewallRCAction { - type?: string; -} - -/** - * @class - * Initializes a new instance of the AzureFirewallApplicationRuleProtocol class. - * @constructor - * Properties of the application rule protocol. - * - * @property {string} [protocolType] Protocol type. Possible values include: - * 'Http', 'Https' - * @property {number} [port] Port number for the protocol, cannot be greater - * than 64000. This field is optional. - */ -export interface AzureFirewallApplicationRuleProtocol { - protocolType?: string; - port?: number; -} - -/** - * @class - * Initializes a new instance of the AzureFirewallApplicationRule class. - * @constructor - * Properties of an application rule. - * - * @property {string} [name] Name of the application rule. - * @property {string} [description] Description of the rule. - * @property {array} [sourceAddresses] List of source IP addresses for this - * rule. - * @property {array} [protocols] Array of ApplicationRuleProtocols. - * @property {array} [targetFqdns] List of FQDNs for this rule. - * @property {array} [fqdnTags] List of FQDN Tags for this rule. - */ -export interface AzureFirewallApplicationRule { - name?: string; - description?: string; - sourceAddresses?: string[]; - protocols?: AzureFirewallApplicationRuleProtocol[]; - targetFqdns?: string[]; - fqdnTags?: string[]; -} - -/** - * @class - * Initializes a new instance of the AzureFirewallApplicationRuleCollection class. - * @constructor - * Application rule collection resource - * - * @property {number} [priority] Priority of the application rule collection - * resource. - * @property {object} [action] The action type of a rule collection - * @property {string} [action.type] The type of action. Possible values - * include: 'Allow', 'Deny' - * @property {array} [rules] Collection of rules used by a application rule - * collection. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * '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] Gets a unique read-only string that changes - * whenever the resource is updated. - */ -export interface AzureFirewallApplicationRuleCollection extends SubResource { - priority?: number; - action?: AzureFirewallRCAction; - rules?: AzureFirewallApplicationRule[]; - provisioningState?: string; - name?: string; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the AzureFirewallNatRCAction class. - * @constructor - * AzureFirewall NAT Rule Collection Action. - * - * @property {string} [type] The type of action. Possible values include: - * 'Snat', 'Dnat' - */ -export interface AzureFirewallNatRCAction { - type?: string; -} - -/** - * @class - * Initializes a new instance of the AzureFirewallNatRule class. - * @constructor - * Properties of a NAT rule. - * - * @property {string} [name] Name of the NAT rule. - * @property {string} [description] Description of the rule. - * @property {array} [sourceAddresses] List of source IP addresses for this - * rule. - * @property {array} [destinationAddresses] List of destination IP addresses - * for this rule. - * @property {array} [destinationPorts] List of destination ports. - * @property {array} [protocols] Array of AzureFirewallNetworkRuleProtocols - * applicable to this NAT rule. - * @property {string} [translatedAddress] The translated address for this NAT - * rule. - * @property {string} [translatedPort] The translated port for this NAT rule. - */ -export interface AzureFirewallNatRule { - name?: string; - description?: string; - sourceAddresses?: string[]; - destinationAddresses?: string[]; - destinationPorts?: string[]; - protocols?: string[]; - translatedAddress?: string; - translatedPort?: string; -} - -/** - * @class - * Initializes a new instance of the AzureFirewallNatRuleCollection class. - * @constructor - * NAT rule collection resource - * - * @property {number} [priority] Priority of the NAT rule collection resource. - * @property {object} [action] The action type of a NAT rule collection - * @property {string} [action.type] The type of action. Possible values - * include: 'Snat', 'Dnat' - * @property {array} [rules] Collection of rules used by a NAT rule collection. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * '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] Gets a unique read-only string that changes - * whenever the resource is updated. - */ -export interface AzureFirewallNatRuleCollection extends SubResource { - priority?: number; - action?: AzureFirewallNatRCAction; - rules?: AzureFirewallNatRule[]; - provisioningState?: string; - name?: string; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the AzureFirewallNetworkRule class. - * @constructor - * Properties of the network rule. - * - * @property {string} [name] Name of the network rule. - * @property {string} [description] Description of the rule. - * @property {array} [protocols] Array of AzureFirewallNetworkRuleProtocols. - * @property {array} [sourceAddresses] List of source IP addresses for this - * rule. - * @property {array} [destinationAddresses] List of destination IP addresses. - * @property {array} [destinationPorts] List of destination ports. - */ -export interface AzureFirewallNetworkRule { - name?: string; - description?: string; - protocols?: string[]; - sourceAddresses?: string[]; - destinationAddresses?: string[]; - destinationPorts?: string[]; -} - -/** - * @class - * Initializes a new instance of the AzureFirewallNetworkRuleCollection class. - * @constructor - * Network rule collection resource - * - * @property {number} [priority] Priority of the network rule collection - * resource. - * @property {object} [action] The action type of a rule collection - * @property {string} [action.type] The type of action. Possible values - * include: 'Allow', 'Deny' - * @property {array} [rules] Collection of rules used by a network rule - * collection. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * '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] Gets a unique read-only string that changes - * whenever the resource is updated. - */ -export interface AzureFirewallNetworkRuleCollection extends SubResource { - priority?: number; - action?: AzureFirewallRCAction; - rules?: AzureFirewallNetworkRule[]; - provisioningState?: string; - name?: string; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the AzureFirewall class. - * @constructor - * Azure Firewall resource - * - * @property {array} [applicationRuleCollections] Collection of application - * rule collections used by Azure Firewall. - * @property {array} [natRuleCollections] Collection of NAT rule collections - * used by Azure Firewall. - * @property {array} [networkRuleCollections] Collection of network rule - * collections used by Azure Firewall. - * @property {array} [ipConfigurations] IP configuration of the Azure Firewall - * resource. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ -export interface AzureFirewall extends Resource { - applicationRuleCollections?: AzureFirewallApplicationRuleCollection[]; - natRuleCollections?: AzureFirewallNatRuleCollection[]; - networkRuleCollections?: AzureFirewallNetworkRuleCollection[]; - ipConfigurations?: AzureFirewallIPConfiguration[]; - provisioningState?: string; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the AzureFirewallFqdnTag class. - * @constructor - * Azure Firewall FQDN Tag Resource - * - * @property {string} [provisioningState] The provisioning state of the - * resource. - * @property {string} [fqdnTagName] The name of this FQDN Tag. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ -export interface AzureFirewallFqdnTag extends Resource { - readonly provisioningState?: string; - readonly fqdnTagName?: string; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the DnsNameAvailabilityResult class. - * @constructor - * Response for the CheckDnsNameAvailability API service call. - * - * @property {boolean} [available] Domain availability (True/False). - */ -export interface DnsNameAvailabilityResult { - available?: boolean; -} - -/** - * @class - * Initializes a new instance of the DdosProtectionPlan class. - * @constructor - * A DDoS protection plan in a resource group. - * - * @property {string} [id] Resource ID. - * @property {string} [name] Resource name. - * @property {string} [type] Resource type. - * @property {string} [location] Resource location. - * @property {object} [tags] Resource tags. - * @property {string} [resourceGuid] The resource GUID property of the DDoS - * protection plan resource. It uniquely identifies the resource, even if the - * user changes its name or migrate the resource across subscriptions or - * resource groups. - * @property {string} [provisioningState] The provisioning state of the DDoS - * protection plan resource. Possible values are: 'Succeeded', 'Updating', - * 'Deleting', and 'Failed'. - * @property {array} [virtualNetworks] The list of virtual networks associated - * with the DDoS protection plan resource. This list is read-only. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ -export interface DdosProtectionPlan extends BaseResource { - readonly id?: string; - readonly name?: string; - readonly type?: string; - location?: string; - tags?: { [propertyName: string]: string }; - readonly resourceGuid?: string; - readonly provisioningState?: string; - readonly virtualNetworks?: SubResource[]; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the EndpointServiceResult class. - * @constructor - * Endpoint service. - * - * @property {string} [name] Name of the endpoint service. - * @property {string} [type] Type of the endpoint service. - */ -export interface EndpointServiceResult extends SubResource { - readonly name?: string; - readonly type?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteCircuitAuthorization class. - * @constructor - * Authorization in an ExpressRouteCircuit resource. - * - * @property {string} [authorizationKey] The authorization key. - * @property {string} [authorizationUseStatus] AuthorizationUseStatus. Possible - * values are: 'Available' and 'InUse'. Possible values include: 'Available', - * 'InUse' - * @property {string} [provisioningState] Gets the provisioning state of the - * public IP resource. Possible values are: '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. - */ -export interface ExpressRouteCircuitAuthorization extends SubResource { - authorizationKey?: string; - authorizationUseStatus?: string; - provisioningState?: string; - name?: string; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteCircuitPeeringConfig class. - * @constructor - * Specifies the peering configuration. - * - * @property {array} [advertisedPublicPrefixes] The reference of - * AdvertisedPublicPrefixes. - * @property {array} [advertisedCommunities] The communities of bgp peering. - * Spepcified for microsoft peering - * @property {string} [advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * @property {number} [legacyMode] The legacy mode of the peering. - * @property {number} [customerASN] The CustomerASN of the peering. - * @property {string} [routingRegistryName] The RoutingRegistryName of the - * configuration. - */ -export interface ExpressRouteCircuitPeeringConfig { - advertisedPublicPrefixes?: string[]; - advertisedCommunities?: string[]; - advertisedPublicPrefixesState?: string; - legacyMode?: number; - customerASN?: number; - routingRegistryName?: string; -} - -/** - * @class - * Initializes a new instance of the RouteFilterRule class. - * @constructor - * Route Filter Rule Resource - * - * @property {string} access The access type of the rule. Valid values are: - * 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' - * @property {array} communities The collection for bgp community values to - * filter on. e.g. ['12076:5010','12076:5020'] - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and - * 'Failed'. - * @property {string} [name] The name of the resource that is unique within a - * resource group. This name can be used to access the resource. - * @property {string} [location] Resource location. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ -export interface RouteFilterRule extends SubResource { - access: string; - communities: string[]; - readonly provisioningState?: string; - name?: string; - location?: string; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteCircuitStats class. - * @constructor - * Contains stats associated with the peering. - * - * @property {number} [primarybytesIn] Gets BytesIn of the peering. - * @property {number} [primarybytesOut] Gets BytesOut of the peering. - * @property {number} [secondarybytesIn] Gets BytesIn of the peering. - * @property {number} [secondarybytesOut] Gets BytesOut of the peering. - */ -export interface ExpressRouteCircuitStats { - primarybytesIn?: number; - primarybytesOut?: number; - secondarybytesIn?: number; - secondarybytesOut?: number; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteConnectionId class. - * @constructor - * The ID of the ExpressRouteConnection. - * - * @property {string} [id] The ID of the ExpressRouteConnection. - */ -export interface ExpressRouteConnectionId { - readonly id?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteCircuitConnection class. - * @constructor - * Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. - * - * @property {object} [expressRouteCircuitPeering] Reference to Express Route - * Circuit Private Peering Resource of the circuit initiating connection. - * @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} [authorizationKey] The authorization key. - * @property {string} [circuitConnectionStatus] Express Route Circuit - * Connection State. Possible values are: 'Connected' and 'Disconnected'. - * Possible values include: 'Connected', 'Connecting', 'Disconnected' - * @property {string} [provisioningState] Provisioning state of the circuit - * connection resource. Possible values are: 'Succeded', '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. - */ -export interface ExpressRouteCircuitConnection extends SubResource { - expressRouteCircuitPeering?: SubResource; - peerExpressRouteCircuitPeering?: SubResource; - addressPrefix?: string; - authorizationKey?: string; - readonly circuitConnectionStatus?: string; - readonly provisioningState?: string; - name?: string; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteCircuitPeering class. - * @constructor - * Peering in an ExpressRouteCircuit resource. - * - * @property {string} [peeringType] The peering type. Possible values include: - * 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' - * @property {string} [state] The peering state. Possible values include: - * 'Disabled', 'Enabled' - * @property {number} [azureASN] The Azure ASN. - * @property {number} [peerASN] The peer ASN. - * @property {string} [primaryPeerAddressPrefix] The primary address prefix. - * @property {string} [secondaryPeerAddressPrefix] The secondary address - * prefix. - * @property {string} [primaryAzurePort] The primary port. - * @property {string} [secondaryAzurePort] The secondary port. - * @property {string} [sharedKey] The shared key. - * @property {number} [vlanId] The VLAN ID. - * @property {object} [microsoftPeeringConfig] The Microsoft peering - * configuration. - * @property {array} [microsoftPeeringConfig.advertisedPublicPrefixes] The - * reference of AdvertisedPublicPrefixes. - * @property {array} [microsoftPeeringConfig.advertisedCommunities] The - * communities of bgp peering. Spepcified for microsoft peering - * @property {string} [microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * @property {number} [microsoftPeeringConfig.legacyMode] The legacy mode of - * the peering. - * @property {number} [microsoftPeeringConfig.customerASN] The CustomerASN of - * the peering. - * @property {string} [microsoftPeeringConfig.routingRegistryName] The - * RoutingRegistryName of the configuration. - * @property {object} [stats] Gets peering stats. - * @property {number} [stats.primarybytesIn] Gets BytesIn of the peering. - * @property {number} [stats.primarybytesOut] Gets BytesOut of the peering. - * @property {number} [stats.secondarybytesIn] Gets BytesIn of the peering. - * @property {number} [stats.secondarybytesOut] Gets BytesOut of the peering. - * @property {string} [provisioningState] Gets the provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [gatewayManagerEtag] The GatewayManager Etag. - * @property {string} [lastModifiedBy] Gets whether the provider or the - * customer last modified the peering. - * @property {object} [routeFilter] The reference of the RouteFilter resource. - * @property {array} [routeFilter.rules] Collection of RouteFilterRules - * contained within a route filter. - * @property {array} [routeFilter.peerings] A collection of references to - * express route circuit peerings. - * @property {string} [routeFilter.provisioningState] The provisioning state of - * the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and - * 'Failed'. - * @property {string} [routeFilter.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * @property {object} [ipv6PeeringConfig] The IPv6 peering configuration. - * @property {string} [ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. - * @property {string} [ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. - * @property {object} [ipv6PeeringConfig.microsoftPeeringConfig] The Microsoft - * peering configuration. - * @property {array} - * [ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] The - * reference of AdvertisedPublicPrefixes. - * @property {array} - * [ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] The - * communities of bgp peering. Spepcified for microsoft peering - * @property {string} - * [ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * @property {number} [ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. - * @property {number} [ipv6PeeringConfig.microsoftPeeringConfig.customerASN] - * The CustomerASN of the peering. - * @property {string} - * [ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] The - * RoutingRegistryName of the configuration. - * @property {object} [ipv6PeeringConfig.routeFilter] The reference of the - * RouteFilter resource. - * @property {array} [ipv6PeeringConfig.routeFilter.rules] Collection of - * RouteFilterRules contained within a route filter. - * @property {array} [ipv6PeeringConfig.routeFilter.peerings] A collection of - * references to express route circuit peerings. - * @property {string} [ipv6PeeringConfig.routeFilter.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', 'Succeeded' and 'Failed'. - * @property {string} [ipv6PeeringConfig.routeFilter.etag] Gets a unique - * read-only string that changes whenever the resource is updated. - * @property {string} [ipv6PeeringConfig.state] The state of peering. Possible - * values are: 'Disabled' and 'Enabled'. Possible values include: 'Disabled', - * 'Enabled' - * @property {object} [expressRouteConnection] The ExpressRoute connection. - * @property {string} [expressRouteConnection.id] The ID of the - * ExpressRouteConnection. - * @property {array} [connections] The list of 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 - * the resource is updated. - */ -export interface ExpressRouteCircuitPeering extends SubResource { - peeringType?: string; - state?: string; - azureASN?: number; - peerASN?: number; - primaryPeerAddressPrefix?: string; - secondaryPeerAddressPrefix?: string; - primaryAzurePort?: string; - secondaryAzurePort?: string; - sharedKey?: string; - vlanId?: number; - microsoftPeeringConfig?: ExpressRouteCircuitPeeringConfig; - stats?: ExpressRouteCircuitStats; - provisioningState?: string; - gatewayManagerEtag?: string; - lastModifiedBy?: string; - routeFilter?: RouteFilter; - ipv6PeeringConfig?: Ipv6ExpressRouteCircuitPeeringConfig; - expressRouteConnection?: ExpressRouteConnectionId; - connections?: ExpressRouteCircuitConnection[]; - name?: string; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the RouteFilter class. - * @constructor - * Route Filter Resource. - * - * @property {array} [rules] Collection of RouteFilterRules contained within a - * route filter. - * @property {array} [peerings] A collection of references to express route - * circuit peerings. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and - * 'Failed'. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ -export interface RouteFilter extends Resource { - rules?: RouteFilterRule[]; - peerings?: ExpressRouteCircuitPeering[]; - readonly provisioningState?: string; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the Ipv6ExpressRouteCircuitPeeringConfig class. - * @constructor - * Contains IPv6 peering config. - * - * @property {string} [primaryPeerAddressPrefix] The primary address prefix. - * @property {string} [secondaryPeerAddressPrefix] The secondary address - * prefix. - * @property {object} [microsoftPeeringConfig] The Microsoft peering - * configuration. - * @property {array} [microsoftPeeringConfig.advertisedPublicPrefixes] The - * reference of AdvertisedPublicPrefixes. - * @property {array} [microsoftPeeringConfig.advertisedCommunities] The - * communities of bgp peering. Spepcified for microsoft peering - * @property {string} [microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * @property {number} [microsoftPeeringConfig.legacyMode] The legacy mode of - * the peering. - * @property {number} [microsoftPeeringConfig.customerASN] The CustomerASN of - * the peering. - * @property {string} [microsoftPeeringConfig.routingRegistryName] The - * RoutingRegistryName of the configuration. - * @property {object} [routeFilter] The reference of the RouteFilter resource. - * @property {array} [routeFilter.rules] Collection of RouteFilterRules - * contained within a route filter. - * @property {array} [routeFilter.peerings] A collection of references to - * express route circuit peerings. - * @property {string} [routeFilter.provisioningState] The provisioning state of - * the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and - * 'Failed'. - * @property {string} [routeFilter.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * @property {string} [state] The state of peering. Possible values are: - * 'Disabled' and 'Enabled'. Possible values include: 'Disabled', 'Enabled' - */ -export interface Ipv6ExpressRouteCircuitPeeringConfig { - primaryPeerAddressPrefix?: string; - secondaryPeerAddressPrefix?: string; - microsoftPeeringConfig?: ExpressRouteCircuitPeeringConfig; - routeFilter?: RouteFilter; - state?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteCircuitSku class. - * @constructor - * Contains SKU in an ExpressRouteCircuit. - * - * @property {string} [name] The name of the SKU. - * @property {string} [tier] The tier of the SKU. Possible values are - * 'Standard', 'Premium' or 'Basic'. Possible values include: 'Standard', - * 'Premium', 'Basic' - * @property {string} [family] The family of the SKU. Possible values are: - * 'UnlimitedData' and 'MeteredData'. Possible values include: 'UnlimitedData', - * 'MeteredData' - */ -export interface ExpressRouteCircuitSku { - name?: string; - tier?: string; - family?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteCircuitServiceProviderProperties class. - * @constructor - * Contains ServiceProviderProperties in an ExpressRouteCircuit. - * - * @property {string} [serviceProviderName] The serviceProviderName. - * @property {string} [peeringLocation] The peering location. - * @property {number} [bandwidthInMbps] The BandwidthInMbps. - */ -export interface ExpressRouteCircuitServiceProviderProperties { - serviceProviderName?: string; - peeringLocation?: string; - bandwidthInMbps?: number; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteCircuit class. - * @constructor - * ExpressRouteCircuit resource - * - * @property {object} [sku] The SKU. - * @property {string} [sku.name] The name of the SKU. - * @property {string} [sku.tier] The tier of the SKU. Possible values are - * 'Standard', 'Premium' or 'Basic'. Possible values include: 'Standard', - * 'Premium', 'Basic' - * @property {string} [sku.family] The family of the SKU. Possible values are: - * 'UnlimitedData' and 'MeteredData'. Possible values include: 'UnlimitedData', - * 'MeteredData' - * @property {boolean} [allowClassicOperations] Allow classic operations - * @property {string} [circuitProvisioningState] The CircuitProvisioningState - * state of the resource. - * @property {string} [serviceProviderProvisioningState] The - * ServiceProviderProvisioningState state of the resource. Possible values are - * 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' - * @property {array} [authorizations] The list of authorizations. - * @property {array} [peerings] The list of peerings. - * @property {string} [serviceKey] The ServiceKey. - * @property {string} [serviceProviderNotes] The ServiceProviderNotes. - * @property {object} [serviceProviderProperties] The - * ServiceProviderProperties. - * @property {string} [serviceProviderProperties.serviceProviderName] The - * serviceProviderName. - * @property {string} [serviceProviderProperties.peeringLocation] The peering - * location. - * @property {number} [serviceProviderProperties.bandwidthInMbps] The - * BandwidthInMbps. - * @property {object} [expressRoutePort] The reference to the ExpressRoutePort - * resource when the circuit is provisioned on an ExpressRoutePort resource. - * @property {string} [expressRoutePort.id] Resource ID. - * @property {number} [bandwidthInGbps] The bandwidth of the circuit when the - * circuit is provisioned on an ExpressRoutePort resource. - * @property {number} [stag] The identifier of the circuit traffic. Outer tag - * for QinQ encapsulation. - * @property {string} [provisioningState] Gets the provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [gatewayManagerEtag] The GatewayManager Etag. - * @property {boolean} [allowGlobalReach] Flag to enable Global Reach on the - * circuit. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ -export interface ExpressRouteCircuit extends Resource { - sku?: ExpressRouteCircuitSku; - allowClassicOperations?: boolean; - circuitProvisioningState?: string; - serviceProviderProvisioningState?: string; - authorizations?: ExpressRouteCircuitAuthorization[]; - peerings?: ExpressRouteCircuitPeering[]; - serviceKey?: string; - serviceProviderNotes?: string; - serviceProviderProperties?: ExpressRouteCircuitServiceProviderProperties; - expressRoutePort?: SubResource; - bandwidthInGbps?: number; - readonly stag?: number; - provisioningState?: string; - gatewayManagerEtag?: string; - allowGlobalReach?: boolean; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteCircuitArpTable class. - * @constructor - * The ARP table associated with the ExpressRouteCircuit. - * - * @property {number} [age] Entry age in minutes - * @property {string} [interfaceProperty] Interface address - * @property {string} [ipAddress] The IP address. - * @property {string} [macAddress] The MAC address. - */ -export interface ExpressRouteCircuitArpTable { - age?: number; - interfaceProperty?: string; - ipAddress?: string; - macAddress?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteCircuitsArpTableListResult class. - * @constructor - * Response for ListArpTable associated with the Express Route Circuits API. - * - * @property {array} [value] Gets list of the ARP table. - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface ExpressRouteCircuitsArpTableListResult { - value?: ExpressRouteCircuitArpTable[]; - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteCircuitRoutesTable class. - * @constructor - * The routes table associated with the ExpressRouteCircuit - * - * @property {string} [network] IP address of a network entity - * @property {string} [nextHop] NextHop address - * @property {string} [locPrf] Local preference value as set with the set - * local-preference route-map configuration command - * @property {number} [weight] Route Weight. - * @property {string} [path] Autonomous system paths to the destination - * network. - */ -export interface ExpressRouteCircuitRoutesTable { - network?: string; - nextHop?: string; - locPrf?: string; - weight?: number; - path?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteCircuitsRoutesTableListResult class. - * @constructor - * Response for ListRoutesTable associated with the Express Route Circuits API. - * - * @property {array} [value] The list of routes table. - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface ExpressRouteCircuitsRoutesTableListResult { - value?: ExpressRouteCircuitRoutesTable[]; - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteCircuitRoutesTableSummary class. - * @constructor - * The routes table associated with the ExpressRouteCircuit. - * - * @property {string} [neighbor] IP address of the neighbor. - * @property {number} [v] BGP version number spoken to the neighbor. - * @property {number} [as] Autonomous system number. - * @property {string} [upDown] The length of time that the BGP session has been - * in the Established state, or the current status if not in the Established - * state. - * @property {string} [statePfxRcd] Current state of the BGP session, and the - * number of prefixes that have been received from a neighbor or peer group. - */ -export interface ExpressRouteCircuitRoutesTableSummary { - neighbor?: string; - v?: number; - as?: number; - upDown?: string; - statePfxRcd?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteCircuitsRoutesTableSummaryListResult class. - * @constructor - * Response for ListRoutesTable associated with the Express Route Circuits API. - * - * @property {array} [value] A list of the routes table. - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface ExpressRouteCircuitsRoutesTableSummaryListResult { - value?: ExpressRouteCircuitRoutesTableSummary[]; - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteServiceProviderBandwidthsOffered class. - * @constructor - * Contains bandwidths offered in ExpressRouteServiceProvider resources. - * - * @property {string} [offerName] The OfferName. - * @property {number} [valueInMbps] The ValueInMbps. - */ -export interface ExpressRouteServiceProviderBandwidthsOffered { - offerName?: string; - valueInMbps?: number; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteServiceProvider class. - * @constructor - * A ExpressRouteResourceProvider object. - * - * @property {array} [peeringLocations] Get a list of peering locations. - * @property {array} [bandwidthsOffered] Gets bandwidths offered. - * @property {string} [provisioningState] Gets the provisioning state of the - * resource. - */ -export interface ExpressRouteServiceProvider extends Resource { - peeringLocations?: string[]; - bandwidthsOffered?: ExpressRouteServiceProviderBandwidthsOffered[]; - provisioningState?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteCrossConnectionRoutesTableSummary class. - * @constructor - * The routes table associated with the ExpressRouteCircuit. - * - * @property {string} [neighbor] IP address of Neighbor router - * @property {number} [asn] Autonomous system number. - * @property {string} [upDown] The length of time that the BGP session has been - * in the Established state, or the current status if not in the Established - * state. - * @property {string} [stateOrPrefixesReceived] Current state of the BGP - * session, and the number of prefixes that have been received from a neighbor - * or peer group. - */ -export interface ExpressRouteCrossConnectionRoutesTableSummary { - neighbor?: string; - asn?: number; - upDown?: string; - stateOrPrefixesReceived?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteCrossConnectionsRoutesTableSummaryListResult class. - * @constructor - * Response for ListRoutesTable associated with the Express Route Cross - * Connections. - * - * @property {array} [value] A list of the routes table. - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface ExpressRouteCrossConnectionsRoutesTableSummaryListResult { - value?: ExpressRouteCrossConnectionRoutesTableSummary[]; - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteCircuitReference class. - * @constructor - * @property {string} [id] Corresponding Express Route Circuit Id. - */ -export interface ExpressRouteCircuitReference { - id?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteCrossConnectionPeering class. - * @constructor - * Peering in an ExpressRoute Cross Connection resource. - * - * @property {string} [peeringType] The peering type. Possible values include: - * 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' - * @property {string} [state] The peering state. Possible values include: - * 'Disabled', 'Enabled' - * @property {number} [azureASN] The Azure ASN. - * @property {number} [peerASN] The peer ASN. - * @property {string} [primaryPeerAddressPrefix] The primary address prefix. - * @property {string} [secondaryPeerAddressPrefix] The secondary address - * prefix. - * @property {string} [primaryAzurePort] The primary port. - * @property {string} [secondaryAzurePort] The secondary port. - * @property {string} [sharedKey] The shared key. - * @property {number} [vlanId] The VLAN ID. - * @property {object} [microsoftPeeringConfig] The Microsoft peering - * configuration. - * @property {array} [microsoftPeeringConfig.advertisedPublicPrefixes] The - * reference of AdvertisedPublicPrefixes. - * @property {array} [microsoftPeeringConfig.advertisedCommunities] The - * communities of bgp peering. Spepcified for microsoft peering - * @property {string} [microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * @property {number} [microsoftPeeringConfig.legacyMode] The legacy mode of - * the peering. - * @property {number} [microsoftPeeringConfig.customerASN] The CustomerASN of - * the peering. - * @property {string} [microsoftPeeringConfig.routingRegistryName] The - * RoutingRegistryName of the configuration. - * @property {string} [provisioningState] Gets the provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [gatewayManagerEtag] The GatewayManager Etag. - * @property {string} [lastModifiedBy] Gets whether the provider or the - * customer last modified the peering. - * @property {object} [ipv6PeeringConfig] The IPv6 peering configuration. - * @property {string} [ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. - * @property {string} [ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. - * @property {object} [ipv6PeeringConfig.microsoftPeeringConfig] The Microsoft - * peering configuration. - * @property {array} - * [ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] The - * reference of AdvertisedPublicPrefixes. - * @property {array} - * [ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] The - * communities of bgp peering. Spepcified for microsoft peering - * @property {string} - * [ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * @property {number} [ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. - * @property {number} [ipv6PeeringConfig.microsoftPeeringConfig.customerASN] - * The CustomerASN of the peering. - * @property {string} - * [ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] The - * RoutingRegistryName of the configuration. - * @property {object} [ipv6PeeringConfig.routeFilter] The reference of the - * RouteFilter resource. - * @property {array} [ipv6PeeringConfig.routeFilter.rules] Collection of - * RouteFilterRules contained within a route filter. - * @property {array} [ipv6PeeringConfig.routeFilter.peerings] A collection of - * references to express route circuit peerings. - * @property {string} [ipv6PeeringConfig.routeFilter.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', 'Succeeded' and 'Failed'. - * @property {string} [ipv6PeeringConfig.routeFilter.etag] Gets a unique - * read-only string that changes whenever the resource is updated. - * @property {string} [ipv6PeeringConfig.state] The state of peering. Possible - * values are: 'Disabled' and 'Enabled'. Possible values include: 'Disabled', - * 'Enabled' - * @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. - */ -export interface ExpressRouteCrossConnectionPeering extends SubResource { - peeringType?: string; - state?: string; - readonly azureASN?: number; - peerASN?: number; - primaryPeerAddressPrefix?: string; - secondaryPeerAddressPrefix?: string; - readonly primaryAzurePort?: string; - readonly secondaryAzurePort?: string; - sharedKey?: string; - vlanId?: number; - microsoftPeeringConfig?: ExpressRouteCircuitPeeringConfig; - readonly provisioningState?: string; - gatewayManagerEtag?: string; - lastModifiedBy?: string; - ipv6PeeringConfig?: Ipv6ExpressRouteCircuitPeeringConfig; - name?: string; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteCrossConnection class. - * @constructor - * ExpressRouteCrossConnection resource - * - * @property {string} [primaryAzurePort] The name of the primary port. - * @property {string} [secondaryAzurePort] The name of the secondary port. - * @property {number} [sTag] The identifier of the circuit traffic. - * @property {string} [peeringLocation] The peering location of the - * ExpressRoute circuit. - * @property {number} [bandwidthInMbps] The circuit bandwidth In Mbps. - * @property {object} [expressRouteCircuit] The ExpressRouteCircuit - * @property {string} [expressRouteCircuit.id] Corresponding Express Route - * Circuit Id. - * @property {string} [serviceProviderProvisioningState] The provisioning state - * of the circuit in the connectivity provider system. Possible values are - * 'NotProvisioned', 'Provisioning', 'Provisioned'. Possible values include: - * 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' - * @property {string} [serviceProviderNotes] Additional read only notes set by - * the connectivity provider. - * @property {string} [provisioningState] Gets the provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {array} [peerings] The list of peerings. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ -export interface ExpressRouteCrossConnection extends Resource { - readonly primaryAzurePort?: string; - readonly secondaryAzurePort?: string; - readonly sTag?: number; - peeringLocation?: string; - bandwidthInMbps?: number; - expressRouteCircuit?: ExpressRouteCircuitReference; - serviceProviderProvisioningState?: string; - serviceProviderNotes?: string; - readonly provisioningState?: string; - peerings?: ExpressRouteCrossConnectionPeering[]; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the VirtualHubId class. - * @constructor - * Virtual Hub identifier. - * - * @property {string} [id] The resource URI for the Virtual Hub where the - * ExpressRoute gateway is or will be deployed. The Virtual Hub resource and - * the ExpressRoute gateway resource reside in the same subscription. - */ -export interface VirtualHubId { - id?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteCircuitPeeringId class. - * @constructor - * ExpressRoute circuit peering identifier. - * - * @property {string} [id] The ID of the ExpressRoute circuit peering. - */ -export interface ExpressRouteCircuitPeeringId { - id?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds class. - * @constructor - * Minimum and maximum number of scale units to deploy. - * - * @property {number} [min] Minimum number of scale units deployed for - * ExpressRoute gateway. - * @property {number} [max] Maximum number of scale units deployed for - * ExpressRoute gateway. - */ -export interface ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds { - min?: number; - max?: number; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteGatewayPropertiesAutoScaleConfiguration class. - * @constructor - * Configuration for auto scaling. - * - * @property {object} [bounds] Minimum and maximum number of scale units to - * deploy. - * @property {number} [bounds.min] Minimum number of scale units deployed for - * ExpressRoute gateway. - * @property {number} [bounds.max] Maximum number of scale units deployed for - * ExpressRoute gateway. - */ -export interface ExpressRouteGatewayPropertiesAutoScaleConfiguration { - bounds?: ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteConnection class. - * @constructor - * ExpressRouteConnection resource. - * - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * @property {object} expressRouteCircuitPeering The ExpressRoute circuit - * peering. - * @property {string} [expressRouteCircuitPeering.id] The ID of the - * ExpressRoute circuit peering. - * @property {string} [authorizationKey] Authorization key to establish the - * connection. - * @property {number} [routingWeight] The routing weight associated to the - * connection. - * @property {string} name The name of the resource. - */ -export interface ExpressRouteConnection extends SubResource { - readonly provisioningState?: string; - expressRouteCircuitPeering: ExpressRouteCircuitPeeringId; - authorizationKey?: string; - routingWeight?: number; - name: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteGateway class. - * @constructor - * ExpressRoute gateway resource. - * - * @property {object} [autoScaleConfiguration] Configuration for auto scaling. - * @property {object} [autoScaleConfiguration.bounds] Minimum and maximum - * number of scale units to deploy. - * @property {number} [autoScaleConfiguration.bounds.min] Minimum number of - * scale units deployed for ExpressRoute gateway. - * @property {number} [autoScaleConfiguration.bounds.max] Maximum number of - * scale units deployed for ExpressRoute gateway. - * @property {array} [expressRouteConnections] List of ExpressRoute connections - * to the ExpressRoute gateway. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * @property {object} virtualHub The Virtual Hub where the ExpressRoute gateway - * is or will be deployed. - * @property {string} [virtualHub.id] The resource URI for the Virtual Hub - * where the ExpressRoute gateway is or will be deployed. The Virtual Hub - * resource and the ExpressRoute gateway resource reside in the same - * subscription. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ -export interface ExpressRouteGateway extends Resource { - autoScaleConfiguration?: ExpressRouteGatewayPropertiesAutoScaleConfiguration; - readonly expressRouteConnections?: ExpressRouteConnection[]; - readonly provisioningState?: string; - virtualHub: VirtualHubId; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteGatewayList class. - * @constructor - * List of ExpressRoute gateways. - * - * @property {array} [value] List of ExpressRoute gateways. - */ -export interface ExpressRouteGatewayList { - value?: ExpressRouteGateway[]; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteConnectionList class. - * @constructor - * ExpressRouteConnection list - * - * @property {array} [value] The list of ExpressRoute connections - */ -export interface ExpressRouteConnectionList { - value?: ExpressRouteConnection[]; -} - -/** - * @class - * Initializes a new instance of the ExpressRoutePortsLocationBandwidths class. - * @constructor - * @summary ExpressRoutePorts Location Bandwidths - * - * Real-time inventory of available ExpressRoute port bandwidths. - * - * @property {string} [offerName] Bandwidth descriptive name - * @property {number} [valueInGbps] Bandwidth value in Gbps - */ -export interface ExpressRoutePortsLocationBandwidths { - readonly offerName?: string; - readonly valueInGbps?: number; -} - -/** - * @class - * Initializes a new instance of the ExpressRoutePortsLocation class. - * @constructor - * @summary ExpressRoutePorts Peering Location - * - * Definition of the ExpressRoutePorts peering location resource. - * - * @property {string} [address] Address of peering location. - * @property {string} [contact] Contact details of peering locations. - * @property {array} [availableBandwidths] The inventory of available - * ExpressRoutePort bandwidths. - * @property {string} [provisioningState] The provisioning state of the - * ExpressRoutePortLocation resource. Possible values are: 'Succeeded', - * 'Updating', 'Deleting', and 'Failed'. - */ -export interface ExpressRoutePortsLocation extends Resource { - readonly address?: string; - readonly contact?: string; - availableBandwidths?: ExpressRoutePortsLocationBandwidths[]; - readonly provisioningState?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteLink class. - * @constructor - * @summary ExpressRouteLink - * - * ExpressRouteLink child resource definition. - * - * @property {string} [routerName] Name of Azure router associated with - * physical port. - * @property {string} [interfaceName] Name of Azure router interface. - * @property {string} [patchPanelId] Mapping between physical port to patch - * panel port. - * @property {string} [rackId] Mapping of physical patch panel to rack. - * @property {string} [connectorType] Physical fiber port type. Possible values - * include: 'LC', 'SC' - * @property {string} [adminState] Administrative state of the physical port. - * Possible values include: 'Enabled', 'Disabled' - * @property {string} [provisioningState] The provisioning state of the - * ExpressRouteLink resource. Possible values are: 'Succeeded', 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [name] Name of child port resource that is unique among - * child port resources of the parent. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ -export interface ExpressRouteLink extends SubResource { - readonly routerName?: string; - readonly interfaceName?: string; - readonly patchPanelId?: string; - readonly rackId?: string; - readonly connectorType?: string; - adminState?: string; - readonly provisioningState?: string; - name?: string; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRoutePort class. - * @constructor - * @summary ExpressRoute Port - * - * ExpressRoutePort resource definition. - * - * @property {string} [peeringLocation] The name of the peering location that - * the ExpressRoutePort is mapped to physically. - * @property {number} [bandwidthInGbps] Bandwidth of procured ports in Gbps - * @property {number} [provisionedBandwidthInGbps] Aggregate Gbps of associated - * circuit bandwidths. - * @property {string} [mtu] Maximum transmission unit of the physical port - * pair(s) - * @property {string} [encapsulation] Encapsulation method on physical ports. - * Possible values include: 'Dot1Q', 'QinQ' - * @property {string} [etherType] Ethertype of the physical port. - * @property {string} [allocationDate] Date of the physical port allocation to - * be used in Letter of Authorization. - * @property {array} [links] ExpressRouteLink Sub-Resources. The set of - * physical links of the ExpressRoutePort resource - * @property {array} [circuits] Reference the ExpressRoute circuit(s) that are - * provisioned on this ExpressRoutePort resource. - * @property {string} [provisioningState] The provisioning state of the - * ExpressRoutePort resource. Possible values are: 'Succeeded', 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [resourceGuid] The resource GUID property of the - * ExpressRoutePort resource. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ -export interface ExpressRoutePort extends Resource { - peeringLocation?: string; - bandwidthInGbps?: number; - readonly provisionedBandwidthInGbps?: number; - readonly mtu?: string; - encapsulation?: string; - readonly etherType?: string; - readonly allocationDate?: string; - links?: ExpressRouteLink[]; - readonly circuits?: SubResource[]; - readonly provisioningState?: string; - resourceGuid?: string; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the LoadBalancerSku class. - * @constructor - * SKU of a load balancer - * - * @property {string} [name] Name of a load balancer SKU. Possible values - * include: 'Basic', 'Standard' - */ -export interface LoadBalancerSku { - name?: string; -} - -/** - * @class - * Initializes a new instance of the LoadBalancingRule class. - * @constructor - * A load balancing rule for a load balancer. - * - * @property {object} [frontendIPConfiguration] A reference to frontend IP - * addresses. - * @property {string} [frontendIPConfiguration.id] Resource ID. - * @property {object} [backendAddressPool] A reference to a pool of DIPs. - * Inbound traffic is randomly load balanced across IPs in the backend IPs. - * @property {string} [backendAddressPool.id] Resource ID. - * @property {object} [probe] The reference of the load balancer probe used by - * the load balancing rule. - * @property {string} [probe.id] Resource ID. - * @property {string} protocol Possible values include: 'Udp', 'Tcp', 'All' - * @property {string} [loadDistribution] The load distribution policy for this - * rule. Possible values are 'Default', 'SourceIP', and 'SourceIPProtocol'. - * Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' - * @property {number} frontendPort The port for the external endpoint. Port - * numbers for each rule must be unique within the Load Balancer. Acceptable - * values are between 0 and 65534. Note that value 0 enables "Any Port" - * @property {number} [backendPort] The port used for internal connections on - * the endpoint. Acceptable values are between 0 and 65535. Note that value 0 - * enables "Any Port" - * @property {number} [idleTimeoutInMinutes] The timeout for the TCP idle - * connection. The value can be set between 4 and 30 minutes. The default value - * is 4 minutes. This element is only used when the protocol is set to TCP. - * @property {boolean} [enableFloatingIP] Configures a virtual machine's - * endpoint for the floating IP capability required to configure a SQL AlwaysOn - * Availability Group. This setting is required when using the SQL AlwaysOn - * Availability Groups in SQL server. This setting can't be changed after you - * create the endpoint. - * @property {boolean} [enableTcpReset] Receive bidirectional TCP Reset on TCP - * flow idle timeout or unexpected connection termination. This element is only - * used when the protocol is set to TCP. - * @property {boolean} [disableOutboundSnat] Configures SNAT for the VMs in the - * backend pool to use the publicIP address specified in the frontend of the - * load balancing rule. - * @property {string} [provisioningState] Gets the provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [name] The 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. - */ -export interface LoadBalancingRule extends SubResource { - frontendIPConfiguration?: SubResource; - backendAddressPool?: SubResource; - probe?: SubResource; - protocol: string; - loadDistribution?: string; - frontendPort: number; - backendPort?: number; - idleTimeoutInMinutes?: number; - enableFloatingIP?: boolean; - enableTcpReset?: boolean; - disableOutboundSnat?: boolean; - provisioningState?: string; - name?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the Probe class. - * @constructor - * A load balancer probe. - * - * @property {array} [loadBalancingRules] The load balancer rules that use this - * probe. - * @property {string} protocol The protocol of the end point. Possible values - * are: 'Http', 'Tcp', or 'Https'. If 'Tcp' is specified, a received ACK is - * required for the probe to be successful. If 'Http' or 'Https' is specified, - * a 200 OK response from the specifies URI is required for the probe to be - * successful. Possible values include: 'Http', 'Tcp', 'Https' - * @property {number} port The port for communicating the probe. Possible - * values range from 1 to 65535, inclusive. - * @property {number} [intervalInSeconds] The interval, in seconds, for how - * frequently to probe the endpoint for health status. Typically, the interval - * is slightly less than half the allocated timeout period (in seconds) which - * allows two full probes before taking the instance out of rotation. The - * default value is 15, the minimum value is 5. - * @property {number} [numberOfProbes] The number of probes where if no - * response, will result in stopping further traffic from being delivered to - * the endpoint. This values allows endpoints to be taken out of rotation - * faster or slower than the typical times used in Azure. - * @property {string} [requestPath] The URI used for requesting health status - * from the VM. Path is required if a protocol is set to http. Otherwise, it is - * not allowed. There is no default value. - * @property {string} [provisioningState] Gets the provisioning state of the - * public IP resource. Possible values are: '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. - */ -export interface Probe extends SubResource { - readonly loadBalancingRules?: SubResource[]; - protocol: string; - port: number; - intervalInSeconds?: number; - numberOfProbes?: number; - requestPath?: string; - provisioningState?: string; - name?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the InboundNatPool class. - * @constructor - * Inbound NAT pool of the load balancer. - * - * @property {object} [frontendIPConfiguration] A reference to frontend IP - * addresses. - * @property {string} [frontendIPConfiguration.id] Resource ID. - * @property {string} protocol Possible values include: 'Udp', 'Tcp', 'All' - * @property {number} frontendPortRangeStart The first port number in the range - * of external ports that will be used to provide Inbound Nat to NICs - * associated with a load balancer. Acceptable values range between 1 and - * 65534. - * @property {number} frontendPortRangeEnd The last port number in the range of - * external ports that will be used to provide Inbound Nat to NICs associated - * with a load balancer. Acceptable values range between 1 and 65535. - * @property {number} backendPort The port used for internal connections on the - * endpoint. Acceptable values are between 1 and 65535. - * @property {number} [idleTimeoutInMinutes] The timeout for the TCP idle - * connection. The value can be set between 4 and 30 minutes. The default value - * is 4 minutes. This element is only used when the protocol is set to TCP. - * @property {boolean} [enableFloatingIP] Configures a virtual machine's - * endpoint for the floating IP capability required to configure a SQL AlwaysOn - * Availability Group. This setting is required when using the SQL AlwaysOn - * Availability Groups in SQL server. This setting can't be changed after you - * create the endpoint. - * @property {boolean} [enableTcpReset] Receive bidirectional TCP Reset on TCP - * flow idle timeout or unexpected connection termination. This element is only - * used when the protocol is set to TCP. - * @property {string} [provisioningState] Gets the provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [name] The 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. - */ -export interface InboundNatPool extends SubResource { - frontendIPConfiguration?: SubResource; - protocol: string; - frontendPortRangeStart: number; - frontendPortRangeEnd: number; - backendPort: number; - idleTimeoutInMinutes?: number; - enableFloatingIP?: boolean; - enableTcpReset?: boolean; - provisioningState?: string; - name?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the OutboundRule class. - * @constructor - * Outbound pool of the load balancer. - * - * @property {number} [allocatedOutboundPorts] The number of outbound ports to - * be used for NAT. - * @property {array} frontendIPConfigurations The Frontend IP addresses of the - * load balancer. - * @property {object} backendAddressPool A reference to a pool of DIPs. - * Outbound traffic is randomly load balanced across IPs in the backend IPs. - * @property {string} [backendAddressPool.id] Resource ID. - * @property {string} [provisioningState] Gets the provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} protocol Protocol - TCP, UDP or All. Possible values - * include: 'Tcp', 'Udp', 'All' - * @property {boolean} [enableTcpReset] Receive bidirectional TCP Reset on TCP - * flow idle timeout or unexpected connection termination. This element is only - * used when the protocol is set to TCP. - * @property {number} [idleTimeoutInMinutes] The timeout for the TCP idle - * connection - * @property {string} [name] The 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. - */ -export interface OutboundRule extends SubResource { - allocatedOutboundPorts?: number; - frontendIPConfigurations: SubResource[]; - backendAddressPool: SubResource; - provisioningState?: string; - protocol: string; - enableTcpReset?: boolean; - idleTimeoutInMinutes?: number; - name?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the LoadBalancer class. - * @constructor - * LoadBalancer resource - * - * @property {object} [sku] The load balancer SKU. - * @property {string} [sku.name] Name of a load balancer SKU. Possible values - * include: 'Basic', 'Standard' - * @property {array} [frontendIPConfigurations] Object representing the - * frontend IPs to be used for the load balancer - * @property {array} [backendAddressPools] Collection of backend address pools - * used by a load balancer - * @property {array} [loadBalancingRules] Object collection representing the - * load balancing rules Gets the provisioning - * @property {array} [probes] Collection of probe objects used in the load - * balancer - * @property {array} [inboundNatRules] Collection of inbound NAT Rules used by - * a load balancer. Defining inbound NAT rules on your load balancer is - * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are - * referenced from virtual machine scale sets. NICs that are associated with - * individual virtual machines cannot reference an Inbound NAT pool. They have - * to reference individual inbound NAT rules. - * @property {array} [inboundNatPools] Defines an external port range for - * inbound NAT to a single backend port on NICs associated with a load - * balancer. Inbound NAT rules are created automatically for each NIC - * associated with the Load Balancer using an external port from this range. - * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive - * with defining inbound Nat rules. Inbound NAT pools are referenced from - * virtual machine scale sets. NICs that are associated with individual virtual - * machines cannot reference an inbound NAT pool. They have to reference - * individual inbound NAT rules. - * @property {array} [outboundRules] The outbound rules. - * @property {string} [resourceGuid] The resource GUID property of the load - * balancer resource. - * @property {string} [provisioningState] Gets the provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ -export interface LoadBalancer extends Resource { - sku?: LoadBalancerSku; - frontendIPConfigurations?: FrontendIPConfiguration[]; - backendAddressPools?: BackendAddressPool[]; - loadBalancingRules?: LoadBalancingRule[]; - probes?: Probe[]; - inboundNatRules?: InboundNatRule[]; - inboundNatPools?: InboundNatPool[]; - outboundRules?: OutboundRule[]; - resourceGuid?: string; - provisioningState?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the ErrorDetails class. - * @constructor - * @property {string} [code] - * @property {string} [target] - * @property {string} [message] - */ -export interface ErrorDetails { - code?: string; - target?: string; - message?: string; -} - -/** - * @class - * Initializes a new instance of the ErrorModel class. - * @constructor - * @property {string} [code] - * @property {string} [message] - * @property {string} [target] - * @property {array} [details] - * @property {string} [innerError] - */ -export interface ErrorModel { - code?: string; - message?: string; - target?: string; - details?: ErrorDetails[]; - innerError?: string; -} - -/** - * @class - * Initializes a new instance of the AzureAsyncOperationResult class. - * @constructor - * The response body contains the status of the specified asynchronous - * operation, indicating whether it has succeeded, is in progress, or has - * failed. Note that this status is distinct from the HTTP status code returned - * for the Get Operation Status operation itself. If the asynchronous operation - * succeeded, the response body includes the HTTP status code for the - * successful request. If the asynchronous operation failed, the response body - * includes the HTTP status code for the failed request and error information - * regarding the failure. - * - * @property {string} [status] Status of the Azure async operation. Possible - * values are: 'InProgress', 'Succeeded', and 'Failed'. Possible values - * include: 'InProgress', 'Succeeded', 'Failed' - * @property {object} [error] - * @property {string} [error.code] - * @property {string} [error.message] - * @property {string} [error.target] - * @property {array} [error.details] - * @property {string} [error.innerError] - */ -export interface AzureAsyncOperationResult { - status?: string; - error?: ErrorModel; -} - -/** - * @class - * Initializes a new instance of the EffectiveNetworkSecurityGroupAssociation class. - * @constructor - * The effective network security group association. - * - * @property {object} [subnet] The ID of the subnet if assigned. - * @property {string} [subnet.id] Resource ID. - * @property {object} [networkInterface] The ID of the network interface if - * assigned. - * @property {string} [networkInterface.id] Resource ID. - */ -export interface EffectiveNetworkSecurityGroupAssociation { - subnet?: SubResource; - networkInterface?: SubResource; -} - -/** - * @class - * Initializes a new instance of the EffectiveNetworkSecurityRule class. - * @constructor - * Effective network security rules. - * - * @property {string} [name] The name of the security rule specified by the - * user (if created by the user). - * @property {string} [protocol] The network protocol this rule applies to. - * Possible values are: 'Tcp', 'Udp', and 'All'. Possible values include: - * 'Tcp', 'Udp', 'All' - * @property {string} [sourcePortRange] The source port or range. - * @property {string} [destinationPortRange] The destination port or range. - * @property {array} [sourcePortRanges] The source port ranges. Expected values - * include a single integer between 0 and 65535, a range using '-' as seperator - * (e.g. 100-400), or an asterix (*) - * @property {array} [destinationPortRanges] The destination port ranges. - * Expected values include a single integer between 0 and 65535, a range using - * '-' as seperator (e.g. 100-400), or an asterix (*) - * @property {string} [sourceAddressPrefix] The source address prefix. - * @property {string} [destinationAddressPrefix] The destination address - * prefix. - * @property {array} [sourceAddressPrefixes] The source address prefixes. - * Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, - * AureLoadBalancer, Internet), System Tags, and the asterix (*). - * @property {array} [destinationAddressPrefixes] The destination address - * prefixes. Expected values include CIDR IP ranges, Default Tags - * (VirtualNetwork, AureLoadBalancer, Internet), System Tags, and the asterix - * (*). - * @property {array} [expandedSourceAddressPrefix] The expanded source address - * prefix. - * @property {array} [expandedDestinationAddressPrefix] Expanded destination - * address prefix. - * @property {string} [access] Whether network traffic is allowed or denied. - * Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', - * 'Deny' - * @property {number} [priority] The priority of the rule. - * @property {string} [direction] The direction of the rule. Possible values - * are: 'Inbound and Outbound'. Possible values include: 'Inbound', 'Outbound' - */ -export interface EffectiveNetworkSecurityRule { - name?: string; - protocol?: string; - sourcePortRange?: string; - destinationPortRange?: string; - sourcePortRanges?: string[]; - destinationPortRanges?: string[]; - sourceAddressPrefix?: string; - destinationAddressPrefix?: string; - sourceAddressPrefixes?: string[]; - destinationAddressPrefixes?: string[]; - expandedSourceAddressPrefix?: string[]; - expandedDestinationAddressPrefix?: string[]; - access?: string; - priority?: number; - direction?: string; -} - -/** - * @class - * Initializes a new instance of the EffectiveNetworkSecurityGroup class. - * @constructor - * Effective network security group. - * - * @property {object} [networkSecurityGroup] The ID of network security group - * that is applied. - * @property {string} [networkSecurityGroup.id] Resource ID. - * @property {object} [association] Associated resources. - * @property {object} [association.subnet] The ID of the subnet if assigned. - * @property {string} [association.subnet.id] Resource ID. - * @property {object} [association.networkInterface] The ID of the network - * interface if assigned. - * @property {string} [association.networkInterface.id] Resource ID. - * @property {array} [effectiveSecurityRules] A collection of effective - * security rules. - * @property {object} [tagMap] Mapping of tags to list of IP Addresses included - * within the tag. - */ -export interface EffectiveNetworkSecurityGroup { - networkSecurityGroup?: SubResource; - association?: EffectiveNetworkSecurityGroupAssociation; - effectiveSecurityRules?: EffectiveNetworkSecurityRule[]; - tagMap?: { [propertyName: string]: string[] }; -} - -/** - * @class - * Initializes a new instance of the EffectiveNetworkSecurityGroupListResult class. - * @constructor - * Response for list effective network security groups API service call. - * - * @property {array} [value] A list of effective network security groups. - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface EffectiveNetworkSecurityGroupListResult { - value?: EffectiveNetworkSecurityGroup[]; - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the EffectiveRoute class. - * @constructor - * Effective Route - * - * @property {string} [name] The name of the user defined route. This is - * optional. - * @property {string} [source] Who created the route. Possible values are: - * 'Unknown', 'User', 'VirtualNetworkGateway', and 'Default'. Possible values - * include: 'Unknown', 'User', 'VirtualNetworkGateway', 'Default' - * @property {string} [state] The value of effective route. Possible values - * are: 'Active' and 'Invalid'. Possible values include: 'Active', 'Invalid' - * @property {array} [addressPrefix] The address prefixes of the effective - * routes in CIDR notation. - * @property {array} [nextHopIpAddress] The IP address of the next hop of the - * effective route. - * @property {string} [nextHopType] The type of Azure hop the packet should be - * sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', - * 'Internet', 'VirtualAppliance', and 'None'. Possible values include: - * 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', 'None' - */ -export interface EffectiveRoute { - name?: string; - source?: string; - state?: string; - addressPrefix?: string[]; - nextHopIpAddress?: string[]; - nextHopType?: string; -} - -/** - * @class - * Initializes a new instance of the EffectiveRouteListResult class. - * @constructor - * Response for list effective route API service call. - * - * @property {array} [value] A list of effective routes. - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface EffectiveRouteListResult { - value?: EffectiveRoute[]; - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ContainerNetworkInterfaceConfiguration class. - * @constructor - * Container network interface configruation child resource. - * - * @property {array} [ipConfigurations] A list of ip configurations of the - * container network interface configuration. - * @property {array} [containerNetworkInterfaces] A list of container network - * interfaces created from this container network interface configuration. - * @property {string} [provisioningState] The provisioning state of the - * resource. - * @property {string} [name] The name of the resource. This name can be used to - * access the resource. - * @property {string} [type] Sub Resource type. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ -export interface ContainerNetworkInterfaceConfiguration extends SubResource { - ipConfigurations?: IPConfigurationProfile[]; - containerNetworkInterfaces?: SubResource[]; - readonly provisioningState?: string; - name?: string; - readonly type?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the Container class. - * @constructor - * Reference to container resource in remote resource provider. - * - */ -export interface Container extends SubResource { -} - -/** - * @class - * Initializes a new instance of the ContainerNetworkInterfaceIpConfiguration class. - * @constructor - * The ip configuration for a container network interface. - * - * @property {string} [provisioningState] The provisioning state of the - * resource. - * @property {string} [name] The name of the resource. This name can be used to - * access the resource. - * @property {string} [type] Sub Resource type. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ -export interface ContainerNetworkInterfaceIpConfiguration { - readonly provisioningState?: string; - name?: string; - readonly type?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the ContainerNetworkInterface class. - * @constructor - * Container network interface child resource. - * - * @property {object} [containerNetworkInterfaceConfiguration] Container - * network interface configuration from which this container network interface - * is created. - * @property {array} [containerNetworkInterfaceConfiguration.ipConfigurations] - * A list of ip configurations of the container network interface - * configuration. - * @property {array} - * [containerNetworkInterfaceConfiguration.containerNetworkInterfaces] A list - * of container network interfaces created from this container network - * interface configuration. - * @property {string} - * [containerNetworkInterfaceConfiguration.provisioningState] The provisioning - * state of the resource. - * @property {string} [containerNetworkInterfaceConfiguration.name] The name of - * the resource. This name can be used to access the resource. - * @property {string} [containerNetworkInterfaceConfiguration.type] Sub - * Resource type. - * @property {string} [containerNetworkInterfaceConfiguration.etag] A unique - * read-only string that changes whenever the resource is updated. - * @property {object} [container] Reference to the conatinaer to which this - * container network interface is attached. - * @property {array} [ipConfigurations] Reference to the ip configuration on - * this container nic. - * @property {string} [provisioningState] The provisioning state of the - * resource. - * @property {string} [name] The name of the resource. This name can be used to - * access the resource. - * @property {string} [type] Sub Resource type. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ -export interface ContainerNetworkInterface extends SubResource { - containerNetworkInterfaceConfiguration?: ContainerNetworkInterfaceConfiguration; - container?: Container; - ipConfigurations?: ContainerNetworkInterfaceIpConfiguration[]; - readonly provisioningState?: string; - name?: string; - readonly type?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the NetworkProfile class. - * @constructor - * Network profile resource. - * - * @property {array} [containerNetworkInterfaces] List of child container - * network interfaces. - * @property {array} [containerNetworkInterfaceConfigurations] List of chid - * container network interface configurations. - * @property {string} [resourceGuid] The resource GUID property of the network - * interface resource. - * @property {string} [provisioningState] The provisioning state of the - * resource. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ -export interface NetworkProfile extends Resource { - containerNetworkInterfaces?: ContainerNetworkInterface[]; - containerNetworkInterfaceConfigurations?: ContainerNetworkInterfaceConfiguration[]; - readonly resourceGuid?: string; - readonly provisioningState?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the ErrorResponse class. - * @constructor - * The error object. - * - * @property {object} [error] Error. - * @property {string} [error.code] - * @property {string} [error.target] - * @property {string} [error.message] - */ -export interface ErrorResponse { - error?: ErrorDetails; -} - -/** - * @class - * Initializes a new instance of the NetworkWatcher class. - * @constructor - * Network watcher in a resource group. - * - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - */ -export interface NetworkWatcher extends Resource { - etag?: string; - readonly provisioningState?: string; -} - -/** - * @class - * Initializes a new instance of the TopologyParameters class. - * @constructor - * Parameters that define the representation of topology. - * - * @property {string} [targetResourceGroupName] The name of the target resource - * group to perform topology on. - * @property {object} [targetVirtualNetwork] The reference of the Virtual - * Network resource. - * @property {string} [targetVirtualNetwork.id] Resource ID. - * @property {object} [targetSubnet] The reference of the Subnet resource. - * @property {string} [targetSubnet.id] Resource ID. - */ -export interface TopologyParameters { - targetResourceGroupName?: string; - targetVirtualNetwork?: SubResource; - targetSubnet?: SubResource; -} - -/** - * @class - * Initializes a new instance of the TopologyAssociation class. - * @constructor - * Resources that have an association with the parent resource. - * - * @property {string} [name] The name of the resource that is associated with - * the parent resource. - * @property {string} [resourceId] The ID of the resource that is associated - * with the parent resource. - * @property {string} [associationType] The association type of the child - * resource to the parent resource. Possible values include: 'Associated', - * 'Contains' - */ -export interface TopologyAssociation { - name?: string; - resourceId?: string; - associationType?: string; -} - -/** - * @class - * Initializes a new instance of the TopologyResource class. - * @constructor - * The network resource topology information for the given resource group. - * - * @property {string} [name] Name of the resource. - * @property {string} [id] ID of the resource. - * @property {string} [location] Resource location. - * @property {array} [associations] Holds the associations the resource has - * with other resources in the resource group. - */ -export interface TopologyResource { - name?: string; - id?: string; - location?: string; - associations?: TopologyAssociation[]; -} - -/** - * @class - * Initializes a new instance of the Topology class. - * @constructor - * Topology of the specified resource group. - * - * @property {string} [id] GUID representing the operation id. - * @property {date} [createdDateTime] The datetime when the topology was - * initially created for the resource group. - * @property {date} [lastModified] The datetime when the topology was last - * modified. - * @property {array} [resources] - */ -export interface Topology { - readonly id?: string; - readonly createdDateTime?: Date; - readonly lastModified?: Date; - resources?: TopologyResource[]; -} - -/** - * @class - * Initializes a new instance of the VerificationIPFlowParameters class. - * @constructor - * Parameters that define the IP flow to be verified. - * - * @property {string} targetResourceId The ID of the target resource to perform - * next-hop on. - * @property {string} direction The direction of the packet represented as a - * 5-tuple. Possible values include: 'Inbound', 'Outbound' - * @property {string} protocol Protocol to be verified on. Possible values - * include: 'TCP', 'UDP' - * @property {string} localPort The local port. Acceptable values are a single - * integer in the range (0-65535). Support for * for the source port, which - * depends on the direction. - * @property {string} remotePort The remote port. Acceptable values are a - * single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * @property {string} localIPAddress The local IP address. Acceptable values - * are valid IPv4 addresses. - * @property {string} remoteIPAddress The remote IP address. Acceptable values - * are valid IPv4 addresses. - * @property {string} [targetNicResourceId] The NIC ID. (If VM has multiple - * NICs and IP forwarding is enabled on any of them, then this parameter must - * be specified. Otherwise optional). - */ -export interface VerificationIPFlowParameters { - targetResourceId: string; - direction: string; - protocol: string; - localPort: string; - remotePort: string; - localIPAddress: string; - remoteIPAddress: string; - targetNicResourceId?: string; -} - -/** - * @class - * Initializes a new instance of the VerificationIPFlowResult class. - * @constructor - * Results of IP flow verification on the target resource. - * - * @property {string} [access] Indicates whether the traffic is allowed or - * denied. Possible values include: 'Allow', 'Deny' - * @property {string} [ruleName] Name of the rule. If input is not matched - * against any security rule, it is not displayed. - */ -export interface VerificationIPFlowResult { - access?: string; - ruleName?: string; -} - -/** - * @class - * Initializes a new instance of the NextHopParameters class. - * @constructor - * Parameters that define the source and destination endpoint. - * - * @property {string} targetResourceId The resource identifier of the target - * resource against which the action is to be performed. - * @property {string} sourceIPAddress The source IP address. - * @property {string} destinationIPAddress The destination IP address. - * @property {string} [targetNicResourceId] The NIC ID. (If VM has multiple - * NICs and IP forwarding is enabled on any of the nics, then this parameter - * must be specified. Otherwise optional). - */ -export interface NextHopParameters { - targetResourceId: string; - sourceIPAddress: string; - destinationIPAddress: string; - targetNicResourceId?: string; -} - -/** - * @class - * Initializes a new instance of the NextHopResult class. - * @constructor - * The information about next hop from the specified VM. - * - * @property {string} [nextHopType] Next hop type. Possible values include: - * 'Internet', 'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal', - * 'HyperNetGateway', 'None' - * @property {string} [nextHopIpAddress] Next hop IP Address - * @property {string} [routeTableId] The resource identifier for the route - * table associated with the route being returned. If the route being returned - * does not correspond to any user created routes then this field will be the - * string 'System Route'. - */ -export interface NextHopResult { - nextHopType?: string; - nextHopIpAddress?: string; - routeTableId?: string; -} - -/** - * @class - * Initializes a new instance of the SecurityGroupViewParameters class. - * @constructor - * Parameters that define the VM to check security groups for. - * - * @property {string} targetResourceId ID of the target VM. - */ -export interface SecurityGroupViewParameters { - targetResourceId: string; -} - -/** - * @class - * Initializes a new instance of the NetworkInterfaceAssociation class. - * @constructor - * Network interface and its custom security rules. - * - * @property {string} [id] Network interface ID. - * @property {array} [securityRules] Collection of custom security rules. - */ -export interface NetworkInterfaceAssociation { - readonly id?: string; - securityRules?: SecurityRule[]; -} - -/** - * @class - * Initializes a new instance of the SubnetAssociation class. - * @constructor - * Network interface and its custom security rules. - * - * @property {string} [id] Subnet ID. - * @property {array} [securityRules] Collection of custom security rules. - */ -export interface SubnetAssociation { - readonly id?: string; - securityRules?: SecurityRule[]; -} - -/** - * @class - * Initializes a new instance of the SecurityRuleAssociations class. - * @constructor - * All security rules associated with the network interface. - * - * @property {object} [networkInterfaceAssociation] - * @property {string} [networkInterfaceAssociation.id] Network interface ID. - * @property {array} [networkInterfaceAssociation.securityRules] Collection of - * custom security rules. - * @property {object} [subnetAssociation] - * @property {string} [subnetAssociation.id] Subnet ID. - * @property {array} [subnetAssociation.securityRules] Collection of custom - * security rules. - * @property {array} [defaultSecurityRules] Collection of default security - * rules of the network security group. - * @property {array} [effectiveSecurityRules] Collection of effective security - * rules. - */ -export interface SecurityRuleAssociations { - networkInterfaceAssociation?: NetworkInterfaceAssociation; - subnetAssociation?: SubnetAssociation; - defaultSecurityRules?: SecurityRule[]; - effectiveSecurityRules?: EffectiveNetworkSecurityRule[]; -} - -/** - * @class - * Initializes a new instance of the SecurityGroupNetworkInterface class. - * @constructor - * Network interface and all its associated security rules. - * - * @property {string} [id] ID of the network interface. - * @property {object} [securityRuleAssociations] - * @property {object} [securityRuleAssociations.networkInterfaceAssociation] - * @property {string} [securityRuleAssociations.networkInterfaceAssociation.id] - * Network interface ID. - * @property {array} - * [securityRuleAssociations.networkInterfaceAssociation.securityRules] - * Collection of custom security rules. - * @property {object} [securityRuleAssociations.subnetAssociation] - * @property {string} [securityRuleAssociations.subnetAssociation.id] Subnet - * ID. - * @property {array} [securityRuleAssociations.subnetAssociation.securityRules] - * Collection of custom security rules. - * @property {array} [securityRuleAssociations.defaultSecurityRules] Collection - * of default security rules of the network security group. - * @property {array} [securityRuleAssociations.effectiveSecurityRules] - * Collection of effective security rules. - */ -export interface SecurityGroupNetworkInterface { - id?: string; - securityRuleAssociations?: SecurityRuleAssociations; -} - -/** - * @class - * Initializes a new instance of the SecurityGroupViewResult class. - * @constructor - * The information about security rules applied to the specified VM. - * - * @property {array} [networkInterfaces] List of network interfaces on the - * specified VM. - */ -export interface SecurityGroupViewResult { - networkInterfaces?: SecurityGroupNetworkInterface[]; -} - -/** - * @class - * Initializes a new instance of the PacketCaptureStorageLocation class. - * @constructor - * Describes the storage location for a packet capture session. - * - * @property {string} [storageId] The ID of the storage account to save the - * packet capture session. Required if no local file path is provided. - * @property {string} [storagePath] The URI of the storage path to save the - * packet capture. Must be a well-formed URI describing the location to save - * the packet capture. - * @property {string} [filePath] A valid local path on the targeting VM. Must - * include the name of the capture file (*.cap). For linux virtual machine it - * must start with /var/captures. Required if no storage ID is provided, - * otherwise optional. - */ -export interface PacketCaptureStorageLocation { - storageId?: string; - storagePath?: string; - filePath?: string; -} - -/** - * @class - * Initializes a new instance of the PacketCaptureFilter class. - * @constructor - * Filter that is applied to packet capture request. Multiple filters can be - * applied. - * - * @property {string} [protocol] Protocol to be filtered on. Possible values - * include: 'TCP', 'UDP', 'Any'. Default value: 'Any' . - * @property {string} [localIPAddress] Local IP Address to be filtered on. - * Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for - * range. "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not - * currently supported. Mixing ranges with multiple entries not currently - * supported. Default = null. - * @property {string} [remoteIPAddress] Local IP Address to be filtered on. - * Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for - * range. "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not - * currently supported. Mixing ranges with multiple entries not currently - * supported. Default = null. - * @property {string} [localPort] Local port to be filtered on. Notation: "80" - * for single port entry."80-85" for range. "80;443;" for multiple entries. - * Multiple ranges not currently supported. Mixing ranges with multiple entries - * not currently supported. Default = null. - * @property {string} [remotePort] Remote port to be filtered on. Notation: - * "80" for single port entry."80-85" for range. "80;443;" for multiple - * entries. Multiple ranges not currently supported. Mixing ranges with - * multiple entries not currently supported. Default = null. - */ -export interface PacketCaptureFilter { - protocol?: string; - localIPAddress?: string; - remoteIPAddress?: string; - localPort?: string; - remotePort?: string; -} - -/** - * @class - * Initializes a new instance of the PacketCaptureParameters class. - * @constructor - * Parameters that define the create packet capture operation. - * - * @property {string} target The ID of the targeted resource, only VM is - * currently supported. - * @property {number} [bytesToCapturePerPacket] Number of bytes captured per - * packet, the remaining bytes are truncated. Default value: 0 . - * @property {number} [totalBytesPerSession] Maximum size of the capture - * output. Default value: 1073741824 . - * @property {number} [timeLimitInSeconds] Maximum duration of the capture - * session in seconds. Default value: 18000 . - * @property {object} storageLocation - * @property {string} [storageLocation.storageId] The ID of the storage account - * to save the packet capture session. Required if no local file path is - * provided. - * @property {string} [storageLocation.storagePath] The URI of the storage path - * to save the packet capture. Must be a well-formed URI describing the - * location to save the packet capture. - * @property {string} [storageLocation.filePath] A valid local path on the - * targeting VM. Must include the name of the capture file (*.cap). For linux - * virtual machine it must start with /var/captures. Required if no storage ID - * is provided, otherwise optional. - * @property {array} [filters] - */ -export interface PacketCaptureParameters { - target: string; - bytesToCapturePerPacket?: number; - totalBytesPerSession?: number; - timeLimitInSeconds?: number; - storageLocation: PacketCaptureStorageLocation; - filters?: PacketCaptureFilter[]; -} - -/** - * @class - * Initializes a new instance of the PacketCapture class. - * @constructor - * Parameters that define the create packet capture operation. - * - * @property {string} target The ID of the targeted resource, only VM is - * currently supported. - * @property {number} [bytesToCapturePerPacket] Number of bytes captured per - * packet, the remaining bytes are truncated. Default value: 0 . - * @property {number} [totalBytesPerSession] Maximum size of the capture - * output. Default value: 1073741824 . - * @property {number} [timeLimitInSeconds] Maximum duration of the capture - * session in seconds. Default value: 18000 . - * @property {object} storageLocation - * @property {string} [storageLocation.storageId] The ID of the storage account - * to save the packet capture session. Required if no local file path is - * provided. - * @property {string} [storageLocation.storagePath] The URI of the storage path - * to save the packet capture. Must be a well-formed URI describing the - * location to save the packet capture. - * @property {string} [storageLocation.filePath] A valid local path on the - * targeting VM. Must include the name of the capture file (*.cap). For linux - * virtual machine it must start with /var/captures. Required if no storage ID - * is provided, otherwise optional. - * @property {array} [filters] - */ -export interface PacketCapture { - target: string; - bytesToCapturePerPacket?: number; - totalBytesPerSession?: number; - timeLimitInSeconds?: number; - storageLocation: PacketCaptureStorageLocation; - filters?: PacketCaptureFilter[]; -} - -/** - * @class - * Initializes a new instance of the PacketCaptureResult class. - * @constructor - * Information about packet capture session. - * - * @property {string} [name] Name of the packet capture session. - * @property {string} [id] ID of the packet capture operation. - * @property {string} [etag] Default value: 'A unique read-only string that - * changes whenever the resource is updated.' . - * @property {string} target The ID of the targeted resource, only VM is - * currently supported. - * @property {number} [bytesToCapturePerPacket] Number of bytes captured per - * packet, the remaining bytes are truncated. Default value: 0 . - * @property {number} [totalBytesPerSession] Maximum size of the capture - * output. Default value: 1073741824 . - * @property {number} [timeLimitInSeconds] Maximum duration of the capture - * session in seconds. Default value: 18000 . - * @property {object} storageLocation - * @property {string} [storageLocation.storageId] The ID of the storage account - * to save the packet capture session. Required if no local file path is - * provided. - * @property {string} [storageLocation.storagePath] The URI of the storage path - * to save the packet capture. Must be a well-formed URI describing the - * location to save the packet capture. - * @property {string} [storageLocation.filePath] A valid local path on the - * targeting VM. Must include the name of the capture file (*.cap). For linux - * virtual machine it must start with /var/captures. Required if no storage ID - * is provided, otherwise optional. - * @property {array} [filters] - * @property {string} [provisioningState] The provisioning state of the packet - * capture session. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - */ -export interface PacketCaptureResult { - readonly name?: string; - readonly id?: string; - etag?: string; - target: string; - bytesToCapturePerPacket?: number; - totalBytesPerSession?: number; - timeLimitInSeconds?: number; - storageLocation: PacketCaptureStorageLocation; - filters?: PacketCaptureFilter[]; - provisioningState?: string; -} - -/** - * @class - * Initializes a new instance of the PacketCaptureQueryStatusResult class. - * @constructor - * Status of packet capture session. - * - * @property {string} [name] The name of the packet capture resource. - * @property {string} [id] The ID of the packet capture resource. - * @property {date} [captureStartTime] The start time of the packet capture - * session. - * @property {string} [packetCaptureStatus] The status of the packet capture - * session. Possible values include: 'NotStarted', 'Running', 'Stopped', - * 'Error', 'Unknown' - * @property {string} [stopReason] The reason the current packet capture - * session was stopped. - * @property {array} [packetCaptureError] List of errors of packet capture - * session. - */ -export interface PacketCaptureQueryStatusResult { - name?: string; - id?: string; - captureStartTime?: Date; - packetCaptureStatus?: string; - stopReason?: string; - packetCaptureError?: string[]; -} - -/** - * @class - * Initializes a new instance of the TroubleshootingParameters class. - * @constructor - * Parameters that define the resource to troubleshoot. - * - * @property {string} targetResourceId The target resource to troubleshoot. - * @property {string} storageId The ID for the storage account to save the - * troubleshoot result. - * @property {string} storagePath The path to the blob to save the troubleshoot - * result in. - */ -export interface TroubleshootingParameters { - targetResourceId: string; - storageId: string; - storagePath: string; -} - -/** - * @class - * Initializes a new instance of the QueryTroubleshootingParameters class. - * @constructor - * Parameters that define the resource to query the troubleshooting result. - * - * @property {string} targetResourceId The target resource ID to query the - * troubleshooting result. - */ -export interface QueryTroubleshootingParameters { - targetResourceId: string; -} - -/** - * @class - * Initializes a new instance of the TroubleshootingRecommendedActions class. - * @constructor - * Recommended actions based on discovered issues. - * - * @property {string} [actionId] ID of the recommended action. - * @property {string} [actionText] Description of recommended actions. - * @property {string} [actionUri] The uri linking to a documentation for the - * recommended troubleshooting actions. - * @property {string} [actionUriText] The information from the URI for the - * recommended troubleshooting actions. - */ -export interface TroubleshootingRecommendedActions { - actionId?: string; - actionText?: string; - actionUri?: string; - actionUriText?: string; -} - -/** - * @class - * Initializes a new instance of the TroubleshootingDetails class. - * @constructor - * Information gained from troubleshooting of specified resource. - * - * @property {string} [id] The id of the get troubleshoot operation. - * @property {string} [reasonType] Reason type of failure. - * @property {string} [summary] A summary of troubleshooting. - * @property {string} [detail] Details on troubleshooting results. - * @property {array} [recommendedActions] List of recommended actions. - */ -export interface TroubleshootingDetails { - id?: string; - reasonType?: string; - summary?: string; - detail?: string; - recommendedActions?: TroubleshootingRecommendedActions[]; -} - -/** - * @class - * Initializes a new instance of the TroubleshootingResult class. - * @constructor - * Troubleshooting information gained from specified resource. - * - * @property {date} [startTime] The start time of the troubleshooting. - * @property {date} [endTime] The end time of the troubleshooting. - * @property {string} [code] The result code of the troubleshooting. - * @property {array} [results] Information from troubleshooting. - */ -export interface TroubleshootingResult { - startTime?: Date; - endTime?: Date; - code?: string; - results?: TroubleshootingDetails[]; -} - -/** - * @class - * Initializes a new instance of the RetentionPolicyParameters class. - * @constructor - * Parameters that define the retention policy for flow log. - * - * @property {number} [days] Number of days to retain flow log records. Default - * value: 0 . - * @property {boolean} [enabled] Flag to enable/disable retention. Default - * value: false . - */ -export interface RetentionPolicyParameters { - days?: number; - enabled?: boolean; -} - -/** - * @class - * Initializes a new instance of the FlowLogFormatParameters class. - * @constructor - * Parameters that define the flow log format. - * - * @property {string} [type] The file type of flow log. Possible values - * include: 'JSON' - * @property {number} [version] The version (revision) of the flow log. Default - * value: 0 . - */ -export interface FlowLogFormatParameters { - type?: string; - version?: number; -} - -/** - * @class - * Initializes a new instance of the FlowLogStatusParameters class. - * @constructor - * Parameters that define a resource to query flow log and traffic analytics - * (optional) status. - * - * @property {string} targetResourceId The target resource where getting the - * flow log and traffic analytics (optional) status. - */ -export interface FlowLogStatusParameters { - targetResourceId: string; -} - -/** - * @class - * Initializes a new instance of the TrafficAnalyticsConfigurationProperties class. - * @constructor - * Parameters that define the configuration of traffic analytics. - * - * @property {boolean} enabled Flag to enable/disable traffic analytics. - * @property {string} workspaceId The resource guid of the attached workspace - * @property {string} workspaceRegion The location of the attached workspace - * @property {string} workspaceResourceId Resource Id of the attached workspace - * @property {number} [trafficAnalyticsInterval] The interval in minutes which - * would decide how frequently TA service should do flow analytics - */ -export interface TrafficAnalyticsConfigurationProperties { - enabled: boolean; - workspaceId: string; - workspaceRegion: string; - workspaceResourceId: string; - trafficAnalyticsInterval?: number; -} - -/** - * @class - * Initializes a new instance of the TrafficAnalyticsProperties class. - * @constructor - * Parameters that define the configuration of traffic analytics. - * - * @property {object} networkWatcherFlowAnalyticsConfiguration - * @property {boolean} [networkWatcherFlowAnalyticsConfiguration.enabled] Flag - * to enable/disable traffic analytics. - * @property {string} [networkWatcherFlowAnalyticsConfiguration.workspaceId] - * The resource guid of the attached workspace - * @property {string} - * [networkWatcherFlowAnalyticsConfiguration.workspaceRegion] The location of - * the attached workspace - * @property {string} - * [networkWatcherFlowAnalyticsConfiguration.workspaceResourceId] Resource Id - * of the attached workspace - * @property {number} - * [networkWatcherFlowAnalyticsConfiguration.trafficAnalyticsInterval] The - * interval in minutes which would decide how frequently TA service should do - * flow analytics - */ -export interface TrafficAnalyticsProperties { - networkWatcherFlowAnalyticsConfiguration: TrafficAnalyticsConfigurationProperties; -} - -/** - * @class - * Initializes a new instance of the FlowLogInformation class. - * @constructor - * Information on the configuration of flow log and traffic analytics - * (optional) . - * - * @property {string} targetResourceId The ID of the resource to configure for - * flow log and traffic analytics (optional) . - * @property {string} storageId ID of the storage account which is used to - * store the flow log. - * @property {boolean} enabled Flag to enable/disable flow logging. - * @property {object} [retentionPolicy] - * @property {number} [retentionPolicy.days] Number of days to retain flow log - * records. - * @property {boolean} [retentionPolicy.enabled] Flag to enable/disable - * retention. - * @property {object} [format] - * @property {string} [format.type] The file type of flow log. Possible values - * include: 'JSON' - * @property {number} [format.version] The version (revision) of the flow log. - * @property {object} [flowAnalyticsConfiguration] - * @property {object} - * [flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration] - * @property {boolean} - * [flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled] - * Flag to enable/disable traffic analytics. - * @property {string} - * [flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId] - * The resource guid of the attached workspace - * @property {string} - * [flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion] - * The location of the attached workspace - * @property {string} - * [flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId] - * Resource Id of the attached workspace - * @property {number} - * [flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.trafficAnalyticsInterval] - * The interval in minutes which would decide how frequently TA service should - * do flow analytics - */ -export interface FlowLogInformation { - targetResourceId: string; - storageId: string; - enabled: boolean; - retentionPolicy?: RetentionPolicyParameters; - format?: FlowLogFormatParameters; - flowAnalyticsConfiguration?: TrafficAnalyticsProperties; -} - -/** - * @class - * Initializes a new instance of the ConnectivitySource class. - * @constructor - * Parameters that define the source of the connection. - * - * @property {string} resourceId The ID of the resource from which a - * connectivity check will be initiated. - * @property {number} [port] The source port from which a connectivity check - * will be performed. - */ -export interface ConnectivitySource { - resourceId: string; - port?: number; -} - -/** - * @class - * Initializes a new instance of the ConnectivityDestination class. - * @constructor - * Parameters that define destination of connection. - * - * @property {string} [resourceId] The ID of the resource to which a connection - * attempt will be made. - * @property {string} [address] The IP address or URI the resource to which a - * connection attempt will be made. - * @property {number} [port] Port on which check connectivity will be - * performed. - */ -export interface ConnectivityDestination { - resourceId?: string; - address?: string; - port?: number; -} - -/** - * @class - * Initializes a new instance of the HTTPHeader class. - * @constructor - * Describes the HTTP header. - * - * @property {string} [name] The name in HTTP header. - * @property {string} [value] The value in HTTP header. - */ -export interface HTTPHeader { - name?: string; - value?: string; -} - -/** - * @class - * Initializes a new instance of the HTTPConfiguration class. - * @constructor - * HTTP configuration of the connectivity check. - * - * @property {string} [method] HTTP method. Possible values include: 'Get' - * @property {array} [headers] List of HTTP headers. - * @property {array} [validStatusCodes] Valid status codes. - */ -export interface HTTPConfiguration { - method?: string; - headers?: HTTPHeader[]; - validStatusCodes?: number[]; -} - -/** - * @class - * Initializes a new instance of the ProtocolConfiguration class. - * @constructor - * Configuration of the protocol. - * - * @property {object} [hTTPConfiguration] - * @property {string} [hTTPConfiguration.method] HTTP method. Possible values - * include: 'Get' - * @property {array} [hTTPConfiguration.headers] List of HTTP headers. - * @property {array} [hTTPConfiguration.validStatusCodes] Valid status codes. - */ -export interface ProtocolConfiguration { - hTTPConfiguration?: HTTPConfiguration; -} - -/** - * @class - * Initializes a new instance of the ConnectivityParameters class. - * @constructor - * Parameters that determine how the connectivity check will be performed. - * - * @property {object} source - * @property {string} [source.resourceId] The ID of the resource from which a - * connectivity check will be initiated. - * @property {number} [source.port] The source port from which a connectivity - * check will be performed. - * @property {object} destination - * @property {string} [destination.resourceId] The ID of the resource to which - * a connection attempt will be made. - * @property {string} [destination.address] The IP address or URI the resource - * to which a connection attempt will be made. - * @property {number} [destination.port] Port on which check connectivity will - * be performed. - * @property {string} [protocol] Network protocol. Possible values include: - * 'Tcp', 'Http', 'Https', 'Icmp' - * @property {object} [protocolConfiguration] - * @property {object} [protocolConfiguration.hTTPConfiguration] - * @property {string} [protocolConfiguration.hTTPConfiguration.method] HTTP - * method. Possible values include: 'Get' - * @property {array} [protocolConfiguration.hTTPConfiguration.headers] List of - * HTTP headers. - * @property {array} [protocolConfiguration.hTTPConfiguration.validStatusCodes] - * Valid status codes. - */ -export interface ConnectivityParameters { - source: ConnectivitySource; - destination: ConnectivityDestination; - protocol?: string; - protocolConfiguration?: ProtocolConfiguration; -} - -/** - * @class - * Initializes a new instance of the ConnectivityIssue class. - * @constructor - * Information about an issue encountered in the process of checking for - * connectivity. - * - * @property {string} [origin] The origin of the issue. Possible values - * include: 'Local', 'Inbound', 'Outbound' - * @property {string} [severity] The severity of the issue. Possible values - * include: 'Error', 'Warning' - * @property {string} [type] The type of issue. Possible values include: - * 'Unknown', 'AgentStopped', 'GuestFirewall', 'DnsResolution', 'SocketBind', - * 'NetworkSecurityRule', 'UserDefinedRoute', 'PortThrottled', 'Platform' - * @property {array} [context] Provides additional context on the issue. - */ -export interface ConnectivityIssue { - readonly origin?: string; - readonly severity?: string; - readonly type?: string; - readonly context?: { [propertyName: string]: string }[]; -} - -/** - * @class - * Initializes a new instance of the ConnectivityHop class. - * @constructor - * Information about a hop between the source and the destination. - * - * @property {string} [type] The type of the hop. - * @property {string} [id] The ID of the hop. - * @property {string} [address] The IP address of the hop. - * @property {string} [resourceId] The ID of the resource corresponding to this - * hop. - * @property {array} [nextHopIds] List of next hop identifiers. - * @property {array} [issues] List of issues. - */ -export interface ConnectivityHop { - readonly type?: string; - readonly id?: string; - readonly address?: string; - readonly resourceId?: string; - readonly nextHopIds?: string[]; - readonly issues?: ConnectivityIssue[]; -} - -/** - * @class - * Initializes a new instance of the ConnectivityInformation class. - * @constructor - * Information on the connectivity status. - * - * @property {array} [hops] List of hops between the source and the - * destination. - * @property {string} [connectionStatus] The connection status. Possible values - * include: 'Unknown', 'Connected', 'Disconnected', 'Degraded' - * @property {number} [avgLatencyInMs] Average latency in milliseconds. - * @property {number} [minLatencyInMs] Minimum latency in milliseconds. - * @property {number} [maxLatencyInMs] Maximum latency in milliseconds. - * @property {number} [probesSent] Total number of probes sent. - * @property {number} [probesFailed] Number of failed probes. - */ -export interface ConnectivityInformation { - readonly hops?: ConnectivityHop[]; - readonly connectionStatus?: string; - readonly avgLatencyInMs?: number; - readonly minLatencyInMs?: number; - readonly maxLatencyInMs?: number; - readonly probesSent?: number; - readonly probesFailed?: number; -} - -/** - * @class - * Initializes a new instance of the AzureReachabilityReportLocation class. - * @constructor - * Parameters that define a geographic location. - * - * @property {string} country The name of the country. - * @property {string} [state] The name of the state. - * @property {string} [city] The name of the city or town. - */ -export interface AzureReachabilityReportLocation { - country: string; - state?: string; - city?: string; -} - -/** - * @class - * Initializes a new instance of the AzureReachabilityReportParameters class. - * @constructor - * Geographic and time constraints for Azure reachability report. - * - * @property {object} providerLocation - * @property {string} [providerLocation.country] The name of the country. - * @property {string} [providerLocation.state] The name of the state. - * @property {string} [providerLocation.city] The name of the city or town. - * @property {array} [providers] List of Internet service providers. - * @property {array} [azureLocations] Optional Azure regions to scope the query - * to. - * @property {date} startTime The start time for the Azure reachability report. - * @property {date} endTime The end time for the Azure reachability report. - */ -export interface AzureReachabilityReportParameters { - providerLocation: AzureReachabilityReportLocation; - providers?: string[]; - azureLocations?: string[]; - startTime: Date; - endTime: Date; -} - -/** - * @class - * Initializes a new instance of the AzureReachabilityReportLatencyInfo class. - * @constructor - * Details on latency for a time series. - * - * @property {date} [timeStamp] The time stamp. - * @property {number} [score] The relative latency score between 1 and 100, - * higher values indicating a faster connection. - */ -export interface AzureReachabilityReportLatencyInfo { - timeStamp?: Date; - score?: number; -} - -/** - * @class - * Initializes a new instance of the AzureReachabilityReportItem class. - * @constructor - * Azure reachability report details for a given provider location. - * - * @property {string} [provider] The Internet service provider. - * @property {string} [azureLocation] The Azure region. - * @property {array} [latencies] List of latency details for each of the time - * series. - */ -export interface AzureReachabilityReportItem { - provider?: string; - azureLocation?: string; - latencies?: AzureReachabilityReportLatencyInfo[]; -} - -/** - * @class - * Initializes a new instance of the AzureReachabilityReport class. - * @constructor - * Azure reachability report details. - * - * @property {string} aggregationLevel The aggregation level of Azure - * reachability report. Can be Country, State or City. - * @property {object} providerLocation - * @property {string} [providerLocation.country] The name of the country. - * @property {string} [providerLocation.state] The name of the state. - * @property {string} [providerLocation.city] The name of the city or town. - * @property {array} reachabilityReport List of Azure reachability report - * items. - */ -export interface AzureReachabilityReport { - aggregationLevel: string; - providerLocation: AzureReachabilityReportLocation; - reachabilityReport: AzureReachabilityReportItem[]; -} - -/** - * @class - * Initializes a new instance of the AvailableProvidersListParameters class. - * @constructor - * Constraints that determine the list of available Internet service providers. - * - * @property {array} [azureLocations] A list of Azure regions. - * @property {string} [country] The country for available providers list. - * @property {string} [state] The state for available providers list. - * @property {string} [city] The city or town for available providers list. - */ -export interface AvailableProvidersListParameters { - azureLocations?: string[]; - country?: string; - state?: string; - city?: string; -} - -/** - * @class - * Initializes a new instance of the AvailableProvidersListCity class. - * @constructor - * City or town details. - * - * @property {string} [cityName] The city or town name. - * @property {array} [providers] A list of Internet service providers. - */ -export interface AvailableProvidersListCity { - cityName?: string; - providers?: string[]; -} - -/** - * @class - * Initializes a new instance of the AvailableProvidersListState class. - * @constructor - * State details. - * - * @property {string} [stateName] The state name. - * @property {array} [providers] A list of Internet service providers. - * @property {array} [cities] List of available cities or towns in the state. - */ -export interface AvailableProvidersListState { - stateName?: string; - providers?: string[]; - cities?: AvailableProvidersListCity[]; -} - -/** - * @class - * Initializes a new instance of the AvailableProvidersListCountry class. - * @constructor - * Country details. - * - * @property {string} [countryName] The country name. - * @property {array} [providers] A list of Internet service providers. - * @property {array} [states] List of available states in the country. - */ -export interface AvailableProvidersListCountry { - countryName?: string; - providers?: string[]; - states?: AvailableProvidersListState[]; -} - -/** - * @class - * Initializes a new instance of the AvailableProvidersList class. - * @constructor - * List of available countries with details. - * - * @property {array} countries List of available countries. - */ -export interface AvailableProvidersList { - countries: AvailableProvidersListCountry[]; -} - -/** - * @class - * Initializes a new instance of the ConnectionMonitorSource class. - * @constructor - * Describes the source of connection monitor. - * - * @property {string} resourceId The ID of the resource used as the source by - * connection monitor. - * @property {number} [port] The source port used by connection monitor. - */ -export interface ConnectionMonitorSource { - resourceId: string; - port?: number; -} - -/** - * @class - * Initializes a new instance of the ConnectionMonitorDestination class. - * @constructor - * Describes the destination of connection monitor. - * - * @property {string} [resourceId] The ID of the resource used as the - * destination by connection monitor. - * @property {string} [address] Address of the connection monitor destination - * (IP or domain name). - * @property {number} [port] The destination port used by connection monitor. - */ -export interface ConnectionMonitorDestination { - resourceId?: string; - address?: string; - port?: number; -} - -/** - * @class - * Initializes a new instance of the ConnectionMonitorParameters class. - * @constructor - * Parameters that define the operation to create a connection monitor. - * - * @property {object} source - * @property {string} [source.resourceId] The ID of the resource used as the - * source by connection monitor. - * @property {number} [source.port] The source port used by connection monitor. - * @property {object} destination - * @property {string} [destination.resourceId] The ID of the resource used as - * the destination by connection monitor. - * @property {string} [destination.address] Address of the connection monitor - * destination (IP or domain name). - * @property {number} [destination.port] The destination port used by - * connection monitor. - * @property {boolean} [autoStart] Determines if the connection monitor will - * start automatically once created. Default value: true . - * @property {number} [monitoringIntervalInSeconds] Monitoring interval in - * seconds. Default value: 60 . - */ -export interface ConnectionMonitorParameters { - source: ConnectionMonitorSource; - destination: ConnectionMonitorDestination; - autoStart?: boolean; - monitoringIntervalInSeconds?: number; -} - -/** - * @class - * Initializes a new instance of the ConnectionMonitor class. - * @constructor - * Parameters that define the operation to create a connection monitor. - * - * @property {string} [location] Connection monitor location. - * @property {object} [tags] Connection monitor tags. - * @property {object} source - * @property {string} [source.resourceId] The ID of the resource used as the - * source by connection monitor. - * @property {number} [source.port] The source port used by connection monitor. - * @property {object} destination - * @property {string} [destination.resourceId] The ID of the resource used as - * the destination by connection monitor. - * @property {string} [destination.address] Address of the connection monitor - * destination (IP or domain name). - * @property {number} [destination.port] The destination port used by - * connection monitor. - * @property {boolean} [autoStart] Determines if the connection monitor will - * start automatically once created. Default value: true . - * @property {number} [monitoringIntervalInSeconds] Monitoring interval in - * seconds. Default value: 60 . - */ -export interface ConnectionMonitor { - location?: string; - tags?: { [propertyName: string]: string }; - source: ConnectionMonitorSource; - destination: ConnectionMonitorDestination; - autoStart?: boolean; - monitoringIntervalInSeconds?: number; -} - -/** - * @class - * Initializes a new instance of the ConnectionMonitorResult class. - * @constructor - * Information about the connection monitor. - * - * @property {string} [name] Name of the connection monitor. - * @property {string} [id] ID of the connection monitor. - * @property {string} [etag] Default value: 'A unique read-only string that - * changes whenever the resource is updated.' . - * @property {string} [type] Connection monitor type. - * @property {string} [location] Connection monitor location. - * @property {object} [tags] Connection monitor tags. - * @property {object} source - * @property {string} [source.resourceId] The ID of the resource used as the - * source by connection monitor. - * @property {number} [source.port] The source port used by connection monitor. - * @property {object} destination - * @property {string} [destination.resourceId] The ID of the resource used as - * the destination by connection monitor. - * @property {string} [destination.address] Address of the connection monitor - * destination (IP or domain name). - * @property {number} [destination.port] The destination port used by - * connection monitor. - * @property {boolean} [autoStart] Determines if the connection monitor will - * start automatically once created. Default value: true . - * @property {number} [monitoringIntervalInSeconds] Monitoring interval in - * seconds. Default value: 60 . - * @property {string} [provisioningState] The provisioning state of the - * connection monitor. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * @property {date} [startTime] The date and time when the connection monitor - * was started. - * @property {string} [monitoringStatus] The monitoring status of the - * connection monitor. - */ -export interface ConnectionMonitorResult extends BaseResource { - readonly name?: string; - readonly id?: string; - etag?: string; - readonly type?: string; - location?: string; - tags?: { [propertyName: string]: string }; - source: ConnectionMonitorSource; - destination: ConnectionMonitorDestination; - autoStart?: boolean; - monitoringIntervalInSeconds?: number; - provisioningState?: string; - startTime?: Date; - monitoringStatus?: string; -} - -/** - * @class - * Initializes a new instance of the ConnectionStateSnapshot class. - * @constructor - * Connection state snapshot. - * - * @property {string} [connectionState] The connection state. Possible values - * include: 'Reachable', 'Unreachable', 'Unknown' - * @property {date} [startTime] The start time of the connection snapshot. - * @property {date} [endTime] The end time of the connection snapshot. - * @property {string} [evaluationState] Connectivity analysis evaluation state. - * Possible values include: 'NotStarted', 'InProgress', 'Completed' - * @property {number} [avgLatencyInMs] Average latency in ms. - * @property {number} [minLatencyInMs] Minimum latency in ms. - * @property {number} [maxLatencyInMs] Maximum latency in ms. - * @property {number} [probesSent] The number of sent probes. - * @property {number} [probesFailed] The number of failed probes. - * @property {array} [hops] List of hops between the source and the - * destination. - */ -export interface ConnectionStateSnapshot { - connectionState?: string; - startTime?: Date; - endTime?: Date; - evaluationState?: string; - avgLatencyInMs?: number; - minLatencyInMs?: number; - maxLatencyInMs?: number; - probesSent?: number; - probesFailed?: number; - readonly hops?: ConnectivityHop[]; -} - -/** - * @class - * Initializes a new instance of the ConnectionMonitorQueryResult class. - * @constructor - * List of connection states snaphots. - * - * @property {string} [sourceStatus] Status of connection monitor source. - * Possible values include: 'Uknown', 'Active', 'Inactive' - * @property {array} [states] Information about connection states. - */ -export interface ConnectionMonitorQueryResult { - sourceStatus?: string; - states?: ConnectionStateSnapshot[]; -} - -/** - * @class - * Initializes a new instance of the NetworkConfigurationDiagnosticProfile class. - * @constructor - * Parameters to compare with network configuration. - * - * @property {string} direction The direction of the traffic. Accepted values - * are 'Inbound' and 'Outbound'. Possible values include: 'Inbound', 'Outbound' - * @property {string} protocol Protocol to be verified on. Accepted values are - * '*', TCP, UDP. - * @property {string} source Traffic source. Accepted values are '*', IP - * Address/CIDR, Service Tag. - * @property {string} destination Traffic destination. Accepted values are: - * '*', IP Address/CIDR, Service Tag. - * @property {string} destinationPort Traffice destination port. Accepted - * values are '*', port (for example, 3389) and port range (for example, - * 80-100). - */ -export interface NetworkConfigurationDiagnosticProfile { - direction: string; - protocol: string; - source: string; - destination: string; - destinationPort: string; -} - -/** - * @class - * Initializes a new instance of the NetworkConfigurationDiagnosticParameters class. - * @constructor - * Parameters to get network configuration diagnostic. - * - * @property {string} targetResourceId The ID of the target resource to perform - * network configuration diagnostic. Valid options are VM, NetworkInterface, - * VMSS/NetworkInterface and Application Gateway. - * @property {string} [verbosityLevel] Verbosity level. Accepted values are - * 'Normal', 'Minimum', 'Full'. Possible values include: 'Normal', 'Minimum', - * 'Full' - * @property {array} profiles List of network configuration diagnostic - * profiles. - */ -export interface NetworkConfigurationDiagnosticParameters { - targetResourceId: string; - verbosityLevel?: string; - profiles: NetworkConfigurationDiagnosticProfile[]; -} - -/** - * @class - * Initializes a new instance of the MatchedRule class. - * @constructor - * Matched rule. - * - * @property {string} [ruleName] Name of the matched network security rule. - * @property {string} [action] The network traffic is allowed or denied. - * Possible values are 'Allow' and 'Deny'. - */ -export interface MatchedRule { - ruleName?: string; - action?: string; -} - -/** - * @class - * Initializes a new instance of the NetworkSecurityRulesEvaluationResult class. - * @constructor - * Network security rules evaluation result. - * - * @property {string} [name] Name of the network security rule. - * @property {boolean} [protocolMatched] Value indicating whether protocol is - * matched. - * @property {boolean} [sourceMatched] Value indicating whether source is - * matched. - * @property {boolean} [sourcePortMatched] Value indicating whether source port - * is matched. - * @property {boolean} [destinationMatched] Value indicating whether - * destination is matched. - * @property {boolean} [destinationPortMatched] Value indicating whether - * destination port is matched. - */ -export interface NetworkSecurityRulesEvaluationResult { - name?: string; - protocolMatched?: boolean; - sourceMatched?: boolean; - sourcePortMatched?: boolean; - destinationMatched?: boolean; - destinationPortMatched?: boolean; -} - -/** - * @class - * Initializes a new instance of the EvaluatedNetworkSecurityGroup class. - * @constructor - * Results of network security group evaluation. - * - * @property {string} [networkSecurityGroupId] Network security group ID. - * @property {string} [appliedTo] Resource ID of nic or subnet to which network - * security group is applied. - * @property {object} [matchedRule] - * @property {string} [matchedRule.ruleName] Name of the matched network - * security rule. - * @property {string} [matchedRule.action] The network traffic is allowed or - * denied. Possible values are 'Allow' and 'Deny'. - * @property {array} [rulesEvaluationResult] List of network security rules - * evaluation results. - */ -export interface EvaluatedNetworkSecurityGroup { - networkSecurityGroupId?: string; - appliedTo?: string; - matchedRule?: MatchedRule; - readonly rulesEvaluationResult?: NetworkSecurityRulesEvaluationResult[]; -} - -/** - * @class - * Initializes a new instance of the NetworkSecurityGroupResult class. - * @constructor - * Network configuration diagnostic result corresponded provided traffic query. - * - * @property {string} [securityRuleAccessResult] The network traffic is allowed - * or denied. Possible values are 'Allow' and 'Deny'. Possible values include: - * 'Allow', 'Deny' - * @property {array} [evaluatedNetworkSecurityGroups] List of results network - * security groups diagnostic. - */ -export interface NetworkSecurityGroupResult { - securityRuleAccessResult?: string; - readonly evaluatedNetworkSecurityGroups?: EvaluatedNetworkSecurityGroup[]; -} - -/** - * @class - * Initializes a new instance of the NetworkConfigurationDiagnosticResult class. - * @constructor - * Network configuration diagnostic result corresponded to provided traffic - * query. - * - * @property {object} [profile] - * @property {string} [profile.direction] The direction of the traffic. - * Accepted values are 'Inbound' and 'Outbound'. Possible values include: - * 'Inbound', 'Outbound' - * @property {string} [profile.protocol] Protocol to be verified on. Accepted - * values are '*', TCP, UDP. - * @property {string} [profile.source] Traffic source. Accepted values are '*', - * IP Address/CIDR, Service Tag. - * @property {string} [profile.destination] Traffic destination. Accepted - * values are: '*', IP Address/CIDR, Service Tag. - * @property {string} [profile.destinationPort] Traffice destination port. - * Accepted values are '*', port (for example, 3389) and port range (for - * example, 80-100). - * @property {object} [networkSecurityGroupResult] - * @property {string} [networkSecurityGroupResult.securityRuleAccessResult] The - * network traffic is allowed or denied. Possible values are 'Allow' and - * 'Deny'. Possible values include: 'Allow', 'Deny' - * @property {array} - * [networkSecurityGroupResult.evaluatedNetworkSecurityGroups] List of results - * network security groups diagnostic. - */ -export interface NetworkConfigurationDiagnosticResult { - profile?: NetworkConfigurationDiagnosticProfile; - networkSecurityGroupResult?: NetworkSecurityGroupResult; -} - -/** - * @class - * Initializes a new instance of the NetworkConfigurationDiagnosticResponse class. - * @constructor - * Results of network configuration diagnostic on the target resource. - * - * @property {array} [results] List of network configuration diagnostic - * results. - */ -export interface NetworkConfigurationDiagnosticResponse { - readonly results?: NetworkConfigurationDiagnosticResult[]; -} - -/** - * @class - * Initializes a new instance of the OperationDisplay class. - * @constructor - * Display metadata associated with the operation. - * - * @property {string} [provider] Service provider: Microsoft Network. - * @property {string} [resource] Resource on which the operation is performed. - * @property {string} [operation] Type of the operation: get, read, delete, - * etc. - * @property {string} [description] Description of the operation. - */ -export interface OperationDisplay { - provider?: string; - resource?: string; - operation?: string; - description?: string; -} - -/** - * @class - * Initializes a new instance of the Availability class. - * @constructor - * Availability of the metric. - * - * @property {string} [timeGrain] The time grain of the availability. - * @property {string} [retention] The retention of the availability. - * @property {string} [blobDuration] Duration of the availability blob. - */ -export interface Availability { - timeGrain?: string; - retention?: string; - blobDuration?: string; -} - -/** - * @class - * Initializes a new instance of the Dimension class. - * @constructor - * Dimension of the metric. - * - * @property {string} [name] The name of the dimension. - * @property {string} [displayName] The display name of the dimension. - * @property {string} [internalName] The internal name of the dimension. - */ -export interface Dimension { - name?: string; - displayName?: string; - internalName?: string; -} - -/** - * @class - * Initializes a new instance of the MetricSpecification class. - * @constructor - * Description of metrics specification. - * - * @property {string} [name] The name of the metric. - * @property {string} [displayName] The display name of the metric. - * @property {string} [displayDescription] The description of the metric. - * @property {string} [unit] Units the metric to be displayed in. - * @property {string} [aggregationType] The aggregation type. - * @property {array} [availabilities] List of availability. - * @property {boolean} [enableRegionalMdmAccount] Whether regional MDM account - * enabled. - * @property {boolean} [fillGapWithZero] Whether gaps would be filled with - * zeros. - * @property {string} [metricFilterPattern] Pattern for the filter of the - * metric. - * @property {array} [dimensions] List of dimensions. - * @property {boolean} [isInternal] Whether the metric is internal. - * @property {string} [sourceMdmAccount] The source MDM account. - * @property {string} [sourceMdmNamespace] The source MDM namespace. - * @property {string} [resourceIdDimensionNameOverride] The resource Id - * dimension name override. - */ -export interface MetricSpecification { - name?: string; - displayName?: string; - displayDescription?: string; - unit?: string; - aggregationType?: string; - availabilities?: Availability[]; - enableRegionalMdmAccount?: boolean; - fillGapWithZero?: boolean; - metricFilterPattern?: string; - dimensions?: Dimension[]; - isInternal?: boolean; - sourceMdmAccount?: string; - sourceMdmNamespace?: string; - resourceIdDimensionNameOverride?: string; -} - -/** - * @class - * Initializes a new instance of the LogSpecification class. - * @constructor - * Description of logging specification. - * - * @property {string} [name] The name of the specification. - * @property {string} [displayName] The display name of the specification. - * @property {string} [blobDuration] Duration of the blob. - */ -export interface LogSpecification { - name?: string; - displayName?: string; - blobDuration?: string; -} - -/** - * @class - * Initializes a new instance of the OperationPropertiesFormatServiceSpecification class. - * @constructor - * Specification of the service. - * - * @property {array} [metricSpecifications] Operation service specification. - * @property {array} [logSpecifications] Operation log specification. - */ -export interface OperationPropertiesFormatServiceSpecification { - metricSpecifications?: MetricSpecification[]; - logSpecifications?: LogSpecification[]; -} - -/** - * @class - * Initializes a new instance of the Operation class. - * @constructor - * Network REST API operation definition. - * - * @property {string} [name] Operation name: {provider}/{resource}/{operation} - * @property {object} [display] Display metadata associated with the operation. - * @property {string} [display.provider] Service provider: Microsoft Network. - * @property {string} [display.resource] Resource on which the operation is - * performed. - * @property {string} [display.operation] Type of the operation: get, read, - * delete, etc. - * @property {string} [display.description] Description of the operation. - * @property {string} [origin] Origin of the operation. - * @property {object} [serviceSpecification] Specification of the service. - * @property {array} [serviceSpecification.metricSpecifications] Operation - * service specification. - * @property {array} [serviceSpecification.logSpecifications] Operation log - * specification. - */ -export interface Operation { - name?: string; - display?: OperationDisplay; - origin?: string; - serviceSpecification?: OperationPropertiesFormatServiceSpecification; -} - -/** - * @class - * Initializes a new instance of the PublicIPPrefixSku class. - * @constructor - * SKU of a public IP prefix - * - * @property {string} [name] Name of a public IP prefix SKU. Possible values - * include: 'Standard' - */ -export interface PublicIPPrefixSku { - name?: string; -} - -/** - * @class - * Initializes a new instance of the ReferencedPublicIpAddress class. - * @constructor - * @property {string} [id] The PublicIPAddress Reference - */ -export interface ReferencedPublicIpAddress { - id?: string; -} - -/** - * @class - * Initializes a new instance of the PublicIPPrefix class. - * @constructor - * Public IP prefix resource. - * - * @property {object} [sku] The public IP prefix SKU. - * @property {string} [sku.name] Name of a public IP prefix SKU. Possible - * values include: 'Standard' - * @property {string} [publicIPAddressVersion] The public IP address version. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * @property {array} [ipTags] The list of tags associated with the public IP - * prefix. - * @property {number} [prefixLength] The Length of the Public IP Prefix. - * @property {string} [ipPrefix] The allocated Prefix - * @property {array} [publicIPAddresses] The list of all referenced - * PublicIPAddresses - * @property {string} [resourceGuid] The resource GUID property of the public - * IP prefix resource. - * @property {string} [provisioningState] The provisioning state of the Public - * IP prefix resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {array} [zones] A list of availability zones denoting the IP - * allocated for the resource needs to come from. - */ -export interface PublicIPPrefix extends Resource { - sku?: PublicIPPrefixSku; - publicIPAddressVersion?: string; - ipTags?: IpTag[]; - prefixLength?: number; - ipPrefix?: string; - publicIPAddresses?: ReferencedPublicIpAddress[]; - resourceGuid?: string; - provisioningState?: string; - etag?: string; - zones?: string[]; -} - -/** - * @class - * Initializes a new instance of the PatchRouteFilterRule class. - * @constructor - * Route Filter Rule Resource - * - * @property {string} access The access type of the rule. Valid values are: - * 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' - * @property {array} communities The collection for bgp community values to - * filter on. e.g. ['12076:5010','12076:5020'] - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and - * 'Failed'. - * @property {string} [name] The 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. - */ -export interface PatchRouteFilterRule extends SubResource { - access: string; - communities: string[]; - readonly provisioningState?: string; - readonly name?: string; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the PatchRouteFilter class. - * @constructor - * Route Filter Resource. - * - * @property {array} [rules] Collection of RouteFilterRules contained within a - * route filter. - * @property {array} [peerings] A collection of references to express route - * circuit peerings. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and - * 'Failed'. - * @property {string} [name] The 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. - * @property {string} [type] Resource type. - * @property {object} [tags] Resource tags. - */ -export interface PatchRouteFilter extends SubResource { - rules?: RouteFilterRule[]; - peerings?: ExpressRouteCircuitPeering[]; - readonly provisioningState?: string; - readonly name?: string; - readonly etag?: string; - readonly type?: string; - tags?: { [propertyName: string]: string }; -} - -/** - * @class - * Initializes a new instance of the BGPCommunity class. - * @constructor - * Contains bgp community information offered in Service Community resources. - * - * @property {string} [serviceSupportedRegion] The region which the service - * support. e.g. For O365, region is Global. - * @property {string} [communityName] The name of the bgp community. e.g. - * Skype. - * @property {string} [communityValue] The value of the bgp community. For more - * information: - * https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. - * @property {array} [communityPrefixes] The prefixes that the bgp community - * contains. - * @property {boolean} [isAuthorizedToUse] Customer is authorized to use bgp - * community or not. - * @property {string} [serviceGroup] The service group of the bgp community - * contains. - */ -export interface BGPCommunity { - serviceSupportedRegion?: string; - communityName?: string; - communityValue?: string; - communityPrefixes?: string[]; - isAuthorizedToUse?: boolean; - serviceGroup?: string; -} - -/** - * @class - * Initializes a new instance of the BgpServiceCommunity class. - * @constructor - * Service Community Properties. - * - * @property {string} [serviceName] The name of the bgp community. e.g. Skype. - * @property {array} [bgpCommunities] Get a list of bgp communities. - */ -export interface BgpServiceCommunity extends Resource { - serviceName?: string; - bgpCommunities?: BGPCommunity[]; -} - -/** - * @class - * Initializes a new instance of the UsageName class. - * @constructor - * The usage names. - * - * @property {string} [value] A string describing the resource name. - * @property {string} [localizedValue] A localized string describing the - * resource name. - */ -export interface UsageName { - value?: string; - localizedValue?: string; -} - -/** - * @class - * Initializes a new instance of the Usage class. - * @constructor - * Describes network resource usage. - * - * @property {string} [id] Resource identifier. - * @property {number} currentValue The current value of the usage. - * @property {number} limit The limit of usage. - * @property {object} name The name of the type of usage. - * @property {string} [name.value] A string describing the resource name. - * @property {string} [name.localizedValue] A localized string describing the - * resource name. - */ -export interface Usage { - readonly id?: string; - currentValue: number; - limit: number; - name: UsageName; -} - -/** - * @class - * Initializes a new instance of the AddressSpace class. - * @constructor - * AddressSpace contains an array of IP address ranges that can be used by - * subnets of the virtual network. - * - * @property {array} [addressPrefixes] A list of address blocks reserved for - * this virtual network in CIDR notation. - */ -export interface AddressSpace { - addressPrefixes?: string[]; -} - -/** - * @class - * Initializes a new instance of the VirtualNetworkPeering class. - * @constructor - * Peerings in a virtual network resource. - * - * @property {boolean} [allowVirtualNetworkAccess] Whether the VMs in the - * linked virtual network space would be able to access all the VMs in local - * Virtual network space. - * @property {boolean} [allowForwardedTraffic] Whether the forwarded traffic - * from the VMs in the remote virtual network will be allowed/disallowed. - * @property {boolean} [allowGatewayTransit] If gateway links can be used in - * remote virtual networking to link to this virtual network. - * @property {boolean} [useRemoteGateways] If remote gateways can be used on - * this virtual network. If the flag is set to true, and allowGatewayTransit on - * remote peering is also true, virtual network will use gateways of remote - * virtual network for transit. Only one peering can have this flag set to - * true. This flag cannot be set if virtual network already has a gateway. - * @property {object} [remoteVirtualNetwork] The reference of the remote - * virtual network. The remote virtual network can be in the same or different - * region (preview). See here to register for the preview and learn more - * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). - * @property {string} [remoteVirtualNetwork.id] Resource ID. - * @property {object} [remoteAddressSpace] The reference of the remote virtual - * network address space. - * @property {array} [remoteAddressSpace.addressPrefixes] A list of address - * blocks reserved for this virtual network in CIDR notation. - * @property {string} [peeringState] The status of the virtual network peering. - * Possible values are 'Initiated', 'Connected', and 'Disconnected'. Possible - * values include: 'Initiated', 'Connected', 'Disconnected' - * @property {string} [provisioningState] The provisioning state of the - * resource. - * @property {string} [name] The 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. - */ -export interface VirtualNetworkPeering extends SubResource { - allowVirtualNetworkAccess?: boolean; - allowForwardedTraffic?: boolean; - allowGatewayTransit?: boolean; - useRemoteGateways?: boolean; - remoteVirtualNetwork?: SubResource; - remoteAddressSpace?: AddressSpace; - peeringState?: string; - provisioningState?: string; - name?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the DhcpOptions class. - * @constructor - * DhcpOptions contains an array of DNS servers available to VMs deployed in - * the virtual network. Standard DHCP option for a subnet overrides VNET DHCP - * options. - * - * @property {array} [dnsServers] The list of DNS servers IP addresses. - */ -export interface DhcpOptions { - dnsServers?: string[]; -} - -/** - * @class - * Initializes a new instance of the VirtualNetwork class. - * @constructor - * Virtual Network resource. - * - * @property {object} [addressSpace] The AddressSpace that contains an array of - * IP address ranges that can be used by subnets. - * @property {array} [addressSpace.addressPrefixes] A list of address blocks - * reserved for this virtual network in CIDR notation. - * @property {object} [dhcpOptions] The dhcpOptions that contains an array of - * DNS servers available to VMs deployed in the virtual network. - * @property {array} [dhcpOptions.dnsServers] The list of DNS servers IP - * addresses. - * @property {array} [subnets] A list of subnets in a Virtual Network. - * @property {array} [virtualNetworkPeerings] A list of peerings in a Virtual - * Network. - * @property {string} [resourceGuid] The resourceGuid property of the Virtual - * Network resource. - * @property {string} [provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {boolean} [enableDdosProtection] Indicates if DDoS protection is - * enabled for all the protected resources in the virtual network. It requires - * a DDoS protection plan associated with the resource. Default value: false . - * @property {boolean} [enableVmProtection] Indicates if VM protection is - * enabled for all the subnets in the virtual network. Default value: false . - * @property {object} [ddosProtectionPlan] The DDoS protection plan associated - * with the virtual network. - * @property {string} [ddosProtectionPlan.id] Resource ID. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ -export interface VirtualNetwork extends Resource { - addressSpace?: AddressSpace; - dhcpOptions?: DhcpOptions; - subnets?: Subnet[]; - virtualNetworkPeerings?: VirtualNetworkPeering[]; - resourceGuid?: string; - provisioningState?: string; - enableDdosProtection?: boolean; - enableVmProtection?: boolean; - ddosProtectionPlan?: SubResource; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the IPAddressAvailabilityResult class. - * @constructor - * Response for CheckIPAddressAvailability API service call - * - * @property {boolean} [available] Private IP address availability. - * @property {array} [availableIPAddresses] Contains other available private IP - * addresses if the asked for address is taken. - */ -export interface IPAddressAvailabilityResult { - available?: boolean; - availableIPAddresses?: string[]; -} - -/** - * @class - * Initializes a new instance of the VirtualNetworkUsageName class. - * @constructor - * Usage strings container. - * - * @property {string} [localizedValue] Localized subnet size and usage string. - * @property {string} [value] Subnet size and usage string. - */ -export interface VirtualNetworkUsageName { - readonly localizedValue?: string; - readonly value?: string; -} - -/** - * @class - * Initializes a new instance of the VirtualNetworkUsage class. - * @constructor - * Usage details for subnet. - * - * @property {number} [currentValue] Indicates number of IPs used from the - * Subnet. - * @property {string} [id] Subnet identifier. - * @property {number} [limit] Indicates the size of the subnet. - * @property {object} [name] The name containing common and localized value for - * usage. - * @property {string} [name.localizedValue] Localized subnet size and usage - * string. - * @property {string} [name.value] Subnet size and usage string. - * @property {string} [unit] Usage units. Returns 'Count' - */ -export interface VirtualNetworkUsage { - readonly currentValue?: number; - readonly id?: string; - readonly limit?: number; - readonly name?: VirtualNetworkUsageName; - readonly unit?: string; -} - -/** - * @class - * Initializes a new instance of the VirtualNetworkGatewayIPConfiguration class. - * @constructor - * IP configuration for virtual network gateway - * - * @property {string} [privateIPAllocationMethod] The private IP allocation - * method. Possible values are: 'Static' and 'Dynamic'. Possible values - * include: 'Static', 'Dynamic' - * @property {object} [subnet] The reference of the subnet resource. - * @property {string} [subnet.id] Resource ID. - * @property {object} [publicIPAddress] The reference of the public IP - * resource. - * @property {string} [publicIPAddress.id] Resource ID. - * @property {string} [provisioningState] The provisioning state of the public - * IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [name] The 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. - */ -export interface VirtualNetworkGatewayIPConfiguration extends SubResource { - privateIPAllocationMethod?: string; - subnet?: SubResource; - publicIPAddress?: SubResource; - readonly provisioningState?: string; - name?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the VirtualNetworkGatewaySku class. - * @constructor - * VirtualNetworkGatewaySku details - * - * @property {string} [name] Gateway SKU name. Possible values include: - * 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', - * 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * @property {string} [tier] Gateway SKU tier. Possible values include: - * 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', - * 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * @property {number} [capacity] The capacity. - */ -export interface VirtualNetworkGatewaySku { - name?: string; - tier?: string; - capacity?: number; -} - -/** - * @class - * Initializes a new instance of the VpnClientRootCertificate class. - * @constructor - * VPN client root certificate of virtual network gateway - * - * @property {string} publicCertData The certificate public data. - * @property {string} [provisioningState] The provisioning state of the VPN - * client root certificate resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [name] The 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. - */ -export interface VpnClientRootCertificate extends SubResource { - publicCertData: string; - readonly provisioningState?: string; - name?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the VpnClientRevokedCertificate class. - * @constructor - * VPN client revoked certificate of virtual network gateway. - * - * @property {string} [thumbprint] The revoked VPN client certificate - * thumbprint. - * @property {string} [provisioningState] The provisioning state of the VPN - * client revoked certificate resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [name] The 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. - */ -export interface VpnClientRevokedCertificate extends SubResource { - thumbprint?: string; - readonly provisioningState?: string; - name?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the IpsecPolicy class. - * @constructor - * An IPSec Policy configuration for a virtual network gateway connection - * - * @property {number} saLifeTimeSeconds The IPSec Security Association (also - * called Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN - * tunnel. - * @property {number} saDataSizeKilobytes The IPSec Security Association (also - * called Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN - * tunnel. - * @property {string} ipsecEncryption The IPSec encryption algorithm (IKE phase - * 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', - * 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' - * @property {string} ipsecIntegrity The IPSec integrity algorithm (IKE phase - * 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', - * 'GCMAES192', 'GCMAES256' - * @property {string} ikeEncryption The IKE encryption algorithm (IKE phase 2). - * Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', - * 'GCMAES256', 'GCMAES128' - * @property {string} ikeIntegrity The IKE integrity algorithm (IKE phase 2). - * Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', - * 'GCMAES128' - * @property {string} dhGroup The DH Groups used in IKE Phase 1 for initial SA. - * Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', - * 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' - * @property {string} pfsGroup The Pfs Groups used in IKE Phase 2 for new child - * SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', - * 'ECP384', 'PFS24', 'PFS14', 'PFSMM' - */ -export interface IpsecPolicy { - saLifeTimeSeconds: number; - saDataSizeKilobytes: number; - ipsecEncryption: string; - ipsecIntegrity: string; - ikeEncryption: string; - ikeIntegrity: string; - dhGroup: string; - pfsGroup: string; -} - -/** - * @class - * Initializes a new instance of the VpnClientConfiguration class. - * @constructor - * VpnClientConfiguration for P2S client. - * - * @property {object} [vpnClientAddressPool] The reference of the address space - * resource which represents Address space for P2S VpnClient. - * @property {array} [vpnClientAddressPool.addressPrefixes] A list of address - * blocks reserved for this virtual network in CIDR notation. - * @property {array} [vpnClientRootCertificates] VpnClientRootCertificate for - * virtual network gateway. - * @property {array} [vpnClientRevokedCertificates] VpnClientRevokedCertificate - * for Virtual network gateway. - * @property {array} [vpnClientProtocols] VpnClientProtocols for Virtual - * network gateway. - * @property {array} [vpnClientIpsecPolicies] VpnClientIpsecPolicies for - * virtual network gateway P2S client. - * @property {string} [radiusServerAddress] The radius server address property - * of the VirtualNetworkGateway resource for vpn client connection. - * @property {string} [radiusServerSecret] The radius secret property of the - * VirtualNetworkGateway resource for vpn client connection. - */ -export interface VpnClientConfiguration { - vpnClientAddressPool?: AddressSpace; - vpnClientRootCertificates?: VpnClientRootCertificate[]; - vpnClientRevokedCertificates?: VpnClientRevokedCertificate[]; - vpnClientProtocols?: string[]; - vpnClientIpsecPolicies?: IpsecPolicy[]; - radiusServerAddress?: string; - radiusServerSecret?: string; -} - -/** - * @class - * Initializes a new instance of the BgpSettings class. - * @constructor - * BGP settings details - * - * @property {number} [asn] The BGP speaker's ASN. - * @property {string} [bgpPeeringAddress] The BGP peering address and BGP - * identifier of this BGP speaker. - * @property {number} [peerWeight] The weight added to routes learned from this - * BGP speaker. - */ -export interface BgpSettings { - asn?: number; - bgpPeeringAddress?: string; - peerWeight?: number; -} - -/** - * @class - * Initializes a new instance of the BgpPeerStatus class. - * @constructor - * BGP peer status details - * - * @property {string} [localAddress] The virtual network gateway's local - * address - * @property {string} [neighbor] The remote BGP peer - * @property {number} [asn] The autonomous system number of the remote BGP peer - * @property {string} [state] The BGP peer state. Possible values include: - * 'Unknown', 'Stopped', 'Idle', 'Connecting', 'Connected' - * @property {string} [connectedDuration] For how long the peering has been up - * @property {number} [routesReceived] The number of routes learned from this - * peer - * @property {number} [messagesSent] The number of BGP messages sent - * @property {number} [messagesReceived] The number of BGP messages received - */ -export interface BgpPeerStatus { - readonly localAddress?: string; - readonly neighbor?: string; - readonly asn?: number; - readonly state?: string; - readonly connectedDuration?: string; - readonly routesReceived?: number; - readonly messagesSent?: number; - readonly messagesReceived?: number; -} - -/** - * @class - * Initializes a new instance of the GatewayRoute class. - * @constructor - * Gateway routing details - * - * @property {string} [localAddress] The gateway's local address - * @property {string} [network] The route's network prefix - * @property {string} [nextHop] The route's next hop - * @property {string} [sourcePeer] The peer this route was learned from - * @property {string} [origin] The source this route was learned from - * @property {string} [asPath] The route's AS path sequence - * @property {number} [weight] The route's weight - */ -export interface GatewayRoute { - readonly localAddress?: string; - readonly network?: string; - readonly nextHop?: string; - readonly sourcePeer?: string; - readonly origin?: string; - readonly asPath?: string; - readonly weight?: number; -} - -/** - * @class - * Initializes a new instance of the VirtualNetworkGateway class. - * @constructor - * A common class for general resource information - * - * @property {array} [ipConfigurations] IP configurations for virtual network - * gateway. - * @property {string} [gatewayType] The type of this virtual network gateway. - * Possible values are: 'Vpn' and 'ExpressRoute'. Possible values include: - * 'Vpn', 'ExpressRoute' - * @property {string} [vpnType] The type of this virtual network gateway. - * Possible values are: 'PolicyBased' and 'RouteBased'. Possible values - * include: 'PolicyBased', 'RouteBased' - * @property {boolean} [enableBgp] Whether BGP is enabled for this virtual - * network gateway or not. - * @property {boolean} [activeActive] ActiveActive flag - * @property {object} [gatewayDefaultSite] The reference of the - * LocalNetworkGateway resource which represents local network site having - * default routes. Assign Null value in case of removing existing default site - * setting. - * @property {string} [gatewayDefaultSite.id] Resource ID. - * @property {object} [sku] The reference of the VirtualNetworkGatewaySku - * resource which represents the SKU selected for Virtual network gateway. - * @property {string} [sku.name] Gateway SKU name. Possible values include: - * 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', - * 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * @property {string} [sku.tier] Gateway SKU tier. Possible values include: - * 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', - * 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * @property {number} [sku.capacity] The capacity. - * @property {object} [vpnClientConfiguration] The reference of the - * VpnClientConfiguration resource which represents the P2S VpnClient - * configurations. - * @property {object} [vpnClientConfiguration.vpnClientAddressPool] The - * reference of the address space resource which represents Address space for - * P2S VpnClient. - * @property {array} - * [vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A list of - * address blocks reserved for this virtual network in CIDR notation. - * @property {array} [vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. - * @property {array} [vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. - * @property {array} [vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. - * @property {array} [vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. - * @property {string} [vpnClientConfiguration.radiusServerAddress] The radius - * server address property of the VirtualNetworkGateway resource for vpn client - * connection. - * @property {string} [vpnClientConfiguration.radiusServerSecret] The radius - * secret property of the VirtualNetworkGateway resource for vpn client - * connection. - * @property {object} [bgpSettings] Virtual network gateway's BGP speaker - * settings. - * @property {number} [bgpSettings.asn] The BGP speaker's ASN. - * @property {string} [bgpSettings.bgpPeeringAddress] The BGP peering address - * and BGP identifier of this BGP speaker. - * @property {number} [bgpSettings.peerWeight] The weight added to routes - * learned from this BGP speaker. - * @property {string} [resourceGuid] The resource GUID property of the - * VirtualNetworkGateway resource. - * @property {string} [provisioningState] The provisioning state of the - * VirtualNetworkGateway resource. Possible values are: 'Updating', 'Deleting', - * and 'Failed'. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ -export interface VirtualNetworkGateway extends Resource { - ipConfigurations?: VirtualNetworkGatewayIPConfiguration[]; - gatewayType?: string; - vpnType?: string; - enableBgp?: boolean; - activeActive?: boolean; - gatewayDefaultSite?: SubResource; - sku?: VirtualNetworkGatewaySku; - vpnClientConfiguration?: VpnClientConfiguration; - bgpSettings?: BgpSettings; - resourceGuid?: string; - readonly provisioningState?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the VpnClientParameters class. - * @constructor - * Vpn Client Parameters for package generation - * - * @property {string} [processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' - * @property {string} [authenticationMethod] VPN client Authentication Method. - * Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: - * 'EAPTLS', 'EAPMSCHAPv2' - * @property {string} [radiusServerAuthCertificate] The public certificate data - * for the radius server authentication certificate as a Base-64 encoded - * string. Required only if external radius authentication has been configured - * with EAPTLS authentication. - * @property {array} [clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. - */ -export interface VpnClientParameters { - processorArchitecture?: string; - authenticationMethod?: string; - radiusServerAuthCertificate?: string; - clientRootCertificates?: string[]; -} - -/** - * @class - * Initializes a new instance of the BgpPeerStatusListResult class. - * @constructor - * Response for list BGP peer status API service call - * - * @property {array} [value] List of BGP peers - */ -export interface BgpPeerStatusListResult { - value?: BgpPeerStatus[]; -} - -/** - * @class - * Initializes a new instance of the GatewayRouteListResult class. - * @constructor - * List of virtual network gateway routes - * - * @property {array} [value] List of gateway routes - */ -export interface GatewayRouteListResult { - value?: GatewayRoute[]; -} - -/** - * @class - * Initializes a new instance of the TunnelConnectionHealth class. - * @constructor - * VirtualNetworkGatewayConnection properties - * - * @property {string} [tunnel] Tunnel name. - * @property {string} [connectionStatus] Virtual network Gateway connection - * status. Possible values include: 'Unknown', 'Connecting', 'Connected', - * 'NotConnected' - * @property {number} [ingressBytesTransferred] The Ingress Bytes Transferred - * in this connection - * @property {number} [egressBytesTransferred] The Egress Bytes Transferred in - * this connection - * @property {string} [lastConnectionEstablishedUtcTime] The time at which - * connection was established in Utc format. - */ -export interface TunnelConnectionHealth { - readonly tunnel?: string; - readonly connectionStatus?: string; - readonly ingressBytesTransferred?: number; - readonly egressBytesTransferred?: number; - readonly lastConnectionEstablishedUtcTime?: string; -} - -/** - * @class - * Initializes a new instance of the LocalNetworkGateway class. - * @constructor - * A common class for general resource information - * - * @property {object} [localNetworkAddressSpace] Local network site address - * space. - * @property {array} [localNetworkAddressSpace.addressPrefixes] A list of - * address blocks reserved for this virtual network in CIDR notation. - * @property {string} [gatewayIpAddress] IP address of local network gateway. - * @property {object} [bgpSettings] Local network gateway's BGP speaker - * settings. - * @property {number} [bgpSettings.asn] The BGP speaker's ASN. - * @property {string} [bgpSettings.bgpPeeringAddress] The BGP peering address - * and BGP identifier of this BGP speaker. - * @property {number} [bgpSettings.peerWeight] The weight added to routes - * learned from this BGP speaker. - * @property {string} [resourceGuid] The resource GUID property of the - * LocalNetworkGateway resource. - * @property {string} [provisioningState] The provisioning state of the - * LocalNetworkGateway resource. Possible values are: 'Updating', 'Deleting', - * and 'Failed'. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ -export interface LocalNetworkGateway extends Resource { - localNetworkAddressSpace?: AddressSpace; - gatewayIpAddress?: string; - bgpSettings?: BgpSettings; - resourceGuid?: string; - readonly provisioningState?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the VirtualNetworkGatewayConnection class. - * @constructor - * A common class for general resource information - * - * @property {string} [authorizationKey] The authorizationKey. - * @property {object} virtualNetworkGateway1 The reference to virtual network - * gateway resource. - * @property {array} [virtualNetworkGateway1.ipConfigurations] IP - * configurations for virtual network gateway. - * @property {string} [virtualNetworkGateway1.gatewayType] The type of this - * virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. - * Possible values include: 'Vpn', 'ExpressRoute' - * @property {string} [virtualNetworkGateway1.vpnType] The type of this virtual - * network gateway. Possible values are: 'PolicyBased' and 'RouteBased'. - * Possible values include: 'PolicyBased', 'RouteBased' - * @property {boolean} [virtualNetworkGateway1.enableBgp] Whether BGP is - * enabled for this virtual network gateway or not. - * @property {boolean} [virtualNetworkGateway1.activeActive] ActiveActive flag - * @property {object} [virtualNetworkGateway1.gatewayDefaultSite] The reference - * of the LocalNetworkGateway resource which represents local network site - * having default routes. Assign Null value in case of removing existing - * default site setting. - * @property {string} [virtualNetworkGateway1.gatewayDefaultSite.id] Resource - * ID. - * @property {object} [virtualNetworkGateway1.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. - * @property {string} [virtualNetworkGateway1.sku.name] Gateway SKU name. - * Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * @property {string} [virtualNetworkGateway1.sku.tier] Gateway SKU tier. - * Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * @property {number} [virtualNetworkGateway1.sku.capacity] The capacity. - * @property {object} [virtualNetworkGateway1.vpnClientConfiguration] The - * reference of the VpnClientConfiguration resource which represents the P2S - * VpnClient configurations. - * @property {object} - * [virtualNetworkGateway1.vpnClientConfiguration.vpnClientAddressPool] The - * reference of the address space resource which represents Address space for - * P2S VpnClient. - * @property {array} - * [virtualNetworkGateway1.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] - * A list of address blocks reserved for this virtual network in CIDR notation. - * @property {array} - * [virtualNetworkGateway1.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. - * @property {array} - * [virtualNetworkGateway1.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. - * @property {array} - * [virtualNetworkGateway1.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. - * @property {array} - * [virtualNetworkGateway1.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. - * @property {string} - * [virtualNetworkGateway1.vpnClientConfiguration.radiusServerAddress] The - * radius server address property of the VirtualNetworkGateway resource for vpn - * client connection. - * @property {string} - * [virtualNetworkGateway1.vpnClientConfiguration.radiusServerSecret] The - * radius secret property of the VirtualNetworkGateway resource for vpn client - * connection. - * @property {object} [virtualNetworkGateway1.bgpSettings] Virtual network - * gateway's BGP speaker settings. - * @property {number} [virtualNetworkGateway1.bgpSettings.asn] The BGP - * speaker's ASN. - * @property {string} [virtualNetworkGateway1.bgpSettings.bgpPeeringAddress] - * The BGP peering address and BGP identifier of this BGP speaker. - * @property {number} [virtualNetworkGateway1.bgpSettings.peerWeight] The - * weight added to routes learned from this BGP speaker. - * @property {string} [virtualNetworkGateway1.resourceGuid] The resource GUID - * property of the VirtualNetworkGateway resource. - * @property {string} [virtualNetworkGateway1.provisioningState] The - * provisioning state of the VirtualNetworkGateway resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [virtualNetworkGateway1.etag] Gets a unique read-only - * string that changes whenever the resource is updated. - * @property {object} [virtualNetworkGateway2] The reference to virtual network - * gateway resource. - * @property {array} [virtualNetworkGateway2.ipConfigurations] IP - * configurations for virtual network gateway. - * @property {string} [virtualNetworkGateway2.gatewayType] The type of this - * virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. - * Possible values include: 'Vpn', 'ExpressRoute' - * @property {string} [virtualNetworkGateway2.vpnType] The type of this virtual - * network gateway. Possible values are: 'PolicyBased' and 'RouteBased'. - * Possible values include: 'PolicyBased', 'RouteBased' - * @property {boolean} [virtualNetworkGateway2.enableBgp] Whether BGP is - * enabled for this virtual network gateway or not. - * @property {boolean} [virtualNetworkGateway2.activeActive] ActiveActive flag - * @property {object} [virtualNetworkGateway2.gatewayDefaultSite] The reference - * of the LocalNetworkGateway resource which represents local network site - * having default routes. Assign Null value in case of removing existing - * default site setting. - * @property {string} [virtualNetworkGateway2.gatewayDefaultSite.id] Resource - * ID. - * @property {object} [virtualNetworkGateway2.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. - * @property {string} [virtualNetworkGateway2.sku.name] Gateway SKU name. - * Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * @property {string} [virtualNetworkGateway2.sku.tier] Gateway SKU tier. - * Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * @property {number} [virtualNetworkGateway2.sku.capacity] The capacity. - * @property {object} [virtualNetworkGateway2.vpnClientConfiguration] The - * reference of the VpnClientConfiguration resource which represents the P2S - * VpnClient configurations. - * @property {object} - * [virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] The - * reference of the address space resource which represents Address space for - * P2S VpnClient. - * @property {array} - * [virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] - * A list of address blocks reserved for this virtual network in CIDR notation. - * @property {array} - * [virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. - * @property {array} - * [virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. - * @property {array} - * [virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. - * @property {array} - * [virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. - * @property {string} - * [virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] The - * radius server address property of the VirtualNetworkGateway resource for vpn - * client connection. - * @property {string} - * [virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] The - * radius secret property of the VirtualNetworkGateway resource for vpn client - * connection. - * @property {object} [virtualNetworkGateway2.bgpSettings] Virtual network - * gateway's BGP speaker settings. - * @property {number} [virtualNetworkGateway2.bgpSettings.asn] The BGP - * speaker's ASN. - * @property {string} [virtualNetworkGateway2.bgpSettings.bgpPeeringAddress] - * The BGP peering address and BGP identifier of this BGP speaker. - * @property {number} [virtualNetworkGateway2.bgpSettings.peerWeight] The - * weight added to routes learned from this BGP speaker. - * @property {string} [virtualNetworkGateway2.resourceGuid] The resource GUID - * property of the VirtualNetworkGateway resource. - * @property {string} [virtualNetworkGateway2.provisioningState] The - * provisioning state of the VirtualNetworkGateway resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [virtualNetworkGateway2.etag] Gets a unique read-only - * string that changes whenever the resource is updated. - * @property {object} [localNetworkGateway2] The reference to local network - * gateway resource. - * @property {object} [localNetworkGateway2.localNetworkAddressSpace] Local - * network site address space. - * @property {array} - * [localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A list of - * address blocks reserved for this virtual network in CIDR notation. - * @property {string} [localNetworkGateway2.gatewayIpAddress] IP address of - * local network gateway. - * @property {object} [localNetworkGateway2.bgpSettings] Local network - * gateway's BGP speaker settings. - * @property {number} [localNetworkGateway2.bgpSettings.asn] The BGP speaker's - * ASN. - * @property {string} [localNetworkGateway2.bgpSettings.bgpPeeringAddress] The - * BGP peering address and BGP identifier of this BGP speaker. - * @property {number} [localNetworkGateway2.bgpSettings.peerWeight] The weight - * added to routes learned from this BGP speaker. - * @property {string} [localNetworkGateway2.resourceGuid] The resource GUID - * property of the LocalNetworkGateway resource. - * @property {string} [localNetworkGateway2.provisioningState] The provisioning - * state of the LocalNetworkGateway resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [localNetworkGateway2.etag] A unique read-only string - * that changes whenever the resource is updated. - * @property {string} connectionType Gateway connection type. Possible values - * are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values - * include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' - * @property {string} [connectionProtocol] Connection protocol used for this - * connection. Possible values include: 'IKEv2', 'IKEv1' - * @property {number} [routingWeight] The routing weight. - * @property {string} [sharedKey] The IPSec shared key. - * @property {string} [connectionStatus] Virtual network Gateway connection - * status. Possible values are 'Unknown', 'Connecting', 'Connected' and - * 'NotConnected'. Possible values include: 'Unknown', 'Connecting', - * 'Connected', 'NotConnected' - * @property {array} [tunnelConnectionStatus] Collection of all tunnels' - * connection health status. - * @property {number} [egressBytesTransferred] The egress bytes transferred in - * this connection. - * @property {number} [ingressBytesTransferred] The ingress bytes transferred - * in this connection. - * @property {object} [peer] The reference to peerings resource. - * @property {string} [peer.id] Resource ID. - * @property {boolean} [enableBgp] EnableBgp flag - * @property {boolean} [usePolicyBasedTrafficSelectors] Enable policy-based - * traffic selectors. - * @property {array} [ipsecPolicies] The IPSec Policies to be considered by - * this connection. - * @property {string} [resourceGuid] The resource GUID property of the - * VirtualNetworkGatewayConnection resource. - * @property {string} [provisioningState] The provisioning state of the - * VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {boolean} [expressRouteGatewayBypass] Bypass ExpressRoute Gateway - * for data forwarding - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ -export interface VirtualNetworkGatewayConnection extends Resource { - authorizationKey?: string; - virtualNetworkGateway1: VirtualNetworkGateway; - virtualNetworkGateway2?: VirtualNetworkGateway; - localNetworkGateway2?: LocalNetworkGateway; - connectionType: string; - connectionProtocol?: string; - routingWeight?: number; - sharedKey?: string; - readonly connectionStatus?: string; - readonly tunnelConnectionStatus?: TunnelConnectionHealth[]; - readonly egressBytesTransferred?: number; - readonly ingressBytesTransferred?: number; - peer?: SubResource; - enableBgp?: boolean; - usePolicyBasedTrafficSelectors?: boolean; - ipsecPolicies?: IpsecPolicy[]; - resourceGuid?: string; - readonly provisioningState?: string; - expressRouteGatewayBypass?: boolean; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the ConnectionResetSharedKey class. - * @constructor - * The virtual network connection reset shared key - * - * @property {number} keyLength The virtual network connection reset shared key - * length, should between 1 and 128. - */ -export interface ConnectionResetSharedKey { - keyLength: number; -} - -/** - * @class - * Initializes a new instance of the ConnectionSharedKey class. - * @constructor - * Response for GetConnectionSharedKey API service call - * - * @property {string} value The virtual network connection shared key value. - */ -export interface ConnectionSharedKey extends SubResource { - value: string; -} - -/** - * @class - * Initializes a new instance of the VpnClientIPsecParameters class. - * @constructor - * An IPSec parameters for a virtual network gateway P2S connection. - * - * @property {number} saLifeTimeSeconds The IPSec Security Association (also - * called Quick Mode or Phase 2 SA) lifetime in seconds for P2S client. - * @property {number} saDataSizeKilobytes The IPSec Security Association (also - * called Quick Mode or Phase 2 SA) payload size in KB for P2S client.. - * @property {string} ipsecEncryption The IPSec encryption algorithm (IKE phase - * 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', 'AES192', - * 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' - * @property {string} ipsecIntegrity The IPSec integrity algorithm (IKE phase - * 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', - * 'GCMAES192', 'GCMAES256' - * @property {string} ikeEncryption The IKE encryption algorithm (IKE phase 2). - * Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', - * 'GCMAES256', 'GCMAES128' - * @property {string} ikeIntegrity The IKE integrity algorithm (IKE phase 2). - * Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', - * 'GCMAES128' - * @property {string} dhGroup The DH Groups used in IKE Phase 1 for initial SA. - * Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', - * 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' - * @property {string} pfsGroup The Pfs Groups used in IKE Phase 2 for new child - * SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', 'ECP256', - * 'ECP384', 'PFS24', 'PFS14', 'PFSMM' - */ -export interface VpnClientIPsecParameters { - saLifeTimeSeconds: number; - saDataSizeKilobytes: number; - ipsecEncryption: string; - ipsecIntegrity: string; - ikeEncryption: string; - ikeIntegrity: string; - dhGroup: string; - pfsGroup: string; -} - -/** - * @class - * Initializes a new instance of the VirtualNetworkConnectionGatewayReference class. - * @constructor - * A reference to VirtualNetworkGateway or LocalNetworkGateway resource. - * - * @property {string} id The ID of VirtualNetworkGateway or LocalNetworkGateway - * resource. - */ -export interface VirtualNetworkConnectionGatewayReference { - id: string; -} - -/** - * @class - * Initializes a new instance of the VirtualNetworkGatewayConnectionListEntity class. - * @constructor - * A common class for general resource information - * - * @property {string} [authorizationKey] The authorizationKey. - * @property {object} virtualNetworkGateway1 The reference to virtual network - * gateway resource. - * @property {string} [virtualNetworkGateway1.id] The ID of - * VirtualNetworkGateway or LocalNetworkGateway resource. - * @property {object} [virtualNetworkGateway2] The reference to virtual network - * gateway resource. - * @property {string} [virtualNetworkGateway2.id] The ID of - * VirtualNetworkGateway or LocalNetworkGateway resource. - * @property {object} [localNetworkGateway2] The reference to local network - * gateway resource. - * @property {string} [localNetworkGateway2.id] The ID of VirtualNetworkGateway - * or LocalNetworkGateway resource. - * @property {string} connectionType Gateway connection type. Possible values - * are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values - * include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' - * @property {string} [connectionProtocol] Connection protocol used for this - * connection. Possible values include: 'IKEv2', 'IKEv1' - * @property {number} [routingWeight] The routing weight. - * @property {string} [sharedKey] The IPSec shared key. - * @property {string} [connectionStatus] Virtual network Gateway connection - * status. Possible values are 'Unknown', 'Connecting', 'Connected' and - * 'NotConnected'. Possible values include: 'Unknown', 'Connecting', - * 'Connected', 'NotConnected' - * @property {array} [tunnelConnectionStatus] Collection of all tunnels' - * connection health status. - * @property {number} [egressBytesTransferred] The egress bytes transferred in - * this connection. - * @property {number} [ingressBytesTransferred] The ingress bytes transferred - * in this connection. - * @property {object} [peer] The reference to peerings resource. - * @property {string} [peer.id] Resource ID. - * @property {boolean} [enableBgp] EnableBgp flag - * @property {boolean} [usePolicyBasedTrafficSelectors] Enable policy-based - * traffic selectors. - * @property {array} [ipsecPolicies] The IPSec Policies to be considered by - * this connection. - * @property {string} [resourceGuid] The resource GUID property of the - * VirtualNetworkGatewayConnection resource. - * @property {string} [provisioningState] The provisioning state of the - * VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {boolean} [expressRouteGatewayBypass] Bypass ExpressRoute Gateway - * for data forwarding - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ -export interface VirtualNetworkGatewayConnectionListEntity extends Resource { - authorizationKey?: string; - virtualNetworkGateway1: VirtualNetworkConnectionGatewayReference; - virtualNetworkGateway2?: VirtualNetworkConnectionGatewayReference; - localNetworkGateway2?: VirtualNetworkConnectionGatewayReference; - connectionType: string; - connectionProtocol?: string; - routingWeight?: number; - sharedKey?: string; - readonly connectionStatus?: string; - readonly tunnelConnectionStatus?: TunnelConnectionHealth[]; - readonly egressBytesTransferred?: number; - readonly ingressBytesTransferred?: number; - peer?: SubResource; - enableBgp?: boolean; - usePolicyBasedTrafficSelectors?: boolean; - ipsecPolicies?: IpsecPolicy[]; - resourceGuid?: string; - readonly provisioningState?: string; - expressRouteGatewayBypass?: boolean; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the VpnDeviceScriptParameters class. - * @constructor - * Vpn device configuration script generation parameters - * - * @property {string} [vendor] The vendor for the vpn device. - * @property {string} [deviceFamily] The device family for the vpn device. - * @property {string} [firmwareVersion] The firmware version for the vpn - * device. - */ -export interface VpnDeviceScriptParameters { - vendor?: string; - deviceFamily?: string; - firmwareVersion?: string; -} - -/** - * @class - * Initializes a new instance of the P2SVpnServerConfigVpnClientRootCertificate class. - * @constructor - * VPN client root certificate of P2SVpnServerConfiguration. - * - * @property {string} publicCertData The certificate public data. - * @property {string} [provisioningState] The provisioning state of the - * P2SVpnServerConfiguration VPN client root certificate resource. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [name] The 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. - */ -export interface P2SVpnServerConfigVpnClientRootCertificate extends SubResource { - publicCertData: string; - readonly provisioningState?: string; - name?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the P2SVpnServerConfigVpnClientRevokedCertificate class. - * @constructor - * VPN client revoked certificate of P2SVpnServerConfiguration. - * - * @property {string} [thumbprint] The revoked VPN client certificate - * thumbprint. - * @property {string} [provisioningState] The provisioning state of the VPN - * client revoked certificate resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [name] The 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. - */ -export interface P2SVpnServerConfigVpnClientRevokedCertificate extends SubResource { - thumbprint?: string; - readonly provisioningState?: string; - name?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the P2SVpnServerConfigRadiusServerRootCertificate class. - * @constructor - * Radius Server root certificate of P2SVpnServerConfiguration. - * - * @property {string} publicCertData The certificate public data. - * @property {string} [provisioningState] The provisioning state of the - * P2SVpnServerConfiguration Radius Server root certificate resource. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [name] The 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. - */ -export interface P2SVpnServerConfigRadiusServerRootCertificate extends SubResource { - publicCertData: string; - readonly provisioningState?: string; - name?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the P2SVpnServerConfigRadiusClientRootCertificate class. - * @constructor - * Radius client root certificate of P2SVpnServerConfiguration. - * - * @property {string} [thumbprint] The Radius client root certificate - * thumbprint. - * @property {string} [provisioningState] The provisioning state of the Radius - * client root certificate resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [name] The 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. - */ -export interface P2SVpnServerConfigRadiusClientRootCertificate extends SubResource { - thumbprint?: string; - readonly provisioningState?: string; - name?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the P2SVpnServerConfiguration class. - * @constructor - * P2SVpnServerConfiguration Resource. - * - * @property {string} [p2SVpnServerConfigurationPropertiesName] The name of the - * P2SVpnServerConfiguration that is unique within a VirtualWan in a resource - * group. This name can be used to access the resource along with Paren - * VirtualWan resource name. - * @property {array} [vpnProtocols] vpnProtocols for the - * P2SVpnServerConfiguration. - * @property {array} [p2SVpnServerConfigVpnClientRootCertificates] VPN client - * root certificate of P2SVpnServerConfiguration. - * @property {array} [p2SVpnServerConfigVpnClientRevokedCertificates] VPN - * client revoked certificate of P2SVpnServerConfiguration. - * @property {array} [p2SVpnServerConfigRadiusServerRootCertificates] Radius - * Server root certificate of P2SVpnServerConfiguration. - * @property {array} [p2SVpnServerConfigRadiusClientRootCertificates] Radius - * client root certificate of P2SVpnServerConfiguration. - * @property {array} [vpnClientIpsecPolicies] VpnClientIpsecPolicies for - * P2SVpnServerConfiguration. - * @property {string} [radiusServerAddress] The radius server address property - * of the P2SVpnServerConfiguration resource for point to site client - * connection. - * @property {string} [radiusServerSecret] The radius secret property of the - * P2SVpnServerConfiguration resource for for point to site client connection. - * @property {string} [provisioningState] The provisioning state of the - * P2SVpnServerConfiguration resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {array} [p2SVpnGateways] - * @property {string} [p2SVpnServerConfigurationPropertiesEtag] A unique - * read-only string that changes whenever the resource is updated. - * @property {string} [name] The name of the resource that is unique within a - * resource group. This name can be used to access the resource. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ -export interface P2SVpnServerConfiguration extends SubResource { - p2SVpnServerConfigurationPropertiesName?: string; - vpnProtocols?: string[]; - p2SVpnServerConfigVpnClientRootCertificates?: P2SVpnServerConfigVpnClientRootCertificate[]; - p2SVpnServerConfigVpnClientRevokedCertificates?: P2SVpnServerConfigVpnClientRevokedCertificate[]; - p2SVpnServerConfigRadiusServerRootCertificates?: P2SVpnServerConfigRadiusServerRootCertificate[]; - p2SVpnServerConfigRadiusClientRootCertificates?: P2SVpnServerConfigRadiusClientRootCertificate[]; - vpnClientIpsecPolicies?: IpsecPolicy[]; - radiusServerAddress?: string; - radiusServerSecret?: string; - readonly provisioningState?: string; - readonly p2SVpnGateways?: SubResource[]; - p2SVpnServerConfigurationPropertiesEtag?: string; - name?: string; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the VirtualWAN class. - * @constructor - * VirtualWAN Resource. - * - * @property {boolean} [disableVpnEncryption] Vpn encryption to be disabled or - * not. - * @property {array} [virtualHubs] List of VirtualHubs in the VirtualWAN. - * @property {array} [vpnSites] - * @property {string} [securityProviderName] The Security Provider name. - * @property {boolean} [allowBranchToBranchTraffic] True if branch to branch - * traffic is allowed. - * @property {boolean} [allowVnetToVnetTraffic] True if Vnet to Vnet traffic is - * allowed. - * @property {string} [office365LocalBreakoutCategory] The office local - * breakout category. Possible values include: 'Optimize', 'OptimizeAndAllow', - * 'All', 'None' - * @property {array} [p2SVpnServerConfigurations] list of all - * P2SVpnServerConfigurations associated with the virtual wan. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ -export interface VirtualWAN extends Resource { - disableVpnEncryption?: boolean; - readonly virtualHubs?: SubResource[]; - readonly vpnSites?: SubResource[]; - securityProviderName?: string; - allowBranchToBranchTraffic?: boolean; - allowVnetToVnetTraffic?: boolean; - office365LocalBreakoutCategory?: string; - p2SVpnServerConfigurations?: P2SVpnServerConfiguration[]; - provisioningState?: string; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the DeviceProperties class. - * @constructor - * List of properties of the device. - * - * @property {string} [deviceVendor] Name of the device Vendor. - * @property {string} [deviceModel] Model of the device. - * @property {number} [linkSpeedInMbps] Link speed. - */ -export interface DeviceProperties { - deviceVendor?: string; - deviceModel?: string; - linkSpeedInMbps?: number; -} - -/** - * @class - * Initializes a new instance of the VpnSite class. - * @constructor - * VpnSite Resource. - * - * @property {object} [virtualWan] The VirtualWAN to which the vpnSite belongs - * @property {string} [virtualWan.id] Resource ID. - * @property {object} [deviceProperties] The device properties - * @property {string} [deviceProperties.deviceVendor] Name of the device - * Vendor. - * @property {string} [deviceProperties.deviceModel] Model of the device. - * @property {number} [deviceProperties.linkSpeedInMbps] Link speed. - * @property {string} [ipAddress] The ip-address for the vpn-site. - * @property {string} [siteKey] The key for vpn-site that can be used for - * connections. - * @property {object} [addressSpace] The AddressSpace that contains an array of - * IP address ranges. - * @property {array} [addressSpace.addressPrefixes] A list of address blocks - * reserved for this virtual network in CIDR notation. - * @property {object} [bgpProperties] The set of bgp properties. - * @property {number} [bgpProperties.asn] The BGP speaker's ASN. - * @property {string} [bgpProperties.bgpPeeringAddress] The BGP peering address - * and BGP identifier of this BGP speaker. - * @property {number} [bgpProperties.peerWeight] The weight added to routes - * learned from this BGP speaker. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * @property {boolean} [isSecuritySite] IsSecuritySite flag - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ -export interface VpnSite extends Resource { - virtualWan?: SubResource; - deviceProperties?: DeviceProperties; - ipAddress?: string; - siteKey?: string; - addressSpace?: AddressSpace; - bgpProperties?: BgpSettings; - provisioningState?: string; - isSecuritySite?: boolean; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the GetVpnSitesConfigurationRequest class. - * @constructor - * List of Vpn-Sites - * - * @property {array} [vpnSites] List of resource-ids of the vpn-sites for which - * config is to be downloaded. - * @property {string} [outputBlobSasUrl] The sas-url to download the - * configurations for vpn-sites - */ -export interface GetVpnSitesConfigurationRequest { - vpnSites?: string[]; - outputBlobSasUrl?: string; -} - -/** - * @class - * Initializes a new instance of the HubVirtualNetworkConnection class. - * @constructor - * HubVirtualNetworkConnection Resource. - * - * @property {object} [remoteVirtualNetwork] Reference to the remote virtual - * network. - * @property {string} [remoteVirtualNetwork.id] Resource ID. - * @property {boolean} [allowHubToRemoteVnetTransit] VirtualHub to RemoteVnet - * transit to enabled or not. - * @property {boolean} [allowRemoteVnetToUseHubVnetGateways] Allow RemoteVnet - * to use Virtual Hub's gateways. - * @property {boolean} [enableInternetSecurity] Enable internet security - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * @property {string} [name] The name of the resource that is unique within a - * resource group. This name can be used to access the resource. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ -export interface HubVirtualNetworkConnection extends SubResource { - remoteVirtualNetwork?: SubResource; - allowHubToRemoteVnetTransit?: boolean; - allowRemoteVnetToUseHubVnetGateways?: boolean; - enableInternetSecurity?: boolean; - provisioningState?: string; - name?: string; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the VirtualHubRoute class. - * @constructor - * VirtualHub route - * - * @property {array} [addressPrefixes] list of all addressPrefixes. - * @property {string} [nextHopIpAddress] NextHop ip address. - */ -export interface VirtualHubRoute { - addressPrefixes?: string[]; - nextHopIpAddress?: string; -} - -/** - * @class - * Initializes a new instance of the VirtualHubRouteTable class. - * @constructor - * VirtualHub route table - * - * @property {array} [routes] list of all routes. - */ -export interface VirtualHubRouteTable { - routes?: VirtualHubRoute[]; -} - -/** - * @class - * Initializes a new instance of the VirtualHub class. - * @constructor - * VirtualHub Resource. - * - * @property {object} [virtualWan] The VirtualWAN to which the VirtualHub - * belongs - * @property {string} [virtualWan.id] Resource ID. - * @property {object} [vpnGateway] The VpnGateway associated with this - * VirtualHub - * @property {string} [vpnGateway.id] Resource ID. - * @property {object} [p2SVpnGateway] The P2SVpnGateway associated with this - * VirtualHub - * @property {string} [p2SVpnGateway.id] Resource ID. - * @property {object} [expressRouteGateway] The expressRouteGateway associated - * with this VirtualHub - * @property {string} [expressRouteGateway.id] Resource ID. - * @property {array} [virtualNetworkConnections] list of all vnet connections - * with this VirtualHub. - * @property {string} [addressPrefix] Address-prefix for this VirtualHub. - * @property {object} [routeTable] The routeTable associated with this virtual - * hub. - * @property {array} [routeTable.routes] list of all routes. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ -export interface VirtualHub extends Resource { - virtualWan?: SubResource; - vpnGateway?: SubResource; - p2SVpnGateway?: SubResource; - expressRouteGateway?: SubResource; - virtualNetworkConnections?: HubVirtualNetworkConnection[]; - addressPrefix?: string; - routeTable?: VirtualHubRouteTable; - provisioningState?: string; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the VpnConnection class. - * @constructor - * VpnConnection Resource. - * - * @property {object} [remoteVpnSite] Id of the connected vpn site. - * @property {string} [remoteVpnSite.id] Resource ID. - * @property {number} [routingWeight] routing weight for vpn connection. - * @property {string} [connectionStatus] The connection status. Possible values - * include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' - * @property {string} [vpnConnectionProtocolType] Connection protocol used for - * this connection. Possible values include: 'IKEv2', 'IKEv1' - * @property {number} [ingressBytesTransferred] Ingress bytes transferred. - * @property {number} [egressBytesTransferred] Egress bytes transferred. - * @property {number} [connectionBandwidth] Expected bandwidth in MBPS. - * @property {string} [sharedKey] SharedKey for the vpn connection. - * @property {boolean} [enableBgp] EnableBgp flag - * @property {array} [ipsecPolicies] The IPSec Policies to be considered by - * this connection. - * @property {boolean} [enableRateLimiting] EnableBgp flag - * @property {boolean} [enableInternetSecurity] Enable internet security - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * @property {string} [name] The name of the resource that is unique within a - * resource group. This name can be used to access the resource. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ -export interface VpnConnection extends SubResource { - remoteVpnSite?: SubResource; - routingWeight?: number; - connectionStatus?: string; - vpnConnectionProtocolType?: string; - readonly ingressBytesTransferred?: number; - readonly egressBytesTransferred?: number; - connectionBandwidth?: number; - sharedKey?: string; - enableBgp?: boolean; - ipsecPolicies?: IpsecPolicy[]; - enableRateLimiting?: boolean; - enableInternetSecurity?: boolean; - provisioningState?: string; - name?: string; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the VpnGateway class. - * @constructor - * VpnGateway Resource. - * - * @property {object} [virtualHub] The VirtualHub to which the gateway belongs - * @property {string} [virtualHub.id] Resource ID. - * @property {array} [connections] list of all vpn connections to the gateway. - * @property {object} [bgpSettings] Local network gateway's BGP speaker - * settings. - * @property {number} [bgpSettings.asn] The BGP speaker's ASN. - * @property {string} [bgpSettings.bgpPeeringAddress] The BGP peering address - * and BGP identifier of this BGP speaker. - * @property {number} [bgpSettings.peerWeight] The weight added to routes - * learned from this BGP speaker. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * @property {number} [vpnGatewayScaleUnit] The scale unit for this vpn - * gateway. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ -export interface VpnGateway extends Resource { - virtualHub?: SubResource; - connections?: VpnConnection[]; - bgpSettings?: BgpSettings; - provisioningState?: string; - vpnGatewayScaleUnit?: number; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the VpnSiteId class. - * @constructor - * VpnSite Resource. - * - * @property {string} [vpnSite] The resource-uri of the vpn-site for which - * config is to be fetched. - */ -export interface VpnSiteId { - readonly vpnSite?: string; -} - -/** - * @class - * Initializes a new instance of the VirtualWanSecurityProvider class. - * @constructor - * Collection of SecurityProviders. - * - * @property {string} [name] Name of the security provider. - * @property {string} [url] Url of the security provider. - * @property {string} [type] Name of the security provider. Possible values - * include: 'External', 'Native' - */ -export interface VirtualWanSecurityProvider { - name?: string; - url?: string; - type?: string; -} - -/** - * @class - * Initializes a new instance of the VirtualWanSecurityProviders class. - * @constructor - * Collection of SecurityProviders. - * - * @property {array} [supportedProviders] - */ -export interface VirtualWanSecurityProviders { - supportedProviders?: VirtualWanSecurityProvider[]; -} - -/** - * @class - * Initializes a new instance of the VpnClientConnectionHealth class. - * @constructor - * VpnClientConnectionHealth properties - * - * @property {number} [totalIngressBytesTransferred] Total of the Ingress Bytes - * Transferred in this P2S Vpn connection - * @property {number} [totalEgressBytesTransferred] Total of the Egress Bytes - * Transferred in this connection - * @property {number} [vpnClientConnectionsCount] The total of p2s vpn clients - * connected at this time to this P2SVpnGateway. - * @property {array} [allocatedIpAddresses] List of allocated ip addresses to - * the connected p2s vpn clients. - */ -export interface VpnClientConnectionHealth { - readonly totalIngressBytesTransferred?: number; - readonly totalEgressBytesTransferred?: number; - vpnClientConnectionsCount?: number; - allocatedIpAddresses?: string[]; -} - -/** - * @class - * Initializes a new instance of the P2SVpnGateway class. - * @constructor - * P2SVpnGateway Resource. - * - * @property {object} [virtualHub] The VirtualHub to which the gateway belongs - * @property {string} [virtualHub.id] Resource ID. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * @property {number} [vpnGatewayScaleUnit] The scale unit for this p2s vpn - * gateway. - * @property {object} [p2SVpnServerConfiguration] The P2SVpnServerConfiguration - * to which the p2sVpnGateway is attached to. - * @property {string} [p2SVpnServerConfiguration.id] Resource ID. - * @property {object} [vpnClientAddressPool] The reference of the address space - * resource which represents Address space for P2S VpnClient. - * @property {array} [vpnClientAddressPool.addressPrefixes] A list of address - * blocks reserved for this virtual network in CIDR notation. - * @property {object} [vpnClientConnectionHealth] All P2S vpnclients' - * connection health status. - * @property {number} [vpnClientConnectionHealth.totalIngressBytesTransferred] - * Total of the Ingress Bytes Transferred in this P2S Vpn connection - * @property {number} [vpnClientConnectionHealth.totalEgressBytesTransferred] - * Total of the Egress Bytes Transferred in this connection - * @property {number} [vpnClientConnectionHealth.vpnClientConnectionsCount] The - * total of p2s vpn clients connected at this time to this P2SVpnGateway. - * @property {array} [vpnClientConnectionHealth.allocatedIpAddresses] List of - * allocated ip addresses to the connected p2s vpn clients. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ -export interface P2SVpnGateway extends Resource { - virtualHub?: SubResource; - provisioningState?: string; - vpnGatewayScaleUnit?: number; - p2SVpnServerConfiguration?: SubResource; - vpnClientAddressPool?: AddressSpace; - readonly vpnClientConnectionHealth?: VpnClientConnectionHealth; - readonly etag?: string; -} - -/** - * @class - * Initializes a new instance of the P2SVpnProfileParameters class. - * @constructor - * Vpn Client Parameters for package generation - * - * @property {string} [authenticationMethod] VPN client Authentication Method. - * Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: - * 'EAPTLS', 'EAPMSCHAPv2' - */ -export interface P2SVpnProfileParameters { - authenticationMethod?: string; -} - -/** - * @class - * Initializes a new instance of the VpnProfileResponse class. - * @constructor - * Vpn Profile Response for package generation - * - * @property {string} [profileUrl] URL to the VPN profile - */ -export interface VpnProfileResponse { - profileUrl?: string; -} - - -/** - * @class - * Initializes a new instance of the ApplicationGatewayListResult class. - * @constructor - * Response for ListApplicationGateways API service call. - * - * @property {string} [nextLink] URL to get the next set of results. - */ -export interface ApplicationGatewayListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ApplicationGatewayAvailableSslPredefinedPolicies class. - * @constructor - * Response for ApplicationGatewayAvailableSslOptions API service call. - * - * @property {string} [nextLink] URL to get the next set of results. - */ -export interface ApplicationGatewayAvailableSslPredefinedPolicies extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ApplicationSecurityGroupListResult class. - * @constructor - * A list of application security groups. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface ApplicationSecurityGroupListResult extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the AvailableDelegationsResult class. - * @constructor - * An array of available delegations. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface AvailableDelegationsResult extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the AzureFirewallListResult class. - * @constructor - * Response for ListAzureFirewalls API service call. - * - * @property {string} [nextLink] URL to get the next set of results. - */ -export interface AzureFirewallListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the AzureFirewallFqdnTagListResult class. - * @constructor - * Response for ListAzureFirewallFqdnTags API service call. - * - * @property {string} [nextLink] URL to get the next set of results. - */ -export interface AzureFirewallFqdnTagListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the DdosProtectionPlanListResult class. - * @constructor - * A list of DDoS protection plans. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface DdosProtectionPlanListResult extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the EndpointServicesListResult class. - * @constructor - * Response for the ListAvailableEndpointServices API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface EndpointServicesListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the AuthorizationListResult class. - * @constructor - * Response for ListAuthorizations API service call retrieves all - * authorizations that belongs to an ExpressRouteCircuit. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface AuthorizationListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteCircuitPeeringListResult class. - * @constructor - * Response for ListPeering API service call retrieves all peerings that belong - * to an ExpressRouteCircuit. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface ExpressRouteCircuitPeeringListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteCircuitConnectionListResult class. - * @constructor - * Response for ListConnections API service call retrieves all global reach - * connections that belongs to a Private Peering for an ExpressRouteCircuit. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface ExpressRouteCircuitConnectionListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteCircuitListResult class. - * @constructor - * Response for ListExpressRouteCircuit API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface ExpressRouteCircuitListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteServiceProviderListResult class. - * @constructor - * Response for the ListExpressRouteServiceProvider API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface ExpressRouteServiceProviderListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteCrossConnectionListResult class. - * @constructor - * Response for ListExpressRouteCrossConnection API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface ExpressRouteCrossConnectionListResult extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteCrossConnectionPeeringList class. - * @constructor - * Response for ListPeering API service call retrieves all peerings that belong - * to an ExpressRouteCrossConnection. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface ExpressRouteCrossConnectionPeeringList extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRoutePortsLocationListResult class. - * @constructor - * @summary ExpressRoutePorts Location List Result - * - * Response for ListExpressRoutePortsLocations API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface ExpressRoutePortsLocationListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRoutePortListResult class. - * @constructor - * @summary ExpressRoute Port List Result - * - * Response for ListExpressRoutePorts API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface ExpressRoutePortListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ExpressRouteLinkListResult class. - * @constructor - * @summary ExpressRouteLink List Result - * - * Response for ListExpressRouteLinks API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface ExpressRouteLinkListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the InterfaceEndpointListResult class. - * @constructor - * Response for the ListInterfaceEndpoints API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface InterfaceEndpointListResult extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the LoadBalancerListResult class. - * @constructor - * Response for ListLoadBalancers API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface LoadBalancerListResult extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the LoadBalancerBackendAddressPoolListResult class. - * @constructor - * Response for ListBackendAddressPool API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface LoadBalancerBackendAddressPoolListResult extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the LoadBalancerFrontendIPConfigurationListResult class. - * @constructor - * Response for ListFrontendIPConfiguration API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface LoadBalancerFrontendIPConfigurationListResult extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the InboundNatRuleListResult class. - * @constructor - * Response for ListInboundNatRule API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface InboundNatRuleListResult extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the LoadBalancerLoadBalancingRuleListResult class. - * @constructor - * Response for ListLoadBalancingRule API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface LoadBalancerLoadBalancingRuleListResult extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the LoadBalancerOutboundRuleListResult class. - * @constructor - * Response for ListOutboundRule API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface LoadBalancerOutboundRuleListResult extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the NetworkInterfaceListResult class. - * @constructor - * Response for the ListNetworkInterface API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface NetworkInterfaceListResult extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the LoadBalancerProbeListResult class. - * @constructor - * Response for ListProbe API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface LoadBalancerProbeListResult extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the NetworkInterfaceIPConfigurationListResult class. - * @constructor - * Response for list ip configurations API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface NetworkInterfaceIPConfigurationListResult extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the NetworkInterfaceLoadBalancerListResult class. - * @constructor - * Response for list ip configurations API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface NetworkInterfaceLoadBalancerListResult extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the NetworkInterfaceTapConfigurationListResult class. - * @constructor - * Response for list tap configurations API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface NetworkInterfaceTapConfigurationListResult extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the NetworkProfileListResult class. - * @constructor - * Response for ListNetworkProfiles API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface NetworkProfileListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the NetworkSecurityGroupListResult class. - * @constructor - * Response for ListNetworkSecurityGroups API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface NetworkSecurityGroupListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the SecurityRuleListResult class. - * @constructor - * Response for ListSecurityRule API service call. Retrieves all security rules - * that belongs to a network security group. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface SecurityRuleListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the NetworkWatcherListResult class. - * @constructor - * List of network watcher resources. - * - */ -export interface NetworkWatcherListResult extends Array { -} - -/** - * @class - * Initializes a new instance of the PacketCaptureListResult class. - * @constructor - * List of packet capture sessions. - * - */ -export interface PacketCaptureListResult extends Array { -} - -/** - * @class - * Initializes a new instance of the ConnectionMonitorListResult class. - * @constructor - * List of connection monitors. - * - */ -export interface ConnectionMonitorListResult extends Array { -} - -/** - * @class - * Initializes a new instance of the OperationListResult class. - * @constructor - * Result of the request to list Network operations. It contains a list of - * operations and a URL link to get the next set of results. - * - * @property {string} [nextLink] URL to get the next set of operation list - * results if there are any. - */ -export interface OperationListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the PublicIPAddressListResult class. - * @constructor - * Response for ListPublicIpAddresses API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface PublicIPAddressListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the PublicIPPrefixListResult class. - * @constructor - * Response for ListPublicIpPrefixes API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface PublicIPPrefixListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the RouteFilterListResult class. - * @constructor - * Response for the ListRouteFilters API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface RouteFilterListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the RouteFilterRuleListResult class. - * @constructor - * Response for the ListRouteFilterRules API service call - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface RouteFilterRuleListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the RouteTableListResult class. - * @constructor - * Response for the ListRouteTable API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface RouteTableListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the RouteListResult class. - * @constructor - * Response for the ListRoute API service call - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface RouteListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the BgpServiceCommunityListResult class. - * @constructor - * Response for the ListServiceCommunity API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface BgpServiceCommunityListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ServiceEndpointPolicyListResult class. - * @constructor - * Response for ListServiceEndpointPolicies API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface ServiceEndpointPolicyListResult extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ServiceEndpointPolicyDefinitionListResult class. - * @constructor - * Response for ListServiceEndpointPolicyDefinition API service call. Retrieves - * all service endpoint policy definition that belongs to a service endpoint - * policy. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface ServiceEndpointPolicyDefinitionListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the UsagesListResult class. - * @constructor - * The list usages operation response. - * - * @property {string} [nextLink] URL to get the next set of results. - */ -export interface UsagesListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the VirtualNetworkListResult class. - * @constructor - * Response for the ListVirtualNetworks API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface VirtualNetworkListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the VirtualNetworkListUsageResult class. - * @constructor - * Response for the virtual networks GetUsage API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface VirtualNetworkListUsageResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the SubnetListResult class. - * @constructor - * Response for ListSubnets API service callRetrieves all subnet that belongs - * to a virtual network - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface SubnetListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the VirtualNetworkPeeringListResult class. - * @constructor - * Response for ListSubnets API service call. Retrieves all subnets that belong - * to a virtual network. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface VirtualNetworkPeeringListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the VirtualNetworkGatewayListResult class. - * @constructor - * Response for the ListVirtualNetworkGateways API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface VirtualNetworkGatewayListResult extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the VirtualNetworkGatewayListConnectionsResult class. - * @constructor - * Response for the VirtualNetworkGatewayListConnections API service call - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface VirtualNetworkGatewayListConnectionsResult extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the VirtualNetworkGatewayConnectionListResult class. - * @constructor - * Response for the ListVirtualNetworkGatewayConnections API service call - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface VirtualNetworkGatewayConnectionListResult extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the LocalNetworkGatewayListResult class. - * @constructor - * Response for ListLocalNetworkGateways API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface LocalNetworkGatewayListResult extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the VirtualNetworkTapListResult class. - * @constructor - * Response for ListVirtualNetworkTap API service call. - * - * @property {string} [nextLink] The URL to get the next set of results. - */ -export interface VirtualNetworkTapListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ListVirtualWANsResult class. - * @constructor - * Result of the request to list VirtualWANs. It contains a list of VirtualWANs - * and a URL nextLink to get the next set of results. - * - * @property {string} [nextLink] URL to get the next set of operation list - * results if there are any. - */ -export interface ListVirtualWANsResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ListVpnSitesResult class. - * @constructor - * Result of the request to list VpnSites. It contains a list of VpnSites and a - * URL nextLink to get the next set of results. - * - * @property {string} [nextLink] URL to get the next set of operation list - * results if there are any. - */ -export interface ListVpnSitesResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ListVirtualHubsResult class. - * @constructor - * Result of the request to list VirtualHubs. It contains a list of VirtualHubs - * and a URL nextLink to get the next set of results. - * - * @property {string} [nextLink] URL to get the next set of operation list - * results if there are any. - */ -export interface ListVirtualHubsResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ListHubVirtualNetworkConnectionsResult class. - * @constructor - * List of HubVirtualNetworkConnections and a URL nextLink to get the next set - * of results. - * - * @property {string} [nextLink] URL to get the next set of operation list - * results if there are any. - */ -export interface ListHubVirtualNetworkConnectionsResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ListVpnGatewaysResult class. - * @constructor - * Result of the request to list VpnGateways. It contains a list of VpnGateways - * and a URL nextLink to get the next set of results. - * - * @property {string} [nextLink] URL to get the next set of operation list - * results if there are any. - */ -export interface ListVpnGatewaysResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ListVpnConnectionsResult class. - * @constructor - * Result of the request to list all vpn connections to a virtual wan vpn - * gateway. It contains a list of Vpn Connections and a URL nextLink to get the - * next set of results. - * - * @property {string} [nextLink] URL to get the next set of operation list - * results if there are any. - */ -export interface ListVpnConnectionsResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ListP2SVpnServerConfigurationsResult class. - * @constructor - * Result of the request to list all P2SVpnServerConfigurations associated to a - * VirtualWan. It contains a list of P2SVpnServerConfigurations and a URL - * nextLink to get the next set of results. - * - * @property {string} [nextLink] URL to get the next set of operation list - * results if there are any. - */ -export interface ListP2SVpnServerConfigurationsResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the ListP2SVpnGatewaysResult class. - * @constructor - * Result of the request to list P2SVpnGateways. It contains a list of - * P2SVpnGateways and a URL nextLink to get the next set of results. - * - * @property {string} [nextLink] URL to get the next set of operation list - * results if there are any. - */ -export interface ListP2SVpnGatewaysResult extends Array { - nextLink?: string; -} diff --git a/lib/services/networkManagement2/lib/models/index.js b/lib/services/networkManagement2/lib/models/index.js deleted file mode 100644 index c3ef88283..000000000 --- a/lib/services/networkManagement2/lib/models/index.js +++ /dev/null @@ -1,363 +0,0 @@ -/* - * 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. - */ - -/* jshint latedef:false */ -/* jshint forin:false */ -/* jshint noempty:false */ - -'use strict'; - -var msRestAzure = require('ms-rest-azure'); - -exports.BaseResource = msRestAzure.BaseResource; -exports.CloudError = msRestAzure.CloudError; -exports.SubResource = require('./subResource'); -exports.NetworkInterfaceTapConfiguration = require('./networkInterfaceTapConfiguration'); -exports.Resource = require('./resource'); -exports.ApplicationSecurityGroup = require('./applicationSecurityGroup'); -exports.SecurityRule = require('./securityRule'); -exports.EndpointService = require('./endpointService'); -exports.InterfaceEndpoint = require('./interfaceEndpoint'); -exports.NetworkInterfaceDnsSettings = require('./networkInterfaceDnsSettings'); -exports.NetworkInterface = require('./networkInterface'); -exports.NetworkSecurityGroup = require('./networkSecurityGroup'); -exports.Route = require('./route'); -exports.RouteTable = require('./routeTable'); -exports.ServiceEndpointPropertiesFormat = require('./serviceEndpointPropertiesFormat'); -exports.ServiceEndpointPolicyDefinition = require('./serviceEndpointPolicyDefinition'); -exports.ServiceEndpointPolicy = require('./serviceEndpointPolicy'); -exports.PublicIPAddressSku = require('./publicIPAddressSku'); -exports.PublicIPAddressDnsSettings = require('./publicIPAddressDnsSettings'); -exports.IpTag = require('./ipTag'); -exports.PublicIPAddress = require('./publicIPAddress'); -exports.IPConfiguration = require('./iPConfiguration'); -exports.IPConfigurationProfile = require('./iPConfigurationProfile'); -exports.ResourceNavigationLink = require('./resourceNavigationLink'); -exports.ServiceAssociationLink = require('./serviceAssociationLink'); -exports.Delegation = require('./delegation'); -exports.Subnet = require('./subnet'); -exports.FrontendIPConfiguration = require('./frontendIPConfiguration'); -exports.VirtualNetworkTap = require('./virtualNetworkTap'); -exports.BackendAddressPool = require('./backendAddressPool'); -exports.InboundNatRule = require('./inboundNatRule'); -exports.NetworkInterfaceIPConfiguration = require('./networkInterfaceIPConfiguration'); -exports.ApplicationGatewayBackendAddress = require('./applicationGatewayBackendAddress'); -exports.ApplicationGatewayBackendAddressPool = require('./applicationGatewayBackendAddressPool'); -exports.ApplicationGatewayConnectionDraining = require('./applicationGatewayConnectionDraining'); -exports.ApplicationGatewayBackendHttpSettings = require('./applicationGatewayBackendHttpSettings'); -exports.ApplicationGatewayBackendHealthServer = require('./applicationGatewayBackendHealthServer'); -exports.ApplicationGatewayBackendHealthHttpSettings = require('./applicationGatewayBackendHealthHttpSettings'); -exports.ApplicationGatewayBackendHealthPool = require('./applicationGatewayBackendHealthPool'); -exports.ApplicationGatewayBackendHealth = require('./applicationGatewayBackendHealth'); -exports.ApplicationGatewaySku = require('./applicationGatewaySku'); -exports.ApplicationGatewaySslPolicy = require('./applicationGatewaySslPolicy'); -exports.ApplicationGatewayIPConfiguration = require('./applicationGatewayIPConfiguration'); -exports.ApplicationGatewayAuthenticationCertificate = require('./applicationGatewayAuthenticationCertificate'); -exports.ApplicationGatewayTrustedRootCertificate = require('./applicationGatewayTrustedRootCertificate'); -exports.ApplicationGatewaySslCertificate = require('./applicationGatewaySslCertificate'); -exports.ApplicationGatewayFrontendIPConfiguration = require('./applicationGatewayFrontendIPConfiguration'); -exports.ApplicationGatewayFrontendPort = require('./applicationGatewayFrontendPort'); -exports.ApplicationGatewayCustomError = require('./applicationGatewayCustomError'); -exports.ApplicationGatewayHttpListener = require('./applicationGatewayHttpListener'); -exports.ApplicationGatewayPathRule = require('./applicationGatewayPathRule'); -exports.ApplicationGatewayProbeHealthResponseMatch = require('./applicationGatewayProbeHealthResponseMatch'); -exports.ApplicationGatewayProbe = require('./applicationGatewayProbe'); -exports.ApplicationGatewayRequestRoutingRule = require('./applicationGatewayRequestRoutingRule'); -exports.ApplicationGatewayHeaderConfiguration = require('./applicationGatewayHeaderConfiguration'); -exports.ApplicationGatewayRewriteRuleActionSet = require('./applicationGatewayRewriteRuleActionSet'); -exports.ApplicationGatewayRewriteRule = require('./applicationGatewayRewriteRule'); -exports.ApplicationGatewayRewriteRuleSet = require('./applicationGatewayRewriteRuleSet'); -exports.ApplicationGatewayRedirectConfiguration = require('./applicationGatewayRedirectConfiguration'); -exports.ApplicationGatewayUrlPathMap = require('./applicationGatewayUrlPathMap'); -exports.ApplicationGatewayFirewallDisabledRuleGroup = require('./applicationGatewayFirewallDisabledRuleGroup'); -exports.ApplicationGatewayFirewallExclusion = require('./applicationGatewayFirewallExclusion'); -exports.ApplicationGatewayWebApplicationFirewallConfiguration = require('./applicationGatewayWebApplicationFirewallConfiguration'); -exports.ApplicationGatewayAutoscaleConfiguration = require('./applicationGatewayAutoscaleConfiguration'); -exports.ManagedServiceIdentityUserAssignedIdentitiesValue = require('./managedServiceIdentityUserAssignedIdentitiesValue'); -exports.ManagedServiceIdentity = require('./managedServiceIdentity'); -exports.ApplicationGateway = require('./applicationGateway'); -exports.ApplicationGatewayFirewallRule = require('./applicationGatewayFirewallRule'); -exports.ApplicationGatewayFirewallRuleGroup = require('./applicationGatewayFirewallRuleGroup'); -exports.ApplicationGatewayFirewallRuleSet = require('./applicationGatewayFirewallRuleSet'); -exports.ApplicationGatewayAvailableWafRuleSetsResult = require('./applicationGatewayAvailableWafRuleSetsResult'); -exports.ApplicationGatewayAvailableSslOptions = require('./applicationGatewayAvailableSslOptions'); -exports.ApplicationGatewaySslPredefinedPolicy = require('./applicationGatewaySslPredefinedPolicy'); -exports.TagsObject = require('./tagsObject'); -exports.AvailableDelegation = require('./availableDelegation'); -exports.AzureFirewallIPConfiguration = require('./azureFirewallIPConfiguration'); -exports.AzureFirewallRCAction = require('./azureFirewallRCAction'); -exports.AzureFirewallApplicationRuleProtocol = require('./azureFirewallApplicationRuleProtocol'); -exports.AzureFirewallApplicationRule = require('./azureFirewallApplicationRule'); -exports.AzureFirewallApplicationRuleCollection = require('./azureFirewallApplicationRuleCollection'); -exports.AzureFirewallNatRCAction = require('./azureFirewallNatRCAction'); -exports.AzureFirewallNatRule = require('./azureFirewallNatRule'); -exports.AzureFirewallNatRuleCollection = require('./azureFirewallNatRuleCollection'); -exports.AzureFirewallNetworkRule = require('./azureFirewallNetworkRule'); -exports.AzureFirewallNetworkRuleCollection = require('./azureFirewallNetworkRuleCollection'); -exports.AzureFirewall = require('./azureFirewall'); -exports.AzureFirewallFqdnTag = require('./azureFirewallFqdnTag'); -exports.DnsNameAvailabilityResult = require('./dnsNameAvailabilityResult'); -exports.DdosProtectionPlan = require('./ddosProtectionPlan'); -exports.EndpointServiceResult = require('./endpointServiceResult'); -exports.ExpressRouteCircuitAuthorization = require('./expressRouteCircuitAuthorization'); -exports.ExpressRouteCircuitPeeringConfig = require('./expressRouteCircuitPeeringConfig'); -exports.RouteFilterRule = require('./routeFilterRule'); -exports.ExpressRouteCircuitStats = require('./expressRouteCircuitStats'); -exports.ExpressRouteConnectionId = require('./expressRouteConnectionId'); -exports.ExpressRouteCircuitConnection = require('./expressRouteCircuitConnection'); -exports.ExpressRouteCircuitPeering = require('./expressRouteCircuitPeering'); -exports.RouteFilter = require('./routeFilter'); -exports.Ipv6ExpressRouteCircuitPeeringConfig = require('./ipv6ExpressRouteCircuitPeeringConfig'); -exports.ExpressRouteCircuitSku = require('./expressRouteCircuitSku'); -exports.ExpressRouteCircuitServiceProviderProperties = require('./expressRouteCircuitServiceProviderProperties'); -exports.ExpressRouteCircuit = require('./expressRouteCircuit'); -exports.ExpressRouteCircuitArpTable = require('./expressRouteCircuitArpTable'); -exports.ExpressRouteCircuitsArpTableListResult = require('./expressRouteCircuitsArpTableListResult'); -exports.ExpressRouteCircuitRoutesTable = require('./expressRouteCircuitRoutesTable'); -exports.ExpressRouteCircuitsRoutesTableListResult = require('./expressRouteCircuitsRoutesTableListResult'); -exports.ExpressRouteCircuitRoutesTableSummary = require('./expressRouteCircuitRoutesTableSummary'); -exports.ExpressRouteCircuitsRoutesTableSummaryListResult = require('./expressRouteCircuitsRoutesTableSummaryListResult'); -exports.ExpressRouteServiceProviderBandwidthsOffered = require('./expressRouteServiceProviderBandwidthsOffered'); -exports.ExpressRouteServiceProvider = require('./expressRouteServiceProvider'); -exports.ExpressRouteCrossConnectionRoutesTableSummary = require('./expressRouteCrossConnectionRoutesTableSummary'); -exports.ExpressRouteCrossConnectionsRoutesTableSummaryListResult = require('./expressRouteCrossConnectionsRoutesTableSummaryListResult'); -exports.ExpressRouteCircuitReference = require('./expressRouteCircuitReference'); -exports.ExpressRouteCrossConnectionPeering = require('./expressRouteCrossConnectionPeering'); -exports.ExpressRouteCrossConnection = require('./expressRouteCrossConnection'); -exports.VirtualHubId = require('./virtualHubId'); -exports.ExpressRouteCircuitPeeringId = require('./expressRouteCircuitPeeringId'); -exports.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds = require('./expressRouteGatewayPropertiesAutoScaleConfigurationBounds'); -exports.ExpressRouteGatewayPropertiesAutoScaleConfiguration = require('./expressRouteGatewayPropertiesAutoScaleConfiguration'); -exports.ExpressRouteConnection = require('./expressRouteConnection'); -exports.ExpressRouteGateway = require('./expressRouteGateway'); -exports.ExpressRouteGatewayList = require('./expressRouteGatewayList'); -exports.ExpressRouteConnectionList = require('./expressRouteConnectionList'); -exports.ExpressRoutePortsLocationBandwidths = require('./expressRoutePortsLocationBandwidths'); -exports.ExpressRoutePortsLocation = require('./expressRoutePortsLocation'); -exports.ExpressRouteLink = require('./expressRouteLink'); -exports.ExpressRoutePort = require('./expressRoutePort'); -exports.LoadBalancerSku = require('./loadBalancerSku'); -exports.LoadBalancingRule = require('./loadBalancingRule'); -exports.Probe = require('./probe'); -exports.InboundNatPool = require('./inboundNatPool'); -exports.OutboundRule = require('./outboundRule'); -exports.LoadBalancer = require('./loadBalancer'); -exports.ErrorDetails = require('./errorDetails'); -exports.ErrorModel = require('./errorModel'); -exports.AzureAsyncOperationResult = require('./azureAsyncOperationResult'); -exports.EffectiveNetworkSecurityGroupAssociation = require('./effectiveNetworkSecurityGroupAssociation'); -exports.EffectiveNetworkSecurityRule = require('./effectiveNetworkSecurityRule'); -exports.EffectiveNetworkSecurityGroup = require('./effectiveNetworkSecurityGroup'); -exports.EffectiveNetworkSecurityGroupListResult = require('./effectiveNetworkSecurityGroupListResult'); -exports.EffectiveRoute = require('./effectiveRoute'); -exports.EffectiveRouteListResult = require('./effectiveRouteListResult'); -exports.ContainerNetworkInterfaceConfiguration = require('./containerNetworkInterfaceConfiguration'); -exports.Container = require('./container'); -exports.ContainerNetworkInterfaceIpConfiguration = require('./containerNetworkInterfaceIpConfiguration'); -exports.ContainerNetworkInterface = require('./containerNetworkInterface'); -exports.NetworkProfile = require('./networkProfile'); -exports.ErrorResponse = require('./errorResponse'); -exports.NetworkWatcher = require('./networkWatcher'); -exports.TopologyParameters = require('./topologyParameters'); -exports.TopologyAssociation = require('./topologyAssociation'); -exports.TopologyResource = require('./topologyResource'); -exports.Topology = require('./topology'); -exports.VerificationIPFlowParameters = require('./verificationIPFlowParameters'); -exports.VerificationIPFlowResult = require('./verificationIPFlowResult'); -exports.NextHopParameters = require('./nextHopParameters'); -exports.NextHopResult = require('./nextHopResult'); -exports.SecurityGroupViewParameters = require('./securityGroupViewParameters'); -exports.NetworkInterfaceAssociation = require('./networkInterfaceAssociation'); -exports.SubnetAssociation = require('./subnetAssociation'); -exports.SecurityRuleAssociations = require('./securityRuleAssociations'); -exports.SecurityGroupNetworkInterface = require('./securityGroupNetworkInterface'); -exports.SecurityGroupViewResult = require('./securityGroupViewResult'); -exports.PacketCaptureStorageLocation = require('./packetCaptureStorageLocation'); -exports.PacketCaptureFilter = require('./packetCaptureFilter'); -exports.PacketCaptureParameters = require('./packetCaptureParameters'); -exports.PacketCapture = require('./packetCapture'); -exports.PacketCaptureResult = require('./packetCaptureResult'); -exports.PacketCaptureQueryStatusResult = require('./packetCaptureQueryStatusResult'); -exports.TroubleshootingParameters = require('./troubleshootingParameters'); -exports.QueryTroubleshootingParameters = require('./queryTroubleshootingParameters'); -exports.TroubleshootingRecommendedActions = require('./troubleshootingRecommendedActions'); -exports.TroubleshootingDetails = require('./troubleshootingDetails'); -exports.TroubleshootingResult = require('./troubleshootingResult'); -exports.RetentionPolicyParameters = require('./retentionPolicyParameters'); -exports.FlowLogFormatParameters = require('./flowLogFormatParameters'); -exports.FlowLogStatusParameters = require('./flowLogStatusParameters'); -exports.TrafficAnalyticsConfigurationProperties = require('./trafficAnalyticsConfigurationProperties'); -exports.TrafficAnalyticsProperties = require('./trafficAnalyticsProperties'); -exports.FlowLogInformation = require('./flowLogInformation'); -exports.ConnectivitySource = require('./connectivitySource'); -exports.ConnectivityDestination = require('./connectivityDestination'); -exports.HTTPHeader = require('./hTTPHeader'); -exports.HTTPConfiguration = require('./hTTPConfiguration'); -exports.ProtocolConfiguration = require('./protocolConfiguration'); -exports.ConnectivityParameters = require('./connectivityParameters'); -exports.ConnectivityIssue = require('./connectivityIssue'); -exports.ConnectivityHop = require('./connectivityHop'); -exports.ConnectivityInformation = require('./connectivityInformation'); -exports.AzureReachabilityReportLocation = require('./azureReachabilityReportLocation'); -exports.AzureReachabilityReportParameters = require('./azureReachabilityReportParameters'); -exports.AzureReachabilityReportLatencyInfo = require('./azureReachabilityReportLatencyInfo'); -exports.AzureReachabilityReportItem = require('./azureReachabilityReportItem'); -exports.AzureReachabilityReport = require('./azureReachabilityReport'); -exports.AvailableProvidersListParameters = require('./availableProvidersListParameters'); -exports.AvailableProvidersListCity = require('./availableProvidersListCity'); -exports.AvailableProvidersListState = require('./availableProvidersListState'); -exports.AvailableProvidersListCountry = require('./availableProvidersListCountry'); -exports.AvailableProvidersList = require('./availableProvidersList'); -exports.ConnectionMonitorSource = require('./connectionMonitorSource'); -exports.ConnectionMonitorDestination = require('./connectionMonitorDestination'); -exports.ConnectionMonitorParameters = require('./connectionMonitorParameters'); -exports.ConnectionMonitor = require('./connectionMonitor'); -exports.ConnectionMonitorResult = require('./connectionMonitorResult'); -exports.ConnectionStateSnapshot = require('./connectionStateSnapshot'); -exports.ConnectionMonitorQueryResult = require('./connectionMonitorQueryResult'); -exports.NetworkConfigurationDiagnosticProfile = require('./networkConfigurationDiagnosticProfile'); -exports.NetworkConfigurationDiagnosticParameters = require('./networkConfigurationDiagnosticParameters'); -exports.MatchedRule = require('./matchedRule'); -exports.NetworkSecurityRulesEvaluationResult = require('./networkSecurityRulesEvaluationResult'); -exports.EvaluatedNetworkSecurityGroup = require('./evaluatedNetworkSecurityGroup'); -exports.NetworkSecurityGroupResult = require('./networkSecurityGroupResult'); -exports.NetworkConfigurationDiagnosticResult = require('./networkConfigurationDiagnosticResult'); -exports.NetworkConfigurationDiagnosticResponse = require('./networkConfigurationDiagnosticResponse'); -exports.OperationDisplay = require('./operationDisplay'); -exports.Availability = require('./availability'); -exports.Dimension = require('./dimension'); -exports.MetricSpecification = require('./metricSpecification'); -exports.LogSpecification = require('./logSpecification'); -exports.OperationPropertiesFormatServiceSpecification = require('./operationPropertiesFormatServiceSpecification'); -exports.Operation = require('./operation'); -exports.PublicIPPrefixSku = require('./publicIPPrefixSku'); -exports.ReferencedPublicIpAddress = require('./referencedPublicIpAddress'); -exports.PublicIPPrefix = require('./publicIPPrefix'); -exports.PatchRouteFilterRule = require('./patchRouteFilterRule'); -exports.PatchRouteFilter = require('./patchRouteFilter'); -exports.BGPCommunity = require('./bGPCommunity'); -exports.BgpServiceCommunity = require('./bgpServiceCommunity'); -exports.UsageName = require('./usageName'); -exports.Usage = require('./usage'); -exports.AddressSpace = require('./addressSpace'); -exports.VirtualNetworkPeering = require('./virtualNetworkPeering'); -exports.DhcpOptions = require('./dhcpOptions'); -exports.VirtualNetwork = require('./virtualNetwork'); -exports.IPAddressAvailabilityResult = require('./iPAddressAvailabilityResult'); -exports.VirtualNetworkUsageName = require('./virtualNetworkUsageName'); -exports.VirtualNetworkUsage = require('./virtualNetworkUsage'); -exports.VirtualNetworkGatewayIPConfiguration = require('./virtualNetworkGatewayIPConfiguration'); -exports.VirtualNetworkGatewaySku = require('./virtualNetworkGatewaySku'); -exports.VpnClientRootCertificate = require('./vpnClientRootCertificate'); -exports.VpnClientRevokedCertificate = require('./vpnClientRevokedCertificate'); -exports.IpsecPolicy = require('./ipsecPolicy'); -exports.VpnClientConfiguration = require('./vpnClientConfiguration'); -exports.BgpSettings = require('./bgpSettings'); -exports.BgpPeerStatus = require('./bgpPeerStatus'); -exports.GatewayRoute = require('./gatewayRoute'); -exports.VirtualNetworkGateway = require('./virtualNetworkGateway'); -exports.VpnClientParameters = require('./vpnClientParameters'); -exports.BgpPeerStatusListResult = require('./bgpPeerStatusListResult'); -exports.GatewayRouteListResult = require('./gatewayRouteListResult'); -exports.TunnelConnectionHealth = require('./tunnelConnectionHealth'); -exports.LocalNetworkGateway = require('./localNetworkGateway'); -exports.VirtualNetworkGatewayConnection = require('./virtualNetworkGatewayConnection'); -exports.ConnectionResetSharedKey = require('./connectionResetSharedKey'); -exports.ConnectionSharedKey = require('./connectionSharedKey'); -exports.VpnClientIPsecParameters = require('./vpnClientIPsecParameters'); -exports.VirtualNetworkConnectionGatewayReference = require('./virtualNetworkConnectionGatewayReference'); -exports.VirtualNetworkGatewayConnectionListEntity = require('./virtualNetworkGatewayConnectionListEntity'); -exports.VpnDeviceScriptParameters = require('./vpnDeviceScriptParameters'); -exports.P2SVpnServerConfigVpnClientRootCertificate = require('./p2SVpnServerConfigVpnClientRootCertificate'); -exports.P2SVpnServerConfigVpnClientRevokedCertificate = require('./p2SVpnServerConfigVpnClientRevokedCertificate'); -exports.P2SVpnServerConfigRadiusServerRootCertificate = require('./p2SVpnServerConfigRadiusServerRootCertificate'); -exports.P2SVpnServerConfigRadiusClientRootCertificate = require('./p2SVpnServerConfigRadiusClientRootCertificate'); -exports.P2SVpnServerConfiguration = require('./p2SVpnServerConfiguration'); -exports.VirtualWAN = require('./virtualWAN'); -exports.DeviceProperties = require('./deviceProperties'); -exports.VpnSite = require('./vpnSite'); -exports.GetVpnSitesConfigurationRequest = require('./getVpnSitesConfigurationRequest'); -exports.HubVirtualNetworkConnection = require('./hubVirtualNetworkConnection'); -exports.VirtualHubRoute = require('./virtualHubRoute'); -exports.VirtualHubRouteTable = require('./virtualHubRouteTable'); -exports.VirtualHub = require('./virtualHub'); -exports.VpnConnection = require('./vpnConnection'); -exports.VpnGateway = require('./vpnGateway'); -exports.VpnSiteId = require('./vpnSiteId'); -exports.VirtualWanSecurityProvider = require('./virtualWanSecurityProvider'); -exports.VirtualWanSecurityProviders = require('./virtualWanSecurityProviders'); -exports.VpnClientConnectionHealth = require('./vpnClientConnectionHealth'); -exports.P2SVpnGateway = require('./p2SVpnGateway'); -exports.P2SVpnProfileParameters = require('./p2SVpnProfileParameters'); -exports.VpnProfileResponse = require('./vpnProfileResponse'); -exports.ApplicationGatewayListResult = require('./applicationGatewayListResult'); -exports.ApplicationGatewayAvailableSslPredefinedPolicies = require('./applicationGatewayAvailableSslPredefinedPolicies'); -exports.ApplicationSecurityGroupListResult = require('./applicationSecurityGroupListResult'); -exports.AvailableDelegationsResult = require('./availableDelegationsResult'); -exports.AzureFirewallListResult = require('./azureFirewallListResult'); -exports.AzureFirewallFqdnTagListResult = require('./azureFirewallFqdnTagListResult'); -exports.DdosProtectionPlanListResult = require('./ddosProtectionPlanListResult'); -exports.EndpointServicesListResult = require('./endpointServicesListResult'); -exports.AuthorizationListResult = require('./authorizationListResult'); -exports.ExpressRouteCircuitPeeringListResult = require('./expressRouteCircuitPeeringListResult'); -exports.ExpressRouteCircuitConnectionListResult = require('./expressRouteCircuitConnectionListResult'); -exports.ExpressRouteCircuitListResult = require('./expressRouteCircuitListResult'); -exports.ExpressRouteServiceProviderListResult = require('./expressRouteServiceProviderListResult'); -exports.ExpressRouteCrossConnectionListResult = require('./expressRouteCrossConnectionListResult'); -exports.ExpressRouteCrossConnectionPeeringList = require('./expressRouteCrossConnectionPeeringList'); -exports.ExpressRoutePortsLocationListResult = require('./expressRoutePortsLocationListResult'); -exports.ExpressRoutePortListResult = require('./expressRoutePortListResult'); -exports.ExpressRouteLinkListResult = require('./expressRouteLinkListResult'); -exports.InterfaceEndpointListResult = require('./interfaceEndpointListResult'); -exports.LoadBalancerListResult = require('./loadBalancerListResult'); -exports.LoadBalancerBackendAddressPoolListResult = require('./loadBalancerBackendAddressPoolListResult'); -exports.LoadBalancerFrontendIPConfigurationListResult = require('./loadBalancerFrontendIPConfigurationListResult'); -exports.InboundNatRuleListResult = require('./inboundNatRuleListResult'); -exports.LoadBalancerLoadBalancingRuleListResult = require('./loadBalancerLoadBalancingRuleListResult'); -exports.LoadBalancerOutboundRuleListResult = require('./loadBalancerOutboundRuleListResult'); -exports.NetworkInterfaceListResult = require('./networkInterfaceListResult'); -exports.LoadBalancerProbeListResult = require('./loadBalancerProbeListResult'); -exports.NetworkInterfaceIPConfigurationListResult = require('./networkInterfaceIPConfigurationListResult'); -exports.NetworkInterfaceLoadBalancerListResult = require('./networkInterfaceLoadBalancerListResult'); -exports.NetworkInterfaceTapConfigurationListResult = require('./networkInterfaceTapConfigurationListResult'); -exports.NetworkProfileListResult = require('./networkProfileListResult'); -exports.NetworkSecurityGroupListResult = require('./networkSecurityGroupListResult'); -exports.SecurityRuleListResult = require('./securityRuleListResult'); -exports.NetworkWatcherListResult = require('./networkWatcherListResult'); -exports.PacketCaptureListResult = require('./packetCaptureListResult'); -exports.ConnectionMonitorListResult = require('./connectionMonitorListResult'); -exports.OperationListResult = require('./operationListResult'); -exports.PublicIPAddressListResult = require('./publicIPAddressListResult'); -exports.PublicIPPrefixListResult = require('./publicIPPrefixListResult'); -exports.RouteFilterListResult = require('./routeFilterListResult'); -exports.RouteFilterRuleListResult = require('./routeFilterRuleListResult'); -exports.RouteTableListResult = require('./routeTableListResult'); -exports.RouteListResult = require('./routeListResult'); -exports.BgpServiceCommunityListResult = require('./bgpServiceCommunityListResult'); -exports.ServiceEndpointPolicyListResult = require('./serviceEndpointPolicyListResult'); -exports.ServiceEndpointPolicyDefinitionListResult = require('./serviceEndpointPolicyDefinitionListResult'); -exports.UsagesListResult = require('./usagesListResult'); -exports.VirtualNetworkListResult = require('./virtualNetworkListResult'); -exports.VirtualNetworkListUsageResult = require('./virtualNetworkListUsageResult'); -exports.SubnetListResult = require('./subnetListResult'); -exports.VirtualNetworkPeeringListResult = require('./virtualNetworkPeeringListResult'); -exports.VirtualNetworkGatewayListResult = require('./virtualNetworkGatewayListResult'); -exports.VirtualNetworkGatewayListConnectionsResult = require('./virtualNetworkGatewayListConnectionsResult'); -exports.VirtualNetworkGatewayConnectionListResult = require('./virtualNetworkGatewayConnectionListResult'); -exports.LocalNetworkGatewayListResult = require('./localNetworkGatewayListResult'); -exports.VirtualNetworkTapListResult = require('./virtualNetworkTapListResult'); -exports.ListVirtualWANsResult = require('./listVirtualWANsResult'); -exports.ListVpnSitesResult = require('./listVpnSitesResult'); -exports.ListVirtualHubsResult = require('./listVirtualHubsResult'); -exports.ListHubVirtualNetworkConnectionsResult = require('./listHubVirtualNetworkConnectionsResult'); -exports.ListVpnGatewaysResult = require('./listVpnGatewaysResult'); -exports.ListVpnConnectionsResult = require('./listVpnConnectionsResult'); -exports.ListP2SVpnServerConfigurationsResult = require('./listP2SVpnServerConfigurationsResult'); -exports.ListP2SVpnGatewaysResult = require('./listP2SVpnGatewaysResult'); diff --git a/lib/services/networkManagement2/lib/models/interfaceEndpoint.js b/lib/services/networkManagement2/lib/models/interfaceEndpoint.js deleted file mode 100644 index 38a18dfd3..000000000 --- a/lib/services/networkManagement2/lib/models/interfaceEndpoint.js +++ /dev/null @@ -1,230 +0,0 @@ -/* - * 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'); - -/** - * Interface endpoint resource. - * - * @extends models['Resource'] - */ -class InterfaceEndpoint extends models['Resource'] { - /** - * Create a InterfaceEndpoint. - * @property {string} [fqdn] A first-party service's FQDN that is mapped to - * the private IP allocated via this interface endpoint. - * @property {object} [endpointService] A reference to the service being - * brought into the virtual network. - * @property {string} [endpointService.id] A unique identifier of the service - * being referenced by the interface endpoint. - * @property {object} [subnet] The ID of the subnet from which the private IP - * will be allocated. - * @property {string} [subnet.addressPrefix] The address prefix for the - * subnet. - * @property {array} [subnet.addressPrefixes] List of address prefixes for - * the subnet. - * @property {object} [subnet.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * @property {array} [subnet.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * @property {array} [subnet.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * @property {array} [subnet.networkSecurityGroup.networkInterfaces] A - * collection of references to network interfaces. - * @property {array} [subnet.networkSecurityGroup.subnets] A collection of - * references to subnets. - * @property {string} [subnet.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. - * @property {string} [subnet.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [subnet.networkSecurityGroup.etag] A unique read-only - * string that changes whenever the resource is updated. - * @property {object} [subnet.routeTable] The reference of the RouteTable - * resource. - * @property {array} [subnet.routeTable.routes] Collection of routes - * contained within a route table. - * @property {array} [subnet.routeTable.subnets] A collection of references - * to subnets. - * @property {boolean} [subnet.routeTable.disableBgpRoutePropagation] Gets or - * sets whether to disable the routes learned by BGP on that route table. - * True means disable. - * @property {string} [subnet.routeTable.provisioningState] The provisioning - * state of the resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [subnet.routeTable.etag] Gets a unique read-only string - * that changes whenever the resource is updated. - * @property {array} [subnet.serviceEndpoints] An array of service endpoints. - * @property {array} [subnet.serviceEndpointPolicies] An array of service - * endpoint policies. - * @property {array} [subnet.interfaceEndpoints] An array of references to - * interface endpoints - * @property {array} [subnet.ipConfigurations] Gets an array of references to - * the network interface IP configurations using subnet. - * @property {array} [subnet.ipConfigurationProfiles] Array of IP - * configuration profiles which reference this subnet. - * @property {array} [subnet.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * @property {array} [subnet.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * @property {array} [subnet.delegations] Gets an array of references to the - * delegations on the subnet. - * @property {string} [subnet.purpose] A read-only string identifying the - * intention of use for this subnet based on delegations and other - * user-defined properties. - * @property {string} [subnet.provisioningState] The provisioning state of - * the resource. - * @property {string} [subnet.name] The name of the resource that is unique - * within a resource group. This name can be used to access the resource. - * @property {string} [subnet.etag] A unique read-only string that changes - * whenever the resource is updated. - * @property {array} [networkInterfaces] Gets an array of references to the - * network interfaces created for this interface endpoint. - * @property {string} [owner] A read-only property that identifies who - * created this interface endpoint. - * @property {string} [provisioningState] The provisioning state of the - * interface endpoint. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of InterfaceEndpoint - * - * @returns {object} metadata of InterfaceEndpoint - * - */ - mapper() { - return { - required: false, - serializedName: 'InterfaceEndpoint', - type: { - name: 'Composite', - className: 'InterfaceEndpoint', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - fqdn: { - required: false, - serializedName: 'properties.fqdn', - type: { - name: 'String' - } - }, - endpointService: { - required: false, - serializedName: 'properties.endpointService', - type: { - name: 'Composite', - className: 'EndpointService' - } - }, - subnet: { - required: false, - serializedName: 'properties.subnet', - type: { - name: 'Composite', - className: 'Subnet' - } - }, - networkInterfaces: { - required: false, - readOnly: true, - serializedName: 'properties.networkInterfaces', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'NetworkInterfaceElementType', - type: { - name: 'Composite', - className: 'NetworkInterface' - } - } - } - }, - owner: { - required: false, - readOnly: true, - serializedName: 'properties.owner', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = InterfaceEndpoint; diff --git a/lib/services/networkManagement2/lib/models/interfaceEndpointListResult.js b/lib/services/networkManagement2/lib/models/interfaceEndpointListResult.js deleted file mode 100644 index b1c7334ca..000000000 --- a/lib/services/networkManagement2/lib/models/interfaceEndpointListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 the ListInterfaceEndpoints API service call. - */ -class InterfaceEndpointListResult extends Array { - /** - * Create a InterfaceEndpointListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of InterfaceEndpointListResult - * - * @returns {object} metadata of InterfaceEndpointListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'InterfaceEndpointListResult', - type: { - name: 'Composite', - className: 'InterfaceEndpointListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'InterfaceEndpointElementType', - type: { - name: 'Composite', - className: 'InterfaceEndpoint' - } - } - } - }, - nextLink: { - required: false, - readOnly: true, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = InterfaceEndpointListResult; diff --git a/lib/services/networkManagement2/lib/models/ipTag.js b/lib/services/networkManagement2/lib/models/ipTag.js deleted file mode 100644 index 47fab3d90..000000000 --- a/lib/services/networkManagement2/lib/models/ipTag.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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'; - -/** - * Contains the IpTag associated with the object - * - */ -class IpTag { - /** - * Create a IpTag. - * @property {string} [ipTagType] Gets or sets the ipTag type: Example - * FirstPartyUsage. - * @property {string} [tag] Gets or sets value of the IpTag associated with - * the public IP. Example SQL, Storage etc - */ - constructor() { - } - - /** - * Defines the metadata of IpTag - * - * @returns {object} metadata of IpTag - * - */ - mapper() { - return { - required: false, - serializedName: 'IpTag', - type: { - name: 'Composite', - className: 'IpTag', - modelProperties: { - ipTagType: { - required: false, - serializedName: 'ipTagType', - type: { - name: 'String' - } - }, - tag: { - required: false, - serializedName: 'tag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = IpTag; diff --git a/lib/services/networkManagement2/lib/models/ipsecPolicy.js b/lib/services/networkManagement2/lib/models/ipsecPolicy.js deleted file mode 100644 index 3ec08267a..000000000 --- a/lib/services/networkManagement2/lib/models/ipsecPolicy.js +++ /dev/null @@ -1,124 +0,0 @@ -/* - * 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'; - -/** - * An IPSec Policy configuration for a virtual network gateway connection - * - */ -class IpsecPolicy { - /** - * Create a IpsecPolicy. - * @property {number} saLifeTimeSeconds The IPSec Security Association (also - * called Quick Mode or Phase 2 SA) lifetime in seconds for a site to site - * VPN tunnel. - * @property {number} saDataSizeKilobytes The IPSec Security Association - * (also called Quick Mode or Phase 2 SA) payload size in KB for a site to - * site VPN tunnel. - * @property {string} ipsecEncryption The IPSec encryption algorithm (IKE - * phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', - * 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' - * @property {string} ipsecIntegrity The IPSec integrity algorithm (IKE phase - * 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', - * 'GCMAES192', 'GCMAES256' - * @property {string} ikeEncryption The IKE encryption algorithm (IKE phase - * 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', - * 'GCMAES256', 'GCMAES128' - * @property {string} ikeIntegrity The IKE integrity algorithm (IKE phase 2). - * Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', - * 'GCMAES128' - * @property {string} dhGroup The DH Groups used in IKE Phase 1 for initial - * SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', - * 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' - * @property {string} pfsGroup The Pfs Groups used in IKE Phase 2 for new - * child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', - * 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' - */ - constructor() { - } - - /** - * Defines the metadata of IpsecPolicy - * - * @returns {object} metadata of IpsecPolicy - * - */ - mapper() { - return { - required: false, - serializedName: 'IpsecPolicy', - type: { - name: 'Composite', - className: 'IpsecPolicy', - modelProperties: { - saLifeTimeSeconds: { - required: true, - serializedName: 'saLifeTimeSeconds', - type: { - name: 'Number' - } - }, - saDataSizeKilobytes: { - required: true, - serializedName: 'saDataSizeKilobytes', - type: { - name: 'Number' - } - }, - ipsecEncryption: { - required: true, - serializedName: 'ipsecEncryption', - type: { - name: 'String' - } - }, - ipsecIntegrity: { - required: true, - serializedName: 'ipsecIntegrity', - type: { - name: 'String' - } - }, - ikeEncryption: { - required: true, - serializedName: 'ikeEncryption', - type: { - name: 'String' - } - }, - ikeIntegrity: { - required: true, - serializedName: 'ikeIntegrity', - type: { - name: 'String' - } - }, - dhGroup: { - required: true, - serializedName: 'dhGroup', - type: { - name: 'String' - } - }, - pfsGroup: { - required: true, - serializedName: 'pfsGroup', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = IpsecPolicy; diff --git a/lib/services/networkManagement2/lib/models/ipv6ExpressRouteCircuitPeeringConfig.js b/lib/services/networkManagement2/lib/models/ipv6ExpressRouteCircuitPeeringConfig.js deleted file mode 100644 index 8963d27f2..000000000 --- a/lib/services/networkManagement2/lib/models/ipv6ExpressRouteCircuitPeeringConfig.js +++ /dev/null @@ -1,114 +0,0 @@ -/* - * 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'; - -/** - * Contains IPv6 peering config. - * - */ -class Ipv6ExpressRouteCircuitPeeringConfig { - /** - * Create a Ipv6ExpressRouteCircuitPeeringConfig. - * @property {string} [primaryPeerAddressPrefix] The primary address prefix. - * @property {string} [secondaryPeerAddressPrefix] The secondary address - * prefix. - * @property {object} [microsoftPeeringConfig] The Microsoft peering - * configuration. - * @property {array} [microsoftPeeringConfig.advertisedPublicPrefixes] The - * reference of AdvertisedPublicPrefixes. - * @property {array} [microsoftPeeringConfig.advertisedCommunities] The - * communities of bgp peering. Spepcified for microsoft peering - * @property {string} [microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * @property {number} [microsoftPeeringConfig.legacyMode] The legacy mode of - * the peering. - * @property {number} [microsoftPeeringConfig.customerASN] The CustomerASN of - * the peering. - * @property {string} [microsoftPeeringConfig.routingRegistryName] The - * RoutingRegistryName of the configuration. - * @property {object} [routeFilter] The reference of the RouteFilter - * resource. - * @property {array} [routeFilter.rules] Collection of RouteFilterRules - * contained within a route filter. - * @property {array} [routeFilter.peerings] A collection of references to - * express route circuit peerings. - * @property {string} [routeFilter.provisioningState] The provisioning state - * of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' - * and 'Failed'. - * @property {string} [routeFilter.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * @property {string} [state] The state of peering. Possible values are: - * 'Disabled' and 'Enabled'. Possible values include: 'Disabled', 'Enabled' - */ - constructor() { - } - - /** - * Defines the metadata of Ipv6ExpressRouteCircuitPeeringConfig - * - * @returns {object} metadata of Ipv6ExpressRouteCircuitPeeringConfig - * - */ - mapper() { - return { - required: false, - serializedName: 'Ipv6ExpressRouteCircuitPeeringConfig', - type: { - name: 'Composite', - className: 'Ipv6ExpressRouteCircuitPeeringConfig', - modelProperties: { - primaryPeerAddressPrefix: { - required: false, - serializedName: 'primaryPeerAddressPrefix', - type: { - name: 'String' - } - }, - secondaryPeerAddressPrefix: { - required: false, - serializedName: 'secondaryPeerAddressPrefix', - type: { - name: 'String' - } - }, - microsoftPeeringConfig: { - required: false, - serializedName: 'microsoftPeeringConfig', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitPeeringConfig' - } - }, - routeFilter: { - required: false, - serializedName: 'routeFilter', - type: { - name: 'Composite', - className: 'RouteFilter' - } - }, - state: { - required: false, - serializedName: 'state', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = Ipv6ExpressRouteCircuitPeeringConfig; diff --git a/lib/services/networkManagement2/lib/models/listHubVirtualNetworkConnectionsResult.js b/lib/services/networkManagement2/lib/models/listHubVirtualNetworkConnectionsResult.js deleted file mode 100644 index 9596bebb8..000000000 --- a/lib/services/networkManagement2/lib/models/listHubVirtualNetworkConnectionsResult.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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'; - -/** - * List of HubVirtualNetworkConnections and a URL nextLink to get the next set - * of results. - */ -class ListHubVirtualNetworkConnectionsResult extends Array { - /** - * Create a ListHubVirtualNetworkConnectionsResult. - * @property {string} [nextLink] URL to get the next set of operation list - * results if there are any. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ListHubVirtualNetworkConnectionsResult - * - * @returns {object} metadata of ListHubVirtualNetworkConnectionsResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ListHubVirtualNetworkConnectionsResult', - type: { - name: 'Composite', - className: 'ListHubVirtualNetworkConnectionsResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'HubVirtualNetworkConnectionElementType', - type: { - name: 'Composite', - className: 'HubVirtualNetworkConnection' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ListHubVirtualNetworkConnectionsResult; diff --git a/lib/services/networkManagement2/lib/models/listP2SVpnGatewaysResult.js b/lib/services/networkManagement2/lib/models/listP2SVpnGatewaysResult.js deleted file mode 100644 index 988b232df..000000000 --- a/lib/services/networkManagement2/lib/models/listP2SVpnGatewaysResult.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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'; - -/** - * Result of the request to list P2SVpnGateways. It contains a list of - * P2SVpnGateways and a URL nextLink to get the next set of results. - */ -class ListP2SVpnGatewaysResult extends Array { - /** - * Create a ListP2SVpnGatewaysResult. - * @property {string} [nextLink] URL to get the next set of operation list - * results if there are any. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ListP2SVpnGatewaysResult - * - * @returns {object} metadata of ListP2SVpnGatewaysResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ListP2SVpnGatewaysResult', - type: { - name: 'Composite', - className: 'ListP2SVpnGatewaysResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'P2SVpnGatewayElementType', - type: { - name: 'Composite', - className: 'P2SVpnGateway' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ListP2SVpnGatewaysResult; diff --git a/lib/services/networkManagement2/lib/models/listP2SVpnServerConfigurationsResult.js b/lib/services/networkManagement2/lib/models/listP2SVpnServerConfigurationsResult.js deleted file mode 100644 index 24dc8bccc..000000000 --- a/lib/services/networkManagement2/lib/models/listP2SVpnServerConfigurationsResult.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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'; - -/** - * Result of the request to list all P2SVpnServerConfigurations associated to a - * VirtualWan. It contains a list of P2SVpnServerConfigurations and a URL - * nextLink to get the next set of results. - */ -class ListP2SVpnServerConfigurationsResult extends Array { - /** - * Create a ListP2SVpnServerConfigurationsResult. - * @property {string} [nextLink] URL to get the next set of operation list - * results if there are any. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ListP2SVpnServerConfigurationsResult - * - * @returns {object} metadata of ListP2SVpnServerConfigurationsResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ListP2SVpnServerConfigurationsResult', - type: { - name: 'Composite', - className: 'ListP2SVpnServerConfigurationsResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'P2SVpnServerConfigurationElementType', - type: { - name: 'Composite', - className: 'P2SVpnServerConfiguration' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ListP2SVpnServerConfigurationsResult; diff --git a/lib/services/networkManagement2/lib/models/listVirtualHubsResult.js b/lib/services/networkManagement2/lib/models/listVirtualHubsResult.js deleted file mode 100644 index f5c2f8321..000000000 --- a/lib/services/networkManagement2/lib/models/listVirtualHubsResult.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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'; - -/** - * Result of the request to list VirtualHubs. It contains a list of VirtualHubs - * and a URL nextLink to get the next set of results. - */ -class ListVirtualHubsResult extends Array { - /** - * Create a ListVirtualHubsResult. - * @property {string} [nextLink] URL to get the next set of operation list - * results if there are any. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ListVirtualHubsResult - * - * @returns {object} metadata of ListVirtualHubsResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ListVirtualHubsResult', - type: { - name: 'Composite', - className: 'ListVirtualHubsResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'VirtualHubElementType', - type: { - name: 'Composite', - className: 'VirtualHub' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ListVirtualHubsResult; diff --git a/lib/services/networkManagement2/lib/models/listVirtualWANsResult.js b/lib/services/networkManagement2/lib/models/listVirtualWANsResult.js deleted file mode 100644 index 0d494c5bf..000000000 --- a/lib/services/networkManagement2/lib/models/listVirtualWANsResult.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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'; - -/** - * Result of the request to list VirtualWANs. It contains a list of VirtualWANs - * and a URL nextLink to get the next set of results. - */ -class ListVirtualWANsResult extends Array { - /** - * Create a ListVirtualWANsResult. - * @property {string} [nextLink] URL to get the next set of operation list - * results if there are any. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ListVirtualWANsResult - * - * @returns {object} metadata of ListVirtualWANsResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ListVirtualWANsResult', - type: { - name: 'Composite', - className: 'ListVirtualWANsResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'VirtualWANElementType', - type: { - name: 'Composite', - className: 'VirtualWAN' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ListVirtualWANsResult; diff --git a/lib/services/networkManagement2/lib/models/listVpnConnectionsResult.js b/lib/services/networkManagement2/lib/models/listVpnConnectionsResult.js deleted file mode 100644 index d991a7584..000000000 --- a/lib/services/networkManagement2/lib/models/listVpnConnectionsResult.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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'; - -/** - * Result of the request to list all vpn connections to a virtual wan vpn - * gateway. It contains a list of Vpn Connections and a URL nextLink to get the - * next set of results. - */ -class ListVpnConnectionsResult extends Array { - /** - * Create a ListVpnConnectionsResult. - * @property {string} [nextLink] URL to get the next set of operation list - * results if there are any. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ListVpnConnectionsResult - * - * @returns {object} metadata of ListVpnConnectionsResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ListVpnConnectionsResult', - type: { - name: 'Composite', - className: 'ListVpnConnectionsResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'VpnConnectionElementType', - type: { - name: 'Composite', - className: 'VpnConnection' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ListVpnConnectionsResult; diff --git a/lib/services/networkManagement2/lib/models/listVpnGatewaysResult.js b/lib/services/networkManagement2/lib/models/listVpnGatewaysResult.js deleted file mode 100644 index 6f0266910..000000000 --- a/lib/services/networkManagement2/lib/models/listVpnGatewaysResult.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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'; - -/** - * Result of the request to list VpnGateways. It contains a list of VpnGateways - * and a URL nextLink to get the next set of results. - */ -class ListVpnGatewaysResult extends Array { - /** - * Create a ListVpnGatewaysResult. - * @property {string} [nextLink] URL to get the next set of operation list - * results if there are any. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ListVpnGatewaysResult - * - * @returns {object} metadata of ListVpnGatewaysResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ListVpnGatewaysResult', - type: { - name: 'Composite', - className: 'ListVpnGatewaysResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'VpnGatewayElementType', - type: { - name: 'Composite', - className: 'VpnGateway' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ListVpnGatewaysResult; diff --git a/lib/services/networkManagement2/lib/models/listVpnSitesResult.js b/lib/services/networkManagement2/lib/models/listVpnSitesResult.js deleted file mode 100644 index 76f08e965..000000000 --- a/lib/services/networkManagement2/lib/models/listVpnSitesResult.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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'; - -/** - * Result of the request to list VpnSites. It contains a list of VpnSites and a - * URL nextLink to get the next set of results. - */ -class ListVpnSitesResult extends Array { - /** - * Create a ListVpnSitesResult. - * @property {string} [nextLink] URL to get the next set of operation list - * results if there are any. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ListVpnSitesResult - * - * @returns {object} metadata of ListVpnSitesResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ListVpnSitesResult', - type: { - name: 'Composite', - className: 'ListVpnSitesResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'VpnSiteElementType', - type: { - name: 'Composite', - className: 'VpnSite' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ListVpnSitesResult; diff --git a/lib/services/networkManagement2/lib/models/loadBalancer.js b/lib/services/networkManagement2/lib/models/loadBalancer.js deleted file mode 100644 index ae646db2c..000000000 --- a/lib/services/networkManagement2/lib/models/loadBalancer.js +++ /dev/null @@ -1,260 +0,0 @@ -/* - * 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'); - -/** - * LoadBalancer resource - * - * @extends models['Resource'] - */ -class LoadBalancer extends models['Resource'] { - /** - * Create a LoadBalancer. - * @property {object} [sku] The load balancer SKU. - * @property {string} [sku.name] Name of a load balancer SKU. Possible values - * include: 'Basic', 'Standard' - * @property {array} [frontendIPConfigurations] Object representing the - * frontend IPs to be used for the load balancer - * @property {array} [backendAddressPools] Collection of backend address - * pools used by a load balancer - * @property {array} [loadBalancingRules] Object collection representing the - * load balancing rules Gets the provisioning - * @property {array} [probes] Collection of probe objects used in the load - * balancer - * @property {array} [inboundNatRules] Collection of inbound NAT Rules used - * by a load balancer. Defining inbound NAT rules on your load balancer is - * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools - * are referenced from virtual machine scale sets. NICs that are associated - * with individual virtual machines cannot reference an Inbound NAT pool. - * They have to reference individual inbound NAT rules. - * @property {array} [inboundNatPools] Defines an external port range for - * inbound NAT to a single backend port on NICs associated with a load - * balancer. Inbound NAT rules are created automatically for each NIC - * associated with the Load Balancer using an external port from this range. - * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive - * with defining inbound Nat rules. Inbound NAT pools are referenced from - * virtual machine scale sets. NICs that are associated with individual - * virtual machines cannot reference an inbound NAT pool. They have to - * reference individual inbound NAT rules. - * @property {array} [outboundRules] The outbound rules. - * @property {string} [resourceGuid] The resource GUID property of the load - * balancer resource. - * @property {string} [provisioningState] Gets the provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of LoadBalancer - * - * @returns {object} metadata of LoadBalancer - * - */ - mapper() { - return { - required: false, - serializedName: 'LoadBalancer', - type: { - name: 'Composite', - className: 'LoadBalancer', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - sku: { - required: false, - serializedName: 'sku', - type: { - name: 'Composite', - className: 'LoadBalancerSku' - } - }, - frontendIPConfigurations: { - required: false, - serializedName: 'properties.frontendIPConfigurations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'FrontendIPConfigurationElementType', - type: { - name: 'Composite', - className: 'FrontendIPConfiguration' - } - } - } - }, - backendAddressPools: { - required: false, - serializedName: 'properties.backendAddressPools', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'BackendAddressPoolElementType', - type: { - name: 'Composite', - className: 'BackendAddressPool' - } - } - } - }, - loadBalancingRules: { - required: false, - serializedName: 'properties.loadBalancingRules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'LoadBalancingRuleElementType', - type: { - name: 'Composite', - className: 'LoadBalancingRule' - } - } - } - }, - probes: { - required: false, - serializedName: 'properties.probes', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ProbeElementType', - type: { - name: 'Composite', - className: 'Probe' - } - } - } - }, - inboundNatRules: { - required: false, - serializedName: 'properties.inboundNatRules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'InboundNatRuleElementType', - type: { - name: 'Composite', - className: 'InboundNatRule' - } - } - } - }, - inboundNatPools: { - required: false, - serializedName: 'properties.inboundNatPools', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'InboundNatPoolElementType', - type: { - name: 'Composite', - className: 'InboundNatPool' - } - } - } - }, - outboundRules: { - required: false, - serializedName: 'properties.outboundRules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'OutboundRuleElementType', - type: { - name: 'Composite', - className: 'OutboundRule' - } - } - } - }, - resourceGuid: { - required: false, - serializedName: 'properties.resourceGuid', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = LoadBalancer; diff --git a/lib/services/networkManagement2/lib/models/loadBalancerBackendAddressPoolListResult.js b/lib/services/networkManagement2/lib/models/loadBalancerBackendAddressPoolListResult.js deleted file mode 100644 index 85fd12fb5..000000000 --- a/lib/services/networkManagement2/lib/models/loadBalancerBackendAddressPoolListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 ListBackendAddressPool API service call. - */ -class LoadBalancerBackendAddressPoolListResult extends Array { - /** - * Create a LoadBalancerBackendAddressPoolListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of LoadBalancerBackendAddressPoolListResult - * - * @returns {object} metadata of LoadBalancerBackendAddressPoolListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'LoadBalancerBackendAddressPoolListResult', - type: { - name: 'Composite', - className: 'LoadBalancerBackendAddressPoolListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'BackendAddressPoolElementType', - type: { - name: 'Composite', - className: 'BackendAddressPool' - } - } - } - }, - nextLink: { - required: false, - readOnly: true, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = LoadBalancerBackendAddressPoolListResult; diff --git a/lib/services/networkManagement2/lib/models/loadBalancerFrontendIPConfigurationListResult.js b/lib/services/networkManagement2/lib/models/loadBalancerFrontendIPConfigurationListResult.js deleted file mode 100644 index c54d05338..000000000 --- a/lib/services/networkManagement2/lib/models/loadBalancerFrontendIPConfigurationListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 ListFrontendIPConfiguration API service call. - */ -class LoadBalancerFrontendIPConfigurationListResult extends Array { - /** - * Create a LoadBalancerFrontendIPConfigurationListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of LoadBalancerFrontendIPConfigurationListResult - * - * @returns {object} metadata of LoadBalancerFrontendIPConfigurationListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'LoadBalancerFrontendIPConfigurationListResult', - type: { - name: 'Composite', - className: 'LoadBalancerFrontendIPConfigurationListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'FrontendIPConfigurationElementType', - type: { - name: 'Composite', - className: 'FrontendIPConfiguration' - } - } - } - }, - nextLink: { - required: false, - readOnly: true, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = LoadBalancerFrontendIPConfigurationListResult; diff --git a/lib/services/networkManagement2/lib/models/loadBalancerListResult.js b/lib/services/networkManagement2/lib/models/loadBalancerListResult.js deleted file mode 100644 index 74571c16c..000000000 --- a/lib/services/networkManagement2/lib/models/loadBalancerListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 ListLoadBalancers API service call. - */ -class LoadBalancerListResult extends Array { - /** - * Create a LoadBalancerListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of LoadBalancerListResult - * - * @returns {object} metadata of LoadBalancerListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'LoadBalancerListResult', - type: { - name: 'Composite', - className: 'LoadBalancerListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'LoadBalancerElementType', - type: { - name: 'Composite', - className: 'LoadBalancer' - } - } - } - }, - nextLink: { - required: false, - readOnly: true, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = LoadBalancerListResult; diff --git a/lib/services/networkManagement2/lib/models/loadBalancerLoadBalancingRuleListResult.js b/lib/services/networkManagement2/lib/models/loadBalancerLoadBalancingRuleListResult.js deleted file mode 100644 index 72de287b5..000000000 --- a/lib/services/networkManagement2/lib/models/loadBalancerLoadBalancingRuleListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 ListLoadBalancingRule API service call. - */ -class LoadBalancerLoadBalancingRuleListResult extends Array { - /** - * Create a LoadBalancerLoadBalancingRuleListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of LoadBalancerLoadBalancingRuleListResult - * - * @returns {object} metadata of LoadBalancerLoadBalancingRuleListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'LoadBalancerLoadBalancingRuleListResult', - type: { - name: 'Composite', - className: 'LoadBalancerLoadBalancingRuleListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'LoadBalancingRuleElementType', - type: { - name: 'Composite', - className: 'LoadBalancingRule' - } - } - } - }, - nextLink: { - required: false, - readOnly: true, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = LoadBalancerLoadBalancingRuleListResult; diff --git a/lib/services/networkManagement2/lib/models/loadBalancerOutboundRuleListResult.js b/lib/services/networkManagement2/lib/models/loadBalancerOutboundRuleListResult.js deleted file mode 100644 index a609dd45c..000000000 --- a/lib/services/networkManagement2/lib/models/loadBalancerOutboundRuleListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 ListOutboundRule API service call. - */ -class LoadBalancerOutboundRuleListResult extends Array { - /** - * Create a LoadBalancerOutboundRuleListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of LoadBalancerOutboundRuleListResult - * - * @returns {object} metadata of LoadBalancerOutboundRuleListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'LoadBalancerOutboundRuleListResult', - type: { - name: 'Composite', - className: 'LoadBalancerOutboundRuleListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'OutboundRuleElementType', - type: { - name: 'Composite', - className: 'OutboundRule' - } - } - } - }, - nextLink: { - required: false, - readOnly: true, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = LoadBalancerOutboundRuleListResult; diff --git a/lib/services/networkManagement2/lib/models/loadBalancerProbeListResult.js b/lib/services/networkManagement2/lib/models/loadBalancerProbeListResult.js deleted file mode 100644 index a699792ba..000000000 --- a/lib/services/networkManagement2/lib/models/loadBalancerProbeListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 ListProbe API service call. - */ -class LoadBalancerProbeListResult extends Array { - /** - * Create a LoadBalancerProbeListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of LoadBalancerProbeListResult - * - * @returns {object} metadata of LoadBalancerProbeListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'LoadBalancerProbeListResult', - type: { - name: 'Composite', - className: 'LoadBalancerProbeListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ProbeElementType', - type: { - name: 'Composite', - className: 'Probe' - } - } - } - }, - nextLink: { - required: false, - readOnly: true, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = LoadBalancerProbeListResult; diff --git a/lib/services/networkManagement2/lib/models/loadBalancerSku.js b/lib/services/networkManagement2/lib/models/loadBalancerSku.js deleted file mode 100644 index 6f8157992..000000000 --- a/lib/services/networkManagement2/lib/models/loadBalancerSku.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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'; - -/** - * SKU of a load balancer - * - */ -class LoadBalancerSku { - /** - * Create a LoadBalancerSku. - * @property {string} [name] Name of a load balancer SKU. Possible values - * include: 'Basic', 'Standard' - */ - constructor() { - } - - /** - * Defines the metadata of LoadBalancerSku - * - * @returns {object} metadata of LoadBalancerSku - * - */ - mapper() { - return { - required: false, - serializedName: 'LoadBalancerSku', - type: { - name: 'Composite', - className: 'LoadBalancerSku', - modelProperties: { - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = LoadBalancerSku; diff --git a/lib/services/networkManagement2/lib/models/loadBalancingRule.js b/lib/services/networkManagement2/lib/models/loadBalancingRule.js deleted file mode 100644 index 5b6f1b769..000000000 --- a/lib/services/networkManagement2/lib/models/loadBalancingRule.js +++ /dev/null @@ -1,198 +0,0 @@ -/* - * 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'); - -/** - * A load balancing rule for a load balancer. - * - * @extends models['SubResource'] - */ -class LoadBalancingRule extends models['SubResource'] { - /** - * Create a LoadBalancingRule. - * @property {object} [frontendIPConfiguration] A reference to frontend IP - * addresses. - * @property {string} [frontendIPConfiguration.id] Resource ID. - * @property {object} [backendAddressPool] A reference to a pool of DIPs. - * Inbound traffic is randomly load balanced across IPs in the backend IPs. - * @property {string} [backendAddressPool.id] Resource ID. - * @property {object} [probe] The reference of the load balancer probe used - * by the load balancing rule. - * @property {string} [probe.id] Resource ID. - * @property {string} protocol Possible values include: 'Udp', 'Tcp', 'All' - * @property {string} [loadDistribution] The load distribution policy for - * this rule. Possible values are 'Default', 'SourceIP', and - * 'SourceIPProtocol'. Possible values include: 'Default', 'SourceIP', - * 'SourceIPProtocol' - * @property {number} frontendPort The port for the external endpoint. Port - * numbers for each rule must be unique within the Load Balancer. Acceptable - * values are between 0 and 65534. Note that value 0 enables "Any Port" - * @property {number} [backendPort] The port used for internal connections on - * the endpoint. Acceptable values are between 0 and 65535. Note that value 0 - * enables "Any Port" - * @property {number} [idleTimeoutInMinutes] The timeout for the TCP idle - * connection. The value can be set between 4 and 30 minutes. The default - * value is 4 minutes. This element is only used when the protocol is set to - * TCP. - * @property {boolean} [enableFloatingIP] Configures a virtual machine's - * endpoint for the floating IP capability required to configure a SQL - * AlwaysOn Availability Group. This setting is required when using the SQL - * AlwaysOn Availability Groups in SQL server. This setting can't be changed - * after you create the endpoint. - * @property {boolean} [enableTcpReset] Receive bidirectional TCP Reset on - * TCP flow idle timeout or unexpected connection termination. This element - * is only used when the protocol is set to TCP. - * @property {boolean} [disableOutboundSnat] Configures SNAT for the VMs in - * the backend pool to use the publicIP address specified in the frontend of - * the load balancing rule. - * @property {string} [provisioningState] Gets the provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [name] The 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 LoadBalancingRule - * - * @returns {object} metadata of LoadBalancingRule - * - */ - mapper() { - return { - required: false, - serializedName: 'LoadBalancingRule', - type: { - name: 'Composite', - className: 'LoadBalancingRule', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - frontendIPConfiguration: { - required: false, - serializedName: 'properties.frontendIPConfiguration', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - backendAddressPool: { - required: false, - serializedName: 'properties.backendAddressPool', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - probe: { - required: false, - serializedName: 'properties.probe', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - protocol: { - required: true, - serializedName: 'properties.protocol', - type: { - name: 'String' - } - }, - loadDistribution: { - required: false, - serializedName: 'properties.loadDistribution', - type: { - name: 'String' - } - }, - frontendPort: { - required: true, - serializedName: 'properties.frontendPort', - type: { - name: 'Number' - } - }, - backendPort: { - required: false, - serializedName: 'properties.backendPort', - type: { - name: 'Number' - } - }, - idleTimeoutInMinutes: { - required: false, - serializedName: 'properties.idleTimeoutInMinutes', - type: { - name: 'Number' - } - }, - enableFloatingIP: { - required: false, - serializedName: 'properties.enableFloatingIP', - type: { - name: 'Boolean' - } - }, - enableTcpReset: { - required: false, - serializedName: 'properties.enableTcpReset', - type: { - name: 'Boolean' - } - }, - disableOutboundSnat: { - required: false, - serializedName: 'properties.disableOutboundSnat', - type: { - name: 'Boolean' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = LoadBalancingRule; diff --git a/lib/services/networkManagement2/lib/models/localNetworkGateway.js b/lib/services/networkManagement2/lib/models/localNetworkGateway.js deleted file mode 100644 index 17746a185..000000000 --- a/lib/services/networkManagement2/lib/models/localNetworkGateway.js +++ /dev/null @@ -1,156 +0,0 @@ -/* - * 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'); - -/** - * A common class for general resource information - * - * @extends models['Resource'] - */ -class LocalNetworkGateway extends models['Resource'] { - /** - * Create a LocalNetworkGateway. - * @property {object} [localNetworkAddressSpace] Local network site address - * space. - * @property {array} [localNetworkAddressSpace.addressPrefixes] A list of - * address blocks reserved for this virtual network in CIDR notation. - * @property {string} [gatewayIpAddress] IP address of local network gateway. - * @property {object} [bgpSettings] Local network gateway's BGP speaker - * settings. - * @property {number} [bgpSettings.asn] The BGP speaker's ASN. - * @property {string} [bgpSettings.bgpPeeringAddress] The BGP peering address - * and BGP identifier of this BGP speaker. - * @property {number} [bgpSettings.peerWeight] The weight added to routes - * learned from this BGP speaker. - * @property {string} [resourceGuid] The resource GUID property of the - * LocalNetworkGateway resource. - * @property {string} [provisioningState] The provisioning state of the - * LocalNetworkGateway resource. Possible values are: 'Updating', 'Deleting', - * and 'Failed'. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of LocalNetworkGateway - * - * @returns {object} metadata of LocalNetworkGateway - * - */ - mapper() { - return { - required: false, - serializedName: 'LocalNetworkGateway', - type: { - name: 'Composite', - className: 'LocalNetworkGateway', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - localNetworkAddressSpace: { - required: false, - serializedName: 'properties.localNetworkAddressSpace', - type: { - name: 'Composite', - className: 'AddressSpace' - } - }, - gatewayIpAddress: { - required: false, - serializedName: 'properties.gatewayIpAddress', - type: { - name: 'String' - } - }, - bgpSettings: { - required: false, - serializedName: 'properties.bgpSettings', - type: { - name: 'Composite', - className: 'BgpSettings' - } - }, - resourceGuid: { - required: false, - serializedName: 'properties.resourceGuid', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = LocalNetworkGateway; diff --git a/lib/services/networkManagement2/lib/models/localNetworkGatewayListResult.js b/lib/services/networkManagement2/lib/models/localNetworkGatewayListResult.js deleted file mode 100644 index d7aa91afd..000000000 --- a/lib/services/networkManagement2/lib/models/localNetworkGatewayListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 ListLocalNetworkGateways API service call. - */ -class LocalNetworkGatewayListResult extends Array { - /** - * Create a LocalNetworkGatewayListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of LocalNetworkGatewayListResult - * - * @returns {object} metadata of LocalNetworkGatewayListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'LocalNetworkGatewayListResult', - type: { - name: 'Composite', - className: 'LocalNetworkGatewayListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'LocalNetworkGatewayElementType', - type: { - name: 'Composite', - className: 'LocalNetworkGateway' - } - } - } - }, - nextLink: { - required: false, - readOnly: true, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = LocalNetworkGatewayListResult; diff --git a/lib/services/networkManagement2/lib/models/logSpecification.js b/lib/services/networkManagement2/lib/models/logSpecification.js deleted file mode 100644 index 56344441e..000000000 --- a/lib/services/networkManagement2/lib/models/logSpecification.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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'; - -/** - * Description of logging specification. - * - */ -class LogSpecification { - /** - * Create a LogSpecification. - * @property {string} [name] The name of the specification. - * @property {string} [displayName] The display name of the specification. - * @property {string} [blobDuration] Duration of the blob. - */ - constructor() { - } - - /** - * Defines the metadata of LogSpecification - * - * @returns {object} metadata of LogSpecification - * - */ - mapper() { - return { - required: false, - serializedName: 'LogSpecification', - type: { - name: 'Composite', - className: 'LogSpecification', - modelProperties: { - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - displayName: { - required: false, - serializedName: 'displayName', - type: { - name: 'String' - } - }, - blobDuration: { - required: false, - serializedName: 'blobDuration', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = LogSpecification; diff --git a/lib/services/networkManagement2/lib/models/managedServiceIdentity.js b/lib/services/networkManagement2/lib/models/managedServiceIdentity.js deleted file mode 100644 index fa402858b..000000000 --- a/lib/services/networkManagement2/lib/models/managedServiceIdentity.js +++ /dev/null @@ -1,98 +0,0 @@ -/* - * 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'; - -/** - * Identity for the resource. - * - */ -class ManagedServiceIdentity { - /** - * Create a ManagedServiceIdentity. - * @property {string} [principalId] The principal id of the system assigned - * identity. This property will only be provided for a system assigned - * identity. - * @property {string} [tenantId] The tenant id of the system assigned - * identity. This property will only be provided for a system assigned - * identity. - * @property {string} [type] The type of identity used for the resource. The - * type 'SystemAssigned, UserAssigned' includes both an implicitly created - * identity and a set of user assigned identities. The type 'None' will - * remove any identities from the virtual machine. Possible values include: - * 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' - * @property {object} [userAssignedIdentities] The list of user identities - * associated with resource. The user identity dictionary key references will - * be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - */ - constructor() { - } - - /** - * Defines the metadata of ManagedServiceIdentity - * - * @returns {object} metadata of ManagedServiceIdentity - * - */ - mapper() { - return { - required: false, - serializedName: 'ManagedServiceIdentity', - type: { - name: 'Composite', - className: 'ManagedServiceIdentity', - modelProperties: { - principalId: { - required: false, - readOnly: true, - serializedName: 'principalId', - type: { - name: 'String' - } - }, - tenantId: { - required: false, - readOnly: true, - serializedName: 'tenantId', - type: { - name: 'String' - } - }, - type: { - required: false, - serializedName: 'type', - type: { - name: 'Enum', - allowedValues: [ 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' ] - } - }, - userAssignedIdentities: { - required: false, - serializedName: 'userAssignedIdentities', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'ManagedServiceIdentityUserAssignedIdentitiesValueElementType', - type: { - name: 'Composite', - className: 'ManagedServiceIdentityUserAssignedIdentitiesValue' - } - } - } - } - } - } - }; - } -} - -module.exports = ManagedServiceIdentity; diff --git a/lib/services/networkManagement2/lib/models/managedServiceIdentityUserAssignedIdentitiesValue.js b/lib/services/networkManagement2/lib/models/managedServiceIdentityUserAssignedIdentitiesValue.js deleted file mode 100644 index 8f6531620..000000000 --- a/lib/services/networkManagement2/lib/models/managedServiceIdentityUserAssignedIdentitiesValue.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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'; - -/** - * Class representing a ManagedServiceIdentityUserAssignedIdentitiesValue. - */ -class ManagedServiceIdentityUserAssignedIdentitiesValue { - /** - * Create a ManagedServiceIdentityUserAssignedIdentitiesValue. - * @property {string} [principalId] The principal id of user assigned - * identity. - * @property {string} [clientId] The client id of user assigned identity. - */ - constructor() { - } - - /** - * Defines the metadata of ManagedServiceIdentityUserAssignedIdentitiesValue - * - * @returns {object} metadata of ManagedServiceIdentityUserAssignedIdentitiesValue - * - */ - mapper() { - return { - required: false, - serializedName: 'ManagedServiceIdentity_userAssignedIdentitiesValue', - type: { - name: 'Composite', - className: 'ManagedServiceIdentityUserAssignedIdentitiesValue', - modelProperties: { - principalId: { - required: false, - readOnly: true, - serializedName: 'principalId', - type: { - name: 'String' - } - }, - clientId: { - required: false, - readOnly: true, - serializedName: 'clientId', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ManagedServiceIdentityUserAssignedIdentitiesValue; diff --git a/lib/services/networkManagement2/lib/models/matchedRule.js b/lib/services/networkManagement2/lib/models/matchedRule.js deleted file mode 100644 index a137af717..000000000 --- a/lib/services/networkManagement2/lib/models/matchedRule.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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'; - -/** - * Matched rule. - * - */ -class MatchedRule { - /** - * Create a MatchedRule. - * @property {string} [ruleName] Name of the matched network security rule. - * @property {string} [action] The network traffic is allowed or denied. - * Possible values are 'Allow' and 'Deny'. - */ - constructor() { - } - - /** - * Defines the metadata of MatchedRule - * - * @returns {object} metadata of MatchedRule - * - */ - mapper() { - return { - required: false, - serializedName: 'MatchedRule', - type: { - name: 'Composite', - className: 'MatchedRule', - modelProperties: { - ruleName: { - required: false, - serializedName: 'ruleName', - type: { - name: 'String' - } - }, - action: { - required: false, - serializedName: 'action', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = MatchedRule; diff --git a/lib/services/networkManagement2/lib/models/metricSpecification.js b/lib/services/networkManagement2/lib/models/metricSpecification.js deleted file mode 100644 index 1b41458ef..000000000 --- a/lib/services/networkManagement2/lib/models/metricSpecification.js +++ /dev/null @@ -1,176 +0,0 @@ -/* - * 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'; - -/** - * Description of metrics specification. - * - */ -class MetricSpecification { - /** - * Create a MetricSpecification. - * @property {string} [name] The name of the metric. - * @property {string} [displayName] The display name of the metric. - * @property {string} [displayDescription] The description of the metric. - * @property {string} [unit] Units the metric to be displayed in. - * @property {string} [aggregationType] The aggregation type. - * @property {array} [availabilities] List of availability. - * @property {boolean} [enableRegionalMdmAccount] Whether regional MDM - * account enabled. - * @property {boolean} [fillGapWithZero] Whether gaps would be filled with - * zeros. - * @property {string} [metricFilterPattern] Pattern for the filter of the - * metric. - * @property {array} [dimensions] List of dimensions. - * @property {boolean} [isInternal] Whether the metric is internal. - * @property {string} [sourceMdmAccount] The source MDM account. - * @property {string} [sourceMdmNamespace] The source MDM namespace. - * @property {string} [resourceIdDimensionNameOverride] The resource Id - * dimension name override. - */ - constructor() { - } - - /** - * Defines the metadata of MetricSpecification - * - * @returns {object} metadata of MetricSpecification - * - */ - mapper() { - return { - required: false, - serializedName: 'MetricSpecification', - type: { - name: 'Composite', - className: 'MetricSpecification', - modelProperties: { - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - displayName: { - required: false, - serializedName: 'displayName', - type: { - name: 'String' - } - }, - displayDescription: { - required: false, - serializedName: 'displayDescription', - type: { - name: 'String' - } - }, - unit: { - required: false, - serializedName: 'unit', - type: { - name: 'String' - } - }, - aggregationType: { - required: false, - serializedName: 'aggregationType', - type: { - name: 'String' - } - }, - availabilities: { - required: false, - serializedName: 'availabilities', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'AvailabilityElementType', - type: { - name: 'Composite', - className: 'Availability' - } - } - } - }, - enableRegionalMdmAccount: { - required: false, - serializedName: 'enableRegionalMdmAccount', - type: { - name: 'Boolean' - } - }, - fillGapWithZero: { - required: false, - serializedName: 'fillGapWithZero', - type: { - name: 'Boolean' - } - }, - metricFilterPattern: { - required: false, - serializedName: 'metricFilterPattern', - type: { - name: 'String' - } - }, - dimensions: { - required: false, - serializedName: 'dimensions', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'DimensionElementType', - type: { - name: 'Composite', - className: 'Dimension' - } - } - } - }, - isInternal: { - required: false, - serializedName: 'isInternal', - type: { - name: 'Boolean' - } - }, - sourceMdmAccount: { - required: false, - serializedName: 'sourceMdmAccount', - type: { - name: 'String' - } - }, - sourceMdmNamespace: { - required: false, - serializedName: 'sourceMdmNamespace', - type: { - name: 'String' - } - }, - resourceIdDimensionNameOverride: { - required: false, - serializedName: 'resourceIdDimensionNameOverride', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = MetricSpecification; diff --git a/lib/services/networkManagement2/lib/models/networkConfigurationDiagnosticParameters.js b/lib/services/networkManagement2/lib/models/networkConfigurationDiagnosticParameters.js deleted file mode 100644 index fc90a15cd..000000000 --- a/lib/services/networkManagement2/lib/models/networkConfigurationDiagnosticParameters.js +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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'; - -/** - * Parameters to get network configuration diagnostic. - * - */ -class NetworkConfigurationDiagnosticParameters { - /** - * Create a NetworkConfigurationDiagnosticParameters. - * @property {string} targetResourceId The ID of the target resource to - * perform network configuration diagnostic. Valid options are VM, - * NetworkInterface, VMSS/NetworkInterface and Application Gateway. - * @property {string} [verbosityLevel] Verbosity level. Accepted values are - * 'Normal', 'Minimum', 'Full'. Possible values include: 'Normal', 'Minimum', - * 'Full' - * @property {array} profiles List of network configuration diagnostic - * profiles. - */ - constructor() { - } - - /** - * Defines the metadata of NetworkConfigurationDiagnosticParameters - * - * @returns {object} metadata of NetworkConfigurationDiagnosticParameters - * - */ - mapper() { - return { - required: false, - serializedName: 'NetworkConfigurationDiagnosticParameters', - type: { - name: 'Composite', - className: 'NetworkConfigurationDiagnosticParameters', - modelProperties: { - targetResourceId: { - required: true, - serializedName: 'targetResourceId', - type: { - name: 'String' - } - }, - verbosityLevel: { - required: false, - serializedName: 'verbosityLevel', - type: { - name: 'String' - } - }, - profiles: { - required: true, - serializedName: 'profiles', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'NetworkConfigurationDiagnosticProfileElementType', - type: { - name: 'Composite', - className: 'NetworkConfigurationDiagnosticProfile' - } - } - } - } - } - } - }; - } -} - -module.exports = NetworkConfigurationDiagnosticParameters; diff --git a/lib/services/networkManagement2/lib/models/networkConfigurationDiagnosticProfile.js b/lib/services/networkManagement2/lib/models/networkConfigurationDiagnosticProfile.js deleted file mode 100644 index 18b0e42a7..000000000 --- a/lib/services/networkManagement2/lib/models/networkConfigurationDiagnosticProfile.js +++ /dev/null @@ -1,91 +0,0 @@ -/* - * 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'; - -/** - * Parameters to compare with network configuration. - * - */ -class NetworkConfigurationDiagnosticProfile { - /** - * Create a NetworkConfigurationDiagnosticProfile. - * @property {string} direction The direction of the traffic. Accepted values - * are 'Inbound' and 'Outbound'. Possible values include: 'Inbound', - * 'Outbound' - * @property {string} protocol Protocol to be verified on. Accepted values - * are '*', TCP, UDP. - * @property {string} source Traffic source. Accepted values are '*', IP - * Address/CIDR, Service Tag. - * @property {string} destination Traffic destination. Accepted values are: - * '*', IP Address/CIDR, Service Tag. - * @property {string} destinationPort Traffice destination port. Accepted - * values are '*', port (for example, 3389) and port range (for example, - * 80-100). - */ - constructor() { - } - - /** - * Defines the metadata of NetworkConfigurationDiagnosticProfile - * - * @returns {object} metadata of NetworkConfigurationDiagnosticProfile - * - */ - mapper() { - return { - required: false, - serializedName: 'NetworkConfigurationDiagnosticProfile', - type: { - name: 'Composite', - className: 'NetworkConfigurationDiagnosticProfile', - modelProperties: { - direction: { - required: true, - serializedName: 'direction', - type: { - name: 'String' - } - }, - protocol: { - required: true, - serializedName: 'protocol', - type: { - name: 'String' - } - }, - source: { - required: true, - serializedName: 'source', - type: { - name: 'String' - } - }, - destination: { - required: true, - serializedName: 'destination', - type: { - name: 'String' - } - }, - destinationPort: { - required: true, - serializedName: 'destinationPort', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = NetworkConfigurationDiagnosticProfile; diff --git a/lib/services/networkManagement2/lib/models/networkConfigurationDiagnosticResponse.js b/lib/services/networkManagement2/lib/models/networkConfigurationDiagnosticResponse.js deleted file mode 100644 index ef54a102f..000000000 --- a/lib/services/networkManagement2/lib/models/networkConfigurationDiagnosticResponse.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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'; - -/** - * Results of network configuration diagnostic on the target resource. - * - */ -class NetworkConfigurationDiagnosticResponse { - /** - * Create a NetworkConfigurationDiagnosticResponse. - * @property {array} [results] List of network configuration diagnostic - * results. - */ - constructor() { - } - - /** - * Defines the metadata of NetworkConfigurationDiagnosticResponse - * - * @returns {object} metadata of NetworkConfigurationDiagnosticResponse - * - */ - mapper() { - return { - required: false, - serializedName: 'NetworkConfigurationDiagnosticResponse', - type: { - name: 'Composite', - className: 'NetworkConfigurationDiagnosticResponse', - modelProperties: { - results: { - required: false, - readOnly: true, - serializedName: 'results', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'NetworkConfigurationDiagnosticResultElementType', - type: { - name: 'Composite', - className: 'NetworkConfigurationDiagnosticResult' - } - } - } - } - } - } - }; - } -} - -module.exports = NetworkConfigurationDiagnosticResponse; diff --git a/lib/services/networkManagement2/lib/models/networkConfigurationDiagnosticResult.js b/lib/services/networkManagement2/lib/models/networkConfigurationDiagnosticResult.js deleted file mode 100644 index 0f92eccff..000000000 --- a/lib/services/networkManagement2/lib/models/networkConfigurationDiagnosticResult.js +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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'; - -/** - * Network configuration diagnostic result corresponded to provided traffic - * query. - * - */ -class NetworkConfigurationDiagnosticResult { - /** - * Create a NetworkConfigurationDiagnosticResult. - * @property {object} [profile] - * @property {string} [profile.direction] The direction of the traffic. - * Accepted values are 'Inbound' and 'Outbound'. Possible values include: - * 'Inbound', 'Outbound' - * @property {string} [profile.protocol] Protocol to be verified on. Accepted - * values are '*', TCP, UDP. - * @property {string} [profile.source] Traffic source. Accepted values are - * '*', IP Address/CIDR, Service Tag. - * @property {string} [profile.destination] Traffic destination. Accepted - * values are: '*', IP Address/CIDR, Service Tag. - * @property {string} [profile.destinationPort] Traffice destination port. - * Accepted values are '*', port (for example, 3389) and port range (for - * example, 80-100). - * @property {object} [networkSecurityGroupResult] - * @property {string} [networkSecurityGroupResult.securityRuleAccessResult] - * The network traffic is allowed or denied. Possible values are 'Allow' and - * 'Deny'. Possible values include: 'Allow', 'Deny' - * @property {array} - * [networkSecurityGroupResult.evaluatedNetworkSecurityGroups] List of - * results network security groups diagnostic. - */ - constructor() { - } - - /** - * Defines the metadata of NetworkConfigurationDiagnosticResult - * - * @returns {object} metadata of NetworkConfigurationDiagnosticResult - * - */ - mapper() { - return { - required: false, - serializedName: 'NetworkConfigurationDiagnosticResult', - type: { - name: 'Composite', - className: 'NetworkConfigurationDiagnosticResult', - modelProperties: { - profile: { - required: false, - serializedName: 'profile', - type: { - name: 'Composite', - className: 'NetworkConfigurationDiagnosticProfile' - } - }, - networkSecurityGroupResult: { - required: false, - serializedName: 'networkSecurityGroupResult', - type: { - name: 'Composite', - className: 'NetworkSecurityGroupResult' - } - } - } - } - }; - } -} - -module.exports = NetworkConfigurationDiagnosticResult; diff --git a/lib/services/networkManagement2/lib/models/networkInterface.js b/lib/services/networkManagement2/lib/models/networkInterface.js deleted file mode 100644 index 69b084a3f..000000000 --- a/lib/services/networkManagement2/lib/models/networkInterface.js +++ /dev/null @@ -1,365 +0,0 @@ -/* - * 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'); - -/** - * A network interface in a resource group. - * - * @extends models['Resource'] - */ -class NetworkInterface extends models['Resource'] { - /** - * Create a NetworkInterface. - * @property {object} [virtualMachine] The reference of a virtual machine. - * @property {string} [virtualMachine.id] Resource ID. - * @property {object} [networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * @property {array} [networkSecurityGroup.securityRules] A collection of - * security rules of the network security group. - * @property {array} [networkSecurityGroup.defaultSecurityRules] The default - * security rules of network security group. - * @property {array} [networkSecurityGroup.networkInterfaces] A collection of - * references to network interfaces. - * @property {array} [networkSecurityGroup.subnets] A collection of - * references to subnets. - * @property {string} [networkSecurityGroup.resourceGuid] The resource GUID - * property of the network security group resource. - * @property {string} [networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [networkSecurityGroup.etag] A unique read-only string - * that changes whenever the resource is updated. - * @property {object} [interfaceEndpoint] A reference to the interface - * endpoint to which the network interface is linked. - * @property {string} [interfaceEndpoint.fqdn] A first-party service's FQDN - * that is mapped to the private IP allocated via this interface endpoint. - * @property {object} [interfaceEndpoint.endpointService] A reference to the - * service being brought into the virtual network. - * @property {string} [interfaceEndpoint.endpointService.id] A unique - * identifier of the service being referenced by the interface endpoint. - * @property {object} [interfaceEndpoint.subnet] The ID of the subnet from - * which the private IP will be allocated. - * @property {string} [interfaceEndpoint.subnet.addressPrefix] The address - * prefix for the subnet. - * @property {array} [interfaceEndpoint.subnet.addressPrefixes] List of - * address prefixes for the subnet. - * @property {object} [interfaceEndpoint.subnet.networkSecurityGroup] The - * reference of the NetworkSecurityGroup resource. - * @property {array} - * [interfaceEndpoint.subnet.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * @property {array} - * [interfaceEndpoint.subnet.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * @property {array} - * [interfaceEndpoint.subnet.networkSecurityGroup.networkInterfaces] A - * collection of references to network interfaces. - * @property {array} [interfaceEndpoint.subnet.networkSecurityGroup.subnets] - * A collection of references to subnets. - * @property {string} - * [interfaceEndpoint.subnet.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. - * @property {string} - * [interfaceEndpoint.subnet.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [interfaceEndpoint.subnet.networkSecurityGroup.etag] A - * unique read-only string that changes whenever the resource is updated. - * @property {object} [interfaceEndpoint.subnet.routeTable] The reference of - * the RouteTable resource. - * @property {array} [interfaceEndpoint.subnet.routeTable.routes] Collection - * of routes contained within a route table. - * @property {array} [interfaceEndpoint.subnet.routeTable.subnets] A - * collection of references to subnets. - * @property {boolean} - * [interfaceEndpoint.subnet.routeTable.disableBgpRoutePropagation] Gets or - * sets whether to disable the routes learned by BGP on that route table. - * True means disable. - * @property {string} [interfaceEndpoint.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [interfaceEndpoint.subnet.routeTable.etag] Gets a - * unique read-only string that changes whenever the resource is updated. - * @property {array} [interfaceEndpoint.subnet.serviceEndpoints] An array of - * service endpoints. - * @property {array} [interfaceEndpoint.subnet.serviceEndpointPolicies] An - * array of service endpoint policies. - * @property {array} [interfaceEndpoint.subnet.interfaceEndpoints] An array - * of references to interface endpoints - * @property {array} [interfaceEndpoint.subnet.ipConfigurations] Gets an - * array of references to the network interface IP configurations using - * subnet. - * @property {array} [interfaceEndpoint.subnet.ipConfigurationProfiles] Array - * of IP configuration profiles which reference this subnet. - * @property {array} [interfaceEndpoint.subnet.resourceNavigationLinks] Gets - * an array of references to the external resources using subnet. - * @property {array} [interfaceEndpoint.subnet.serviceAssociationLinks] Gets - * an array of references to services injecting into this subnet. - * @property {array} [interfaceEndpoint.subnet.delegations] Gets an array of - * references to the delegations on the subnet. - * @property {string} [interfaceEndpoint.subnet.purpose] A read-only string - * identifying the intention of use for this subnet based on delegations and - * other user-defined properties. - * @property {string} [interfaceEndpoint.subnet.provisioningState] The - * provisioning state of the resource. - * @property {string} [interfaceEndpoint.subnet.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * @property {string} [interfaceEndpoint.subnet.etag] A unique read-only - * string that changes whenever the resource is updated. - * @property {array} [interfaceEndpoint.networkInterfaces] Gets an array of - * references to the network interfaces created for this interface endpoint. - * @property {string} [interfaceEndpoint.owner] A read-only property that - * identifies who created this interface endpoint. - * @property {string} [interfaceEndpoint.provisioningState] The provisioning - * state of the interface endpoint. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [interfaceEndpoint.etag] Gets a unique read-only string - * that changes whenever the resource is updated. - * @property {array} [ipConfigurations] A list of IPConfigurations of the - * network interface. - * @property {array} [tapConfigurations] A list of TapConfigurations of the - * network interface. - * @property {object} [dnsSettings] The DNS settings in network interface. - * @property {array} [dnsSettings.dnsServers] List of DNS servers IP - * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS - * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it - * must be the only value in dnsServers collection. - * @property {array} [dnsSettings.appliedDnsServers] If the VM that uses this - * NIC is part of an Availability Set, then this list will have the union of - * all DNS servers from all NICs that are part of the Availability Set. This - * property is what is configured on each of those VMs. - * @property {string} [dnsSettings.internalDnsNameLabel] Relative DNS name - * for this NIC used for internal communications between VMs in the same - * virtual network. - * @property {string} [dnsSettings.internalFqdn] Fully qualified DNS name - * supporting internal communications between VMs in the same virtual - * network. - * @property {string} [dnsSettings.internalDomainNameSuffix] Even if - * internalDnsNameLabel is not specified, a DNS entry is created for the - * primary NIC of the VM. This DNS name can be constructed by concatenating - * the VM name with the value of internalDomainNameSuffix. - * @property {string} [macAddress] The MAC address of the network interface. - * @property {boolean} [primary] Gets whether this is a primary network - * interface on a virtual machine. - * @property {boolean} [enableAcceleratedNetworking] If the network interface - * is accelerated networking enabled. - * @property {boolean} [enableIPForwarding] Indicates whether IP forwarding - * is enabled on this network interface. - * @property {array} [hostedWorkloads] A list of references to linked - * BareMetal resources - * @property {string} [resourceGuid] The resource GUID property of the - * network interface resource. - * @property {string} [provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of NetworkInterface - * - * @returns {object} metadata of NetworkInterface - * - */ - mapper() { - return { - required: false, - serializedName: 'NetworkInterface', - type: { - name: 'Composite', - className: 'NetworkInterface', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - virtualMachine: { - required: false, - readOnly: true, - serializedName: 'properties.virtualMachine', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - networkSecurityGroup: { - required: false, - serializedName: 'properties.networkSecurityGroup', - type: { - name: 'Composite', - className: 'NetworkSecurityGroup' - } - }, - interfaceEndpoint: { - required: false, - readOnly: true, - serializedName: 'properties.interfaceEndpoint', - type: { - name: 'Composite', - className: 'InterfaceEndpoint' - } - }, - ipConfigurations: { - required: false, - serializedName: 'properties.ipConfigurations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'NetworkInterfaceIPConfigurationElementType', - type: { - name: 'Composite', - className: 'NetworkInterfaceIPConfiguration' - } - } - } - }, - tapConfigurations: { - required: false, - serializedName: 'properties.tapConfigurations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'NetworkInterfaceTapConfigurationElementType', - type: { - name: 'Composite', - className: 'NetworkInterfaceTapConfiguration' - } - } - } - }, - dnsSettings: { - required: false, - serializedName: 'properties.dnsSettings', - type: { - name: 'Composite', - className: 'NetworkInterfaceDnsSettings' - } - }, - macAddress: { - required: false, - serializedName: 'properties.macAddress', - type: { - name: 'String' - } - }, - primary: { - required: false, - serializedName: 'properties.primary', - type: { - name: 'Boolean' - } - }, - enableAcceleratedNetworking: { - required: false, - serializedName: 'properties.enableAcceleratedNetworking', - type: { - name: 'Boolean' - } - }, - enableIPForwarding: { - required: false, - serializedName: 'properties.enableIPForwarding', - type: { - name: 'Boolean' - } - }, - hostedWorkloads: { - required: false, - readOnly: true, - serializedName: 'properties.hostedWorkloads', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - resourceGuid: { - required: false, - serializedName: 'properties.resourceGuid', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = NetworkInterface; diff --git a/lib/services/networkManagement2/lib/models/networkInterfaceAssociation.js b/lib/services/networkManagement2/lib/models/networkInterfaceAssociation.js deleted file mode 100644 index 34a8f127b..000000000 --- a/lib/services/networkManagement2/lib/models/networkInterfaceAssociation.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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'; - -/** - * Network interface and its custom security rules. - * - */ -class NetworkInterfaceAssociation { - /** - * Create a NetworkInterfaceAssociation. - * @property {string} [id] Network interface ID. - * @property {array} [securityRules] Collection of custom security rules. - */ - constructor() { - } - - /** - * Defines the metadata of NetworkInterfaceAssociation - * - * @returns {object} metadata of NetworkInterfaceAssociation - * - */ - mapper() { - return { - required: false, - serializedName: 'NetworkInterfaceAssociation', - type: { - name: 'Composite', - className: 'NetworkInterfaceAssociation', - modelProperties: { - id: { - required: false, - readOnly: true, - serializedName: 'id', - type: { - name: 'String' - } - }, - securityRules: { - required: false, - serializedName: 'securityRules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SecurityRuleElementType', - type: { - name: 'Composite', - className: 'SecurityRule' - } - } - } - } - } - } - }; - } -} - -module.exports = NetworkInterfaceAssociation; diff --git a/lib/services/networkManagement2/lib/models/networkInterfaceDnsSettings.js b/lib/services/networkManagement2/lib/models/networkInterfaceDnsSettings.js deleted file mode 100644 index adf9050c5..000000000 --- a/lib/services/networkManagement2/lib/models/networkInterfaceDnsSettings.js +++ /dev/null @@ -1,109 +0,0 @@ -/* - * 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'; - -/** - * DNS settings of a network interface. - * - */ -class NetworkInterfaceDnsSettings { - /** - * Create a NetworkInterfaceDnsSettings. - * @property {array} [dnsServers] List of DNS servers IP addresses. Use - * 'AzureProvidedDNS' to switch to azure provided DNS resolution. - * 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the - * only value in dnsServers collection. - * @property {array} [appliedDnsServers] If the VM that uses this NIC is part - * of an Availability Set, then this list will have the union of all DNS - * servers from all NICs that are part of the Availability Set. This property - * is what is configured on each of those VMs. - * @property {string} [internalDnsNameLabel] Relative DNS name for this NIC - * used for internal communications between VMs in the same virtual network. - * @property {string} [internalFqdn] Fully qualified DNS name supporting - * internal communications between VMs in the same virtual network. - * @property {string} [internalDomainNameSuffix] Even if internalDnsNameLabel - * is not specified, a DNS entry is created for the primary NIC of the VM. - * This DNS name can be constructed by concatenating the VM name with the - * value of internalDomainNameSuffix. - */ - constructor() { - } - - /** - * Defines the metadata of NetworkInterfaceDnsSettings - * - * @returns {object} metadata of NetworkInterfaceDnsSettings - * - */ - mapper() { - return { - required: false, - serializedName: 'NetworkInterfaceDnsSettings', - type: { - name: 'Composite', - className: 'NetworkInterfaceDnsSettings', - modelProperties: { - dnsServers: { - required: false, - serializedName: 'dnsServers', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - appliedDnsServers: { - required: false, - serializedName: 'appliedDnsServers', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - internalDnsNameLabel: { - required: false, - serializedName: 'internalDnsNameLabel', - type: { - name: 'String' - } - }, - internalFqdn: { - required: false, - serializedName: 'internalFqdn', - type: { - name: 'String' - } - }, - internalDomainNameSuffix: { - required: false, - serializedName: 'internalDomainNameSuffix', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = NetworkInterfaceDnsSettings; diff --git a/lib/services/networkManagement2/lib/models/networkInterfaceIPConfiguration.js b/lib/services/networkManagement2/lib/models/networkInterfaceIPConfiguration.js deleted file mode 100644 index bc754a7e9..000000000 --- a/lib/services/networkManagement2/lib/models/networkInterfaceIPConfiguration.js +++ /dev/null @@ -1,431 +0,0 @@ -/* - * 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'); - -/** - * IPConfiguration in a network interface. - * - * @extends models['SubResource'] - */ -class NetworkInterfaceIPConfiguration extends models['SubResource'] { - /** - * Create a NetworkInterfaceIPConfiguration. - * @property {array} [virtualNetworkTaps] The reference to Virtual Network - * Taps. - * @property {array} [applicationGatewayBackendAddressPools] The reference of - * ApplicationGatewayBackendAddressPool resource. - * @property {array} [loadBalancerBackendAddressPools] The reference of - * LoadBalancerBackendAddressPool resource. - * @property {array} [loadBalancerInboundNatRules] A list of references of - * LoadBalancerInboundNatRules. - * @property {string} [privateIPAddress] Private IP address of the IP - * configuration. - * @property {string} [privateIPAllocationMethod] Defines how a private IP - * address is assigned. Possible values are: 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' - * @property {string} [privateIPAddressVersion] Available from Api-Version - * 2016-03-30 onwards, it represents whether the specific ipconfiguration is - * IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and - * 'IPv6'. Possible values include: 'IPv4', 'IPv6' - * @property {object} [subnet] Subnet bound to the IP configuration. - * @property {string} [subnet.addressPrefix] The address prefix for the - * subnet. - * @property {array} [subnet.addressPrefixes] List of address prefixes for - * the subnet. - * @property {object} [subnet.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * @property {array} [subnet.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * @property {array} [subnet.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * @property {array} [subnet.networkSecurityGroup.networkInterfaces] A - * collection of references to network interfaces. - * @property {array} [subnet.networkSecurityGroup.subnets] A collection of - * references to subnets. - * @property {string} [subnet.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. - * @property {string} [subnet.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [subnet.networkSecurityGroup.etag] A unique read-only - * string that changes whenever the resource is updated. - * @property {object} [subnet.routeTable] The reference of the RouteTable - * resource. - * @property {array} [subnet.routeTable.routes] Collection of routes - * contained within a route table. - * @property {array} [subnet.routeTable.subnets] A collection of references - * to subnets. - * @property {boolean} [subnet.routeTable.disableBgpRoutePropagation] Gets or - * sets whether to disable the routes learned by BGP on that route table. - * True means disable. - * @property {string} [subnet.routeTable.provisioningState] The provisioning - * state of the resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [subnet.routeTable.etag] Gets a unique read-only string - * that changes whenever the resource is updated. - * @property {array} [subnet.serviceEndpoints] An array of service endpoints. - * @property {array} [subnet.serviceEndpointPolicies] An array of service - * endpoint policies. - * @property {array} [subnet.interfaceEndpoints] An array of references to - * interface endpoints - * @property {array} [subnet.ipConfigurations] Gets an array of references to - * the network interface IP configurations using subnet. - * @property {array} [subnet.ipConfigurationProfiles] Array of IP - * configuration profiles which reference this subnet. - * @property {array} [subnet.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * @property {array} [subnet.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * @property {array} [subnet.delegations] Gets an array of references to the - * delegations on the subnet. - * @property {string} [subnet.purpose] A read-only string identifying the - * intention of use for this subnet based on delegations and other - * user-defined properties. - * @property {string} [subnet.provisioningState] The provisioning state of - * the resource. - * @property {string} [subnet.name] The name of the resource that is unique - * within a resource group. This name can be used to access the resource. - * @property {string} [subnet.etag] A unique read-only string that changes - * whenever the resource is updated. - * @property {boolean} [primary] Gets whether this is a primary customer - * address on the network interface. - * @property {object} [publicIPAddress] Public IP address bound to the IP - * configuration. - * @property {object} [publicIPAddress.sku] The public IP address SKU. - * @property {string} [publicIPAddress.sku.name] Name of a public IP address - * SKU. Possible values include: 'Basic', 'Standard' - * @property {string} [publicIPAddress.publicIPAllocationMethod] The public - * IP allocation method. Possible values are: 'Static' and 'Dynamic'. - * Possible values include: 'Static', 'Dynamic' - * @property {string} [publicIPAddress.publicIPAddressVersion] The public IP - * address version. Possible values are: 'IPv4' and 'IPv6'. Possible values - * include: 'IPv4', 'IPv6' - * @property {object} [publicIPAddress.ipConfiguration] The IP configuration - * associated with the public IP address. - * @property {string} [publicIPAddress.ipConfiguration.privateIPAddress] The - * private IP address of the IP configuration. - * @property {string} - * [publicIPAddress.ipConfiguration.privateIPAllocationMethod] The private IP - * allocation method. Possible values are 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' - * @property {object} [publicIPAddress.ipConfiguration.subnet] The reference - * of the subnet resource. - * @property {string} [publicIPAddress.ipConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * @property {array} [publicIPAddress.ipConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * @property {object} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup] The - * reference of the NetworkSecurityGroup resource. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] - * A collection of references to network interfaces. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.subnets] A - * collection of references to subnets. - * @property {string} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * @property {string} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.etag] A - * unique read-only string that changes whenever the resource is updated. - * @property {object} [publicIPAddress.ipConfiguration.subnet.routeTable] The - * reference of the RouteTable resource. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.routeTable.routes] Collection of - * routes contained within a route table. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.routeTable.subnets] A collection - * of references to subnets. - * @property {boolean} - * [publicIPAddress.ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * @property {string} - * [publicIPAddress.ipConfiguration.subnet.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} - * [publicIPAddress.ipConfiguration.subnet.routeTable.etag] Gets a unique - * read-only string that changes whenever the resource is updated. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.serviceEndpoints] An array of - * service endpoints. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.serviceEndpointPolicies] An array - * of service endpoint policies. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.interfaceEndpoints] An array of - * references to interface endpoints - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.ipConfigurations] Gets an array of - * references to the network interface IP configurations using subnet. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.ipConfigurationProfiles] Array of - * IP configuration profiles which reference this subnet. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.resourceNavigationLinks] Gets an - * array of references to the external resources using subnet. - * @property {array} - * [publicIPAddress.ipConfiguration.subnet.serviceAssociationLinks] Gets an - * array of references to services injecting into this subnet. - * @property {array} [publicIPAddress.ipConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * @property {string} [publicIPAddress.ipConfiguration.subnet.purpose] A - * read-only string identifying the intention of use for this subnet based on - * delegations and other user-defined properties. - * @property {string} - * [publicIPAddress.ipConfiguration.subnet.provisioningState] The - * provisioning state of the resource. - * @property {string} [publicIPAddress.ipConfiguration.subnet.name] The name - * of the resource that is unique within a resource group. This name can be - * used to access the resource. - * @property {string} [publicIPAddress.ipConfiguration.subnet.etag] A unique - * read-only string that changes whenever the resource is updated. - * @property {object} [publicIPAddress.ipConfiguration.publicIPAddress] The - * reference of the public IP resource. - * @property {string} [publicIPAddress.ipConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [publicIPAddress.ipConfiguration.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * @property {string} [publicIPAddress.ipConfiguration.etag] A unique - * read-only string that changes whenever the resource is updated. - * @property {object} [publicIPAddress.dnsSettings] The FQDN of the DNS - * record associated with the public IP address. - * @property {string} [publicIPAddress.dnsSettings.domainNameLabel] Gets or - * sets the Domain name label.The concatenation of the domain name label and - * the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is - * specified, an A DNS record is created for the public IP in the Microsoft - * Azure DNS system. - * @property {string} [publicIPAddress.dnsSettings.fqdn] Gets the FQDN, Fully - * qualified domain name of the A DNS record associated with the public IP. - * This is the concatenation of the domainNameLabel and the regionalized DNS - * zone. - * @property {string} [publicIPAddress.dnsSettings.reverseFqdn] Gets or Sets - * the Reverse FQDN. A user-visible, fully qualified domain name that - * resolves to this public IP address. If the reverseFqdn is specified, then - * a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * @property {array} [publicIPAddress.ipTags] The list of tags associated - * with the public IP address. - * @property {string} [publicIPAddress.ipAddress] The IP address associated - * with the public IP address resource. - * @property {object} [publicIPAddress.publicIPPrefix] The Public IP Prefix - * this Public IP Address should be allocated from. - * @property {string} [publicIPAddress.publicIPPrefix.id] Resource ID. - * @property {number} [publicIPAddress.idleTimeoutInMinutes] The idle timeout - * of the public IP address. - * @property {string} [publicIPAddress.resourceGuid] The resource GUID - * property of the public IP resource. - * @property {string} [publicIPAddress.provisioningState] The provisioning - * state of the PublicIP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [publicIPAddress.etag] A unique read-only string that - * changes whenever the resource is updated. - * @property {array} [publicIPAddress.zones] A list of availability zones - * denoting the IP allocated for the resource needs to come from. - * @property {array} [applicationSecurityGroups] Application security groups - * in which the IP configuration is included. - * @property {string} [provisioningState] The provisioning state of the - * network interface IP configuration. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [name] The 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 NetworkInterfaceIPConfiguration - * - * @returns {object} metadata of NetworkInterfaceIPConfiguration - * - */ - mapper() { - return { - required: false, - serializedName: 'NetworkInterfaceIPConfiguration', - type: { - name: 'Composite', - className: 'NetworkInterfaceIPConfiguration', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - virtualNetworkTaps: { - required: false, - serializedName: 'properties.virtualNetworkTaps', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'VirtualNetworkTapElementType', - type: { - name: 'Composite', - className: 'VirtualNetworkTap' - } - } - } - }, - applicationGatewayBackendAddressPools: { - required: false, - serializedName: 'properties.applicationGatewayBackendAddressPools', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationGatewayBackendAddressPoolElementType', - type: { - name: 'Composite', - className: 'ApplicationGatewayBackendAddressPool' - } - } - } - }, - loadBalancerBackendAddressPools: { - required: false, - serializedName: 'properties.loadBalancerBackendAddressPools', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'BackendAddressPoolElementType', - type: { - name: 'Composite', - className: 'BackendAddressPool' - } - } - } - }, - loadBalancerInboundNatRules: { - required: false, - serializedName: 'properties.loadBalancerInboundNatRules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'InboundNatRuleElementType', - type: { - name: 'Composite', - className: 'InboundNatRule' - } - } - } - }, - privateIPAddress: { - required: false, - serializedName: 'properties.privateIPAddress', - type: { - name: 'String' - } - }, - privateIPAllocationMethod: { - required: false, - serializedName: 'properties.privateIPAllocationMethod', - type: { - name: 'String' - } - }, - privateIPAddressVersion: { - required: false, - serializedName: 'properties.privateIPAddressVersion', - type: { - name: 'String' - } - }, - subnet: { - required: false, - serializedName: 'properties.subnet', - type: { - name: 'Composite', - className: 'Subnet' - } - }, - primary: { - required: false, - serializedName: 'properties.primary', - type: { - name: 'Boolean' - } - }, - publicIPAddress: { - required: false, - serializedName: 'properties.publicIPAddress', - type: { - name: 'Composite', - className: 'PublicIPAddress' - } - }, - applicationSecurityGroups: { - required: false, - serializedName: 'properties.applicationSecurityGroups', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationSecurityGroupElementType', - type: { - name: 'Composite', - className: 'ApplicationSecurityGroup' - } - } - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = NetworkInterfaceIPConfiguration; diff --git a/lib/services/networkManagement2/lib/models/networkInterfaceIPConfigurationListResult.js b/lib/services/networkManagement2/lib/models/networkInterfaceIPConfigurationListResult.js deleted file mode 100644 index 6af163112..000000000 --- a/lib/services/networkManagement2/lib/models/networkInterfaceIPConfigurationListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 list ip configurations API service call. - */ -class NetworkInterfaceIPConfigurationListResult extends Array { - /** - * Create a NetworkInterfaceIPConfigurationListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of NetworkInterfaceIPConfigurationListResult - * - * @returns {object} metadata of NetworkInterfaceIPConfigurationListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'NetworkInterfaceIPConfigurationListResult', - type: { - name: 'Composite', - className: 'NetworkInterfaceIPConfigurationListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'NetworkInterfaceIPConfigurationElementType', - type: { - name: 'Composite', - className: 'NetworkInterfaceIPConfiguration' - } - } - } - }, - nextLink: { - required: false, - readOnly: true, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = NetworkInterfaceIPConfigurationListResult; diff --git a/lib/services/networkManagement2/lib/models/networkInterfaceListResult.js b/lib/services/networkManagement2/lib/models/networkInterfaceListResult.js deleted file mode 100644 index c2a4895e9..000000000 --- a/lib/services/networkManagement2/lib/models/networkInterfaceListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 the ListNetworkInterface API service call. - */ -class NetworkInterfaceListResult extends Array { - /** - * Create a NetworkInterfaceListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of NetworkInterfaceListResult - * - * @returns {object} metadata of NetworkInterfaceListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'NetworkInterfaceListResult', - type: { - name: 'Composite', - className: 'NetworkInterfaceListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'NetworkInterfaceElementType', - type: { - name: 'Composite', - className: 'NetworkInterface' - } - } - } - }, - nextLink: { - required: false, - readOnly: true, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = NetworkInterfaceListResult; diff --git a/lib/services/networkManagement2/lib/models/networkInterfaceLoadBalancerListResult.js b/lib/services/networkManagement2/lib/models/networkInterfaceLoadBalancerListResult.js deleted file mode 100644 index 6df02f387..000000000 --- a/lib/services/networkManagement2/lib/models/networkInterfaceLoadBalancerListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 list ip configurations API service call. - */ -class NetworkInterfaceLoadBalancerListResult extends Array { - /** - * Create a NetworkInterfaceLoadBalancerListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of NetworkInterfaceLoadBalancerListResult - * - * @returns {object} metadata of NetworkInterfaceLoadBalancerListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'NetworkInterfaceLoadBalancerListResult', - type: { - name: 'Composite', - className: 'NetworkInterfaceLoadBalancerListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'LoadBalancerElementType', - type: { - name: 'Composite', - className: 'LoadBalancer' - } - } - } - }, - nextLink: { - required: false, - readOnly: true, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = NetworkInterfaceLoadBalancerListResult; diff --git a/lib/services/networkManagement2/lib/models/networkInterfaceTapConfiguration.js b/lib/services/networkManagement2/lib/models/networkInterfaceTapConfiguration.js deleted file mode 100644 index d79d64dcf..000000000 --- a/lib/services/networkManagement2/lib/models/networkInterfaceTapConfiguration.js +++ /dev/null @@ -1,765 +0,0 @@ -/* - * 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'); - -/** - * Tap configuration in a Network Interface - * - * @extends models['SubResource'] - */ -class NetworkInterfaceTapConfiguration extends models['SubResource'] { - /** - * Create a NetworkInterfaceTapConfiguration. - * @property {object} [virtualNetworkTap] The reference of the Virtual - * Network Tap resource. - * @property {array} [virtualNetworkTap.networkInterfaceTapConfigurations] - * Specifies the list of resource IDs for the network interface IP - * configuration that needs to be tapped. - * @property {string} [virtualNetworkTap.resourceGuid] The resourceGuid - * property of the virtual network tap. - * @property {string} [virtualNetworkTap.provisioningState] The provisioning - * state of the virtual network tap. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {object} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration] The - * reference to the private IP Address of the collector nic that will receive - * the tap - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.virtualNetworkTaps] - * The reference to Virtual Network Taps. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.applicationGatewayBackendAddressPools] - * The reference of ApplicationGatewayBackendAddressPool resource. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.loadBalancerBackendAddressPools] - * The reference of LoadBalancerBackendAddressPool resource. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.loadBalancerInboundNatRules] - * A list of references of LoadBalancerInboundNatRules. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAddress] - * Private IP address of the IP configuration. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAllocationMethod] - * Defines how a private IP address is assigned. Possible values are: - * 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAddressVersion] - * Available from Api-Version 2016-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * @property {object} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet] - * Subnet bound to the IP configuration. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * @property {object} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.networkInterfaces] - * A collection of references to network interfaces. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.subnets] - * A collection of references to subnets. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.routeTable.subnets] - * A collection of references to subnets. - * @property {boolean} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.interfaceEndpoints] - * An array of references to interface endpoints - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.ipConfigurations] - * Gets an array of references to the network interface IP configurations - * using subnet. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.ipConfigurationProfiles] - * Array of IP configuration profiles which reference this subnet. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.purpose] - * A read-only string identifying the intention of use for this subnet based - * on delegations and other user-defined properties. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {boolean} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.primary] - * Gets whether this is a primary customer address on the network interface. - * @property {object} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress] - * Public IP address bound to the IP configuration. - * @property {object} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.sku] - * The public IP address SKU. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.sku.name] - * Name of a public IP address SKU. Possible values include: 'Basic', - * 'Standard' - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * @property {object} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration] - * The IP configuration associated with the public IP address. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.privateIPAllocationMethod] - * The private IP allocation method. Possible values are 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {object} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet] - * The reference of the subnet resource. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * @property {object} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] - * A collection of references to network interfaces. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.subnets] - * A collection of references to subnets. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.subnets] - * A collection of references to subnets. - * @property {boolean} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.interfaceEndpoints] - * An array of references to interface endpoints - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurations] - * Gets an array of references to the network interface IP configurations - * using subnet. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurationProfiles] - * Array of IP configuration profiles which reference this subnet. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.purpose] - * A read-only string identifying the intention of use for this subnet based - * on delegations and other user-defined properties. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.publicIPAddress] - * The reference of the public IP resource. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain - * name associated with the public IP address. If a domain name label is - * specified, an A DNS record is created for the public IP in the Microsoft - * Azure DNS system. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and - * the regionalized DNS zone. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipTags] - * The list of tags associated with the public IP address. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipAddress] - * The IP address associated with the public IP address resource. - * @property {object} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.publicIPPrefix.id] - * Resource ID. - * @property {number} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * @property {array} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.applicationSecurityGroups] - * Application security groups in which the IP configuration is included. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.provisioningState] - * The provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.name] The - * name of the resource that is unique within a resource group. This name can - * be used to access the resource. - * @property {string} - * [virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.etag] A - * unique read-only string that changes whenever the resource is updated. - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration] The - * reference to the private IP address on the internal Load Balancer that - * will receive the tap - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.inboundNatRules] - * Read only. Inbound rules URIs that use this frontend IP. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.inboundNatPools] - * Read only. Inbound pools URIs that use this frontend IP. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.outboundRules] - * Read only. Outbound rules URIs that use this frontend IP. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.loadBalancingRules] - * Gets load balancing rules URIs that use this frontend IP. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.privateIPAllocationMethod] - * The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet] - * The reference of the subnet resource. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.networkInterfaces] - * A collection of references to network interfaces. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.subnets] - * A collection of references to subnets. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.subnets] - * A collection of references to subnets. - * @property {boolean} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.interfaceEndpoints] - * An array of references to interface endpoints - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.ipConfigurations] - * Gets an array of references to the network interface IP configurations - * using subnet. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.ipConfigurationProfiles] - * Array of IP configuration profiles which reference this subnet. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.purpose] - * A read-only string identifying the intention of use for this subnet based - * on delegations and other user-defined properties. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress] - * The reference of the Public IP resource. - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku] - * The public IP address SKU. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku.name] - * Name of a public IP address SKU. Possible values include: 'Basic', - * 'Standard' - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration] - * The IP configuration associated with the public IP address. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.privateIPAllocationMethod] - * The private IP allocation method. Possible values are 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet] - * The reference of the subnet resource. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] - * A collection of references to network interfaces. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.subnets] - * A collection of references to subnets. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.subnets] - * A collection of references to subnets. - * @property {boolean} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.interfaceEndpoints] - * An array of references to interface endpoints - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurations] - * Gets an array of references to the network interface IP configurations - * using subnet. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurationProfiles] - * Array of IP configuration profiles which reference this subnet. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.purpose] - * A read-only string identifying the intention of use for this subnet based - * on delegations and other user-defined properties. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.publicIPAddress] - * The reference of the public IP resource. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain - * name associated with the public IP address. If a domain name label is - * specified, an A DNS record is created for the public IP in the Microsoft - * Azure DNS system. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and - * the regionalized DNS zone. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipTags] - * The list of tags associated with the public IP address. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipAddress] - * The IP address associated with the public IP address resource. - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix.id] - * Resource ID. - * @property {number} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * @property {object} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix] - * The reference of the Public IP Prefix resource. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix.id] - * Resource ID. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * @property {string} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.etag] A - * unique read-only string that changes whenever the resource is updated. - * @property {array} - * [virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.zones] A - * list of availability zones denoting the IP allocated for the resource - * needs to come from. - * @property {number} [virtualNetworkTap.destinationPort] The VXLAN - * destination port that will receive the tapped traffic. - * @property {string} [virtualNetworkTap.etag] Gets a unique read-only string - * that changes whenever the resource is updated. - * @property {string} [provisioningState] The provisioning state of the - * network interface tap configuration. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [name] The 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. - * @property {string} [type] Sub Resource type. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of NetworkInterfaceTapConfiguration - * - * @returns {object} metadata of NetworkInterfaceTapConfiguration - * - */ - mapper() { - return { - required: false, - serializedName: 'NetworkInterfaceTapConfiguration', - type: { - name: 'Composite', - className: 'NetworkInterfaceTapConfiguration', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - virtualNetworkTap: { - required: false, - serializedName: 'properties.virtualNetworkTap', - type: { - name: 'Composite', - className: 'VirtualNetworkTap' - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = NetworkInterfaceTapConfiguration; diff --git a/lib/services/networkManagement2/lib/models/networkInterfaceTapConfigurationListResult.js b/lib/services/networkManagement2/lib/models/networkInterfaceTapConfigurationListResult.js deleted file mode 100644 index 65b62ed33..000000000 --- a/lib/services/networkManagement2/lib/models/networkInterfaceTapConfigurationListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 list tap configurations API service call. - */ -class NetworkInterfaceTapConfigurationListResult extends Array { - /** - * Create a NetworkInterfaceTapConfigurationListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of NetworkInterfaceTapConfigurationListResult - * - * @returns {object} metadata of NetworkInterfaceTapConfigurationListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'NetworkInterfaceTapConfigurationListResult', - type: { - name: 'Composite', - className: 'NetworkInterfaceTapConfigurationListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'NetworkInterfaceTapConfigurationElementType', - type: { - name: 'Composite', - className: 'NetworkInterfaceTapConfiguration' - } - } - } - }, - nextLink: { - required: false, - readOnly: true, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = NetworkInterfaceTapConfigurationListResult; diff --git a/lib/services/networkManagement2/lib/models/networkProfile.js b/lib/services/networkManagement2/lib/models/networkProfile.js deleted file mode 100644 index 7d5ed3108..000000000 --- a/lib/services/networkManagement2/lib/models/networkProfile.js +++ /dev/null @@ -1,155 +0,0 @@ -/* - * 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'); - -/** - * Network profile resource. - * - * @extends models['Resource'] - */ -class NetworkProfile extends models['Resource'] { - /** - * Create a NetworkProfile. - * @property {array} [containerNetworkInterfaces] List of child container - * network interfaces. - * @property {array} [containerNetworkInterfaceConfigurations] List of chid - * container network interface configurations. - * @property {string} [resourceGuid] The resource GUID property of the - * network interface resource. - * @property {string} [provisioningState] The provisioning state of the - * resource. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of NetworkProfile - * - * @returns {object} metadata of NetworkProfile - * - */ - mapper() { - return { - required: false, - serializedName: 'NetworkProfile', - type: { - name: 'Composite', - className: 'NetworkProfile', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - containerNetworkInterfaces: { - required: false, - serializedName: 'properties.containerNetworkInterfaces', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ContainerNetworkInterfaceElementType', - type: { - name: 'Composite', - className: 'ContainerNetworkInterface' - } - } - } - }, - containerNetworkInterfaceConfigurations: { - required: false, - serializedName: 'properties.containerNetworkInterfaceConfigurations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ContainerNetworkInterfaceConfigurationElementType', - type: { - name: 'Composite', - className: 'ContainerNetworkInterfaceConfiguration' - } - } - } - }, - resourceGuid: { - required: false, - readOnly: true, - serializedName: 'properties.resourceGuid', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = NetworkProfile; diff --git a/lib/services/networkManagement2/lib/models/networkProfileListResult.js b/lib/services/networkManagement2/lib/models/networkProfileListResult.js deleted file mode 100644 index 0ce54d6ee..000000000 --- a/lib/services/networkManagement2/lib/models/networkProfileListResult.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 ListNetworkProfiles API service call. - */ -class NetworkProfileListResult extends Array { - /** - * Create a NetworkProfileListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of NetworkProfileListResult - * - * @returns {object} metadata of NetworkProfileListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'NetworkProfileListResult', - type: { - name: 'Composite', - className: 'NetworkProfileListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'NetworkProfileElementType', - type: { - name: 'Composite', - className: 'NetworkProfile' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = NetworkProfileListResult; diff --git a/lib/services/networkManagement2/lib/models/networkSecurityGroup.js b/lib/services/networkManagement2/lib/models/networkSecurityGroup.js deleted file mode 100644 index f0ffa4844..000000000 --- a/lib/services/networkManagement2/lib/models/networkSecurityGroup.js +++ /dev/null @@ -1,189 +0,0 @@ -/* - * 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'); - -/** - * NetworkSecurityGroup resource. - * - * @extends models['Resource'] - */ -class NetworkSecurityGroup extends models['Resource'] { - /** - * Create a NetworkSecurityGroup. - * @property {array} [securityRules] A collection of security rules of the - * network security group. - * @property {array} [defaultSecurityRules] The default security rules of - * network security group. - * @property {array} [networkInterfaces] A collection of references to - * network interfaces. - * @property {array} [subnets] A collection of references to subnets. - * @property {string} [resourceGuid] The resource GUID property of the - * network security group resource. - * @property {string} [provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of NetworkSecurityGroup - * - * @returns {object} metadata of NetworkSecurityGroup - * - */ - mapper() { - return { - required: false, - serializedName: 'NetworkSecurityGroup', - type: { - name: 'Composite', - className: 'NetworkSecurityGroup', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - securityRules: { - required: false, - serializedName: 'properties.securityRules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SecurityRuleElementType', - type: { - name: 'Composite', - className: 'SecurityRule' - } - } - } - }, - defaultSecurityRules: { - required: false, - serializedName: 'properties.defaultSecurityRules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SecurityRuleElementType', - type: { - name: 'Composite', - className: 'SecurityRule' - } - } - } - }, - networkInterfaces: { - required: false, - readOnly: true, - serializedName: 'properties.networkInterfaces', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'NetworkInterfaceElementType', - type: { - name: 'Composite', - className: 'NetworkInterface' - } - } - } - }, - subnets: { - required: false, - readOnly: true, - serializedName: 'properties.subnets', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SubnetElementType', - type: { - name: 'Composite', - className: 'Subnet' - } - } - } - }, - resourceGuid: { - required: false, - serializedName: 'properties.resourceGuid', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = NetworkSecurityGroup; diff --git a/lib/services/networkManagement2/lib/models/networkSecurityGroupListResult.js b/lib/services/networkManagement2/lib/models/networkSecurityGroupListResult.js deleted file mode 100644 index 884344e23..000000000 --- a/lib/services/networkManagement2/lib/models/networkSecurityGroupListResult.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 ListNetworkSecurityGroups API service call. - */ -class NetworkSecurityGroupListResult extends Array { - /** - * Create a NetworkSecurityGroupListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of NetworkSecurityGroupListResult - * - * @returns {object} metadata of NetworkSecurityGroupListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'NetworkSecurityGroupListResult', - type: { - name: 'Composite', - className: 'NetworkSecurityGroupListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'NetworkSecurityGroupElementType', - type: { - name: 'Composite', - className: 'NetworkSecurityGroup' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = NetworkSecurityGroupListResult; diff --git a/lib/services/networkManagement2/lib/models/networkSecurityGroupResult.js b/lib/services/networkManagement2/lib/models/networkSecurityGroupResult.js deleted file mode 100644 index e5cdf9018..000000000 --- a/lib/services/networkManagement2/lib/models/networkSecurityGroupResult.js +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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'; - -/** - * Network configuration diagnostic result corresponded provided traffic query. - * - */ -class NetworkSecurityGroupResult { - /** - * Create a NetworkSecurityGroupResult. - * @property {string} [securityRuleAccessResult] The network traffic is - * allowed or denied. Possible values are 'Allow' and 'Deny'. Possible values - * include: 'Allow', 'Deny' - * @property {array} [evaluatedNetworkSecurityGroups] List of results network - * security groups diagnostic. - */ - constructor() { - } - - /** - * Defines the metadata of NetworkSecurityGroupResult - * - * @returns {object} metadata of NetworkSecurityGroupResult - * - */ - mapper() { - return { - required: false, - serializedName: 'NetworkSecurityGroupResult', - type: { - name: 'Composite', - className: 'NetworkSecurityGroupResult', - modelProperties: { - securityRuleAccessResult: { - required: false, - serializedName: 'securityRuleAccessResult', - type: { - name: 'String' - } - }, - evaluatedNetworkSecurityGroups: { - required: false, - readOnly: true, - serializedName: 'evaluatedNetworkSecurityGroups', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'EvaluatedNetworkSecurityGroupElementType', - type: { - name: 'Composite', - className: 'EvaluatedNetworkSecurityGroup' - } - } - } - } - } - } - }; - } -} - -module.exports = NetworkSecurityGroupResult; diff --git a/lib/services/networkManagement2/lib/models/networkSecurityRulesEvaluationResult.js b/lib/services/networkManagement2/lib/models/networkSecurityRulesEvaluationResult.js deleted file mode 100644 index 9dd0326cb..000000000 --- a/lib/services/networkManagement2/lib/models/networkSecurityRulesEvaluationResult.js +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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'; - -/** - * Network security rules evaluation result. - * - */ -class NetworkSecurityRulesEvaluationResult { - /** - * Create a NetworkSecurityRulesEvaluationResult. - * @property {string} [name] Name of the network security rule. - * @property {boolean} [protocolMatched] Value indicating whether protocol is - * matched. - * @property {boolean} [sourceMatched] Value indicating whether source is - * matched. - * @property {boolean} [sourcePortMatched] Value indicating whether source - * port is matched. - * @property {boolean} [destinationMatched] Value indicating whether - * destination is matched. - * @property {boolean} [destinationPortMatched] Value indicating whether - * destination port is matched. - */ - constructor() { - } - - /** - * Defines the metadata of NetworkSecurityRulesEvaluationResult - * - * @returns {object} metadata of NetworkSecurityRulesEvaluationResult - * - */ - mapper() { - return { - required: false, - serializedName: 'NetworkSecurityRulesEvaluationResult', - type: { - name: 'Composite', - className: 'NetworkSecurityRulesEvaluationResult', - modelProperties: { - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - protocolMatched: { - required: false, - serializedName: 'protocolMatched', - type: { - name: 'Boolean' - } - }, - sourceMatched: { - required: false, - serializedName: 'sourceMatched', - type: { - name: 'Boolean' - } - }, - sourcePortMatched: { - required: false, - serializedName: 'sourcePortMatched', - type: { - name: 'Boolean' - } - }, - destinationMatched: { - required: false, - serializedName: 'destinationMatched', - type: { - name: 'Boolean' - } - }, - destinationPortMatched: { - required: false, - serializedName: 'destinationPortMatched', - type: { - name: 'Boolean' - } - } - } - } - }; - } -} - -module.exports = NetworkSecurityRulesEvaluationResult; diff --git a/lib/services/networkManagement2/lib/models/networkWatcher.js b/lib/services/networkManagement2/lib/models/networkWatcher.js deleted file mode 100644 index b8b5c4d30..000000000 --- a/lib/services/networkManagement2/lib/models/networkWatcher.js +++ /dev/null @@ -1,112 +0,0 @@ -/* - * 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'); - -/** - * Network watcher in a resource group. - * - * @extends models['Resource'] - */ -class NetworkWatcher extends models['Resource'] { - /** - * Create a NetworkWatcher. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - */ - constructor() { - super(); - } - - /** - * Defines the metadata of NetworkWatcher - * - * @returns {object} metadata of NetworkWatcher - * - */ - mapper() { - return { - required: false, - serializedName: 'NetworkWatcher', - type: { - name: 'Composite', - className: 'NetworkWatcher', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = NetworkWatcher; diff --git a/lib/services/networkManagement2/lib/models/networkWatcherListResult.js b/lib/services/networkManagement2/lib/models/networkWatcherListResult.js deleted file mode 100644 index 61b6321fc..000000000 --- a/lib/services/networkManagement2/lib/models/networkWatcherListResult.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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'; - -/** - * List of network watcher resources. - */ -class NetworkWatcherListResult extends Array { - /** - * Create a NetworkWatcherListResult. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of NetworkWatcherListResult - * - * @returns {object} metadata of NetworkWatcherListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'NetworkWatcherListResult', - type: { - name: 'Composite', - className: 'NetworkWatcherListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'NetworkWatcherElementType', - type: { - name: 'Composite', - className: 'NetworkWatcher' - } - } - } - } - } - } - }; - } -} - -module.exports = NetworkWatcherListResult; diff --git a/lib/services/networkManagement2/lib/models/nextHopParameters.js b/lib/services/networkManagement2/lib/models/nextHopParameters.js deleted file mode 100644 index eb3f97567..000000000 --- a/lib/services/networkManagement2/lib/models/nextHopParameters.js +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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'; - -/** - * Parameters that define the source and destination endpoint. - * - */ -class NextHopParameters { - /** - * Create a NextHopParameters. - * @property {string} targetResourceId The resource identifier of the target - * resource against which the action is to be performed. - * @property {string} sourceIPAddress The source IP address. - * @property {string} destinationIPAddress The destination IP address. - * @property {string} [targetNicResourceId] The NIC ID. (If VM has multiple - * NICs and IP forwarding is enabled on any of the nics, then this parameter - * must be specified. Otherwise optional). - */ - constructor() { - } - - /** - * Defines the metadata of NextHopParameters - * - * @returns {object} metadata of NextHopParameters - * - */ - mapper() { - return { - required: false, - serializedName: 'NextHopParameters', - type: { - name: 'Composite', - className: 'NextHopParameters', - modelProperties: { - targetResourceId: { - required: true, - serializedName: 'targetResourceId', - type: { - name: 'String' - } - }, - sourceIPAddress: { - required: true, - serializedName: 'sourceIPAddress', - type: { - name: 'String' - } - }, - destinationIPAddress: { - required: true, - serializedName: 'destinationIPAddress', - type: { - name: 'String' - } - }, - targetNicResourceId: { - required: false, - serializedName: 'targetNicResourceId', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = NextHopParameters; diff --git a/lib/services/networkManagement2/lib/models/nextHopResult.js b/lib/services/networkManagement2/lib/models/nextHopResult.js deleted file mode 100644 index d034c5adf..000000000 --- a/lib/services/networkManagement2/lib/models/nextHopResult.js +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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'; - -/** - * The information about next hop from the specified VM. - * - */ -class NextHopResult { - /** - * Create a NextHopResult. - * @property {string} [nextHopType] Next hop type. Possible values include: - * 'Internet', 'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal', - * 'HyperNetGateway', 'None' - * @property {string} [nextHopIpAddress] Next hop IP Address - * @property {string} [routeTableId] The resource identifier for the route - * table associated with the route being returned. If the route being - * returned does not correspond to any user created routes then this field - * will be the string 'System Route'. - */ - constructor() { - } - - /** - * Defines the metadata of NextHopResult - * - * @returns {object} metadata of NextHopResult - * - */ - mapper() { - return { - required: false, - serializedName: 'NextHopResult', - type: { - name: 'Composite', - className: 'NextHopResult', - modelProperties: { - nextHopType: { - required: false, - serializedName: 'nextHopType', - type: { - name: 'String' - } - }, - nextHopIpAddress: { - required: false, - serializedName: 'nextHopIpAddress', - type: { - name: 'String' - } - }, - routeTableId: { - required: false, - serializedName: 'routeTableId', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = NextHopResult; diff --git a/lib/services/networkManagement2/lib/models/operation.js b/lib/services/networkManagement2/lib/models/operation.js deleted file mode 100644 index 6e51a230b..000000000 --- a/lib/services/networkManagement2/lib/models/operation.js +++ /dev/null @@ -1,90 +0,0 @@ -/* - * 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'; - -/** - * Network REST API operation definition. - * - */ -class Operation { - /** - * Create a Operation. - * @property {string} [name] Operation name: - * {provider}/{resource}/{operation} - * @property {object} [display] Display metadata associated with the - * operation. - * @property {string} [display.provider] Service provider: Microsoft Network. - * @property {string} [display.resource] Resource on which the operation is - * performed. - * @property {string} [display.operation] Type of the operation: get, read, - * delete, etc. - * @property {string} [display.description] Description of the operation. - * @property {string} [origin] Origin of the operation. - * @property {object} [serviceSpecification] Specification of the service. - * @property {array} [serviceSpecification.metricSpecifications] Operation - * service specification. - * @property {array} [serviceSpecification.logSpecifications] Operation log - * specification. - */ - constructor() { - } - - /** - * Defines the metadata of Operation - * - * @returns {object} metadata of Operation - * - */ - mapper() { - return { - required: false, - serializedName: 'Operation', - type: { - name: 'Composite', - className: 'Operation', - modelProperties: { - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - display: { - required: false, - serializedName: 'display', - type: { - name: 'Composite', - className: 'OperationDisplay' - } - }, - origin: { - required: false, - serializedName: 'origin', - type: { - name: 'String' - } - }, - serviceSpecification: { - required: false, - serializedName: 'properties.serviceSpecification', - type: { - name: 'Composite', - className: 'OperationPropertiesFormatServiceSpecification' - } - } - } - } - }; - } -} - -module.exports = Operation; diff --git a/lib/services/networkManagement2/lib/models/operationDisplay.js b/lib/services/networkManagement2/lib/models/operationDisplay.js deleted file mode 100644 index a2debe7e3..000000000 --- a/lib/services/networkManagement2/lib/models/operationDisplay.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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'; - -/** - * Display metadata associated with the operation. - * - */ -class OperationDisplay { - /** - * Create a OperationDisplay. - * @property {string} [provider] Service provider: Microsoft Network. - * @property {string} [resource] Resource on which the operation is - * performed. - * @property {string} [operation] Type of the operation: get, read, delete, - * etc. - * @property {string} [description] Description of the operation. - */ - constructor() { - } - - /** - * Defines the metadata of OperationDisplay - * - * @returns {object} metadata of OperationDisplay - * - */ - mapper() { - return { - required: false, - serializedName: 'Operation_display', - type: { - name: 'Composite', - className: 'OperationDisplay', - modelProperties: { - provider: { - required: false, - serializedName: 'provider', - type: { - name: 'String' - } - }, - resource: { - required: false, - serializedName: 'resource', - type: { - name: 'String' - } - }, - operation: { - required: false, - serializedName: 'operation', - type: { - name: 'String' - } - }, - description: { - required: false, - serializedName: 'description', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = OperationDisplay; diff --git a/lib/services/networkManagement2/lib/models/operationListResult.js b/lib/services/networkManagement2/lib/models/operationListResult.js deleted file mode 100644 index 3fb3ae54b..000000000 --- a/lib/services/networkManagement2/lib/models/operationListResult.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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'; - -/** - * Result of the request to list Network operations. It contains a list of - * operations and a URL link to get the next set of results. - */ -class OperationListResult extends Array { - /** - * Create a OperationListResult. - * @property {string} [nextLink] URL to get the next set of operation list - * results if there are any. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of OperationListResult - * - * @returns {object} metadata of OperationListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'OperationListResult', - type: { - name: 'Composite', - className: 'OperationListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'OperationElementType', - type: { - name: 'Composite', - className: 'Operation' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = OperationListResult; diff --git a/lib/services/networkManagement2/lib/models/operationPropertiesFormatServiceSpecification.js b/lib/services/networkManagement2/lib/models/operationPropertiesFormatServiceSpecification.js deleted file mode 100644 index 82efd248c..000000000 --- a/lib/services/networkManagement2/lib/models/operationPropertiesFormatServiceSpecification.js +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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'; - -/** - * Specification of the service. - * - */ -class OperationPropertiesFormatServiceSpecification { - /** - * Create a OperationPropertiesFormatServiceSpecification. - * @property {array} [metricSpecifications] Operation service specification. - * @property {array} [logSpecifications] Operation log specification. - */ - constructor() { - } - - /** - * Defines the metadata of OperationPropertiesFormatServiceSpecification - * - * @returns {object} metadata of OperationPropertiesFormatServiceSpecification - * - */ - mapper() { - return { - required: false, - serializedName: 'OperationPropertiesFormat_serviceSpecification', - type: { - name: 'Composite', - className: 'OperationPropertiesFormatServiceSpecification', - modelProperties: { - metricSpecifications: { - required: false, - serializedName: 'metricSpecifications', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'MetricSpecificationElementType', - type: { - name: 'Composite', - className: 'MetricSpecification' - } - } - } - }, - logSpecifications: { - required: false, - serializedName: 'logSpecifications', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'LogSpecificationElementType', - type: { - name: 'Composite', - className: 'LogSpecification' - } - } - } - } - } - } - }; - } -} - -module.exports = OperationPropertiesFormatServiceSpecification; diff --git a/lib/services/networkManagement2/lib/models/outboundRule.js b/lib/services/networkManagement2/lib/models/outboundRule.js deleted file mode 100644 index de9a6eceb..000000000 --- a/lib/services/networkManagement2/lib/models/outboundRule.js +++ /dev/null @@ -1,148 +0,0 @@ -/* - * 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'); - -/** - * Outbound pool of the load balancer. - * - * @extends models['SubResource'] - */ -class OutboundRule extends models['SubResource'] { - /** - * Create a OutboundRule. - * @property {number} [allocatedOutboundPorts] The number of outbound ports - * to be used for NAT. - * @property {array} frontendIPConfigurations The Frontend IP addresses of - * the load balancer. - * @property {object} backendAddressPool A reference to a pool of DIPs. - * Outbound traffic is randomly load balanced across IPs in the backend IPs. - * @property {string} [backendAddressPool.id] Resource ID. - * @property {string} [provisioningState] Gets the provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} protocol Protocol - TCP, UDP or All. Possible values - * include: 'Tcp', 'Udp', 'All' - * @property {boolean} [enableTcpReset] Receive bidirectional TCP Reset on - * TCP flow idle timeout or unexpected connection termination. This element - * is only used when the protocol is set to TCP. - * @property {number} [idleTimeoutInMinutes] The timeout for the TCP idle - * connection - * @property {string} [name] The 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 OutboundRule - * - * @returns {object} metadata of OutboundRule - * - */ - mapper() { - return { - required: false, - serializedName: 'OutboundRule', - type: { - name: 'Composite', - className: 'OutboundRule', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - allocatedOutboundPorts: { - required: false, - serializedName: 'properties.allocatedOutboundPorts', - type: { - name: 'Number' - } - }, - frontendIPConfigurations: { - required: true, - serializedName: 'properties.frontendIPConfigurations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SubResourceElementType', - type: { - name: 'Composite', - className: 'SubResource' - } - } - } - }, - backendAddressPool: { - required: true, - serializedName: 'properties.backendAddressPool', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - protocol: { - required: true, - serializedName: 'properties.protocol', - type: { - name: 'String' - } - }, - enableTcpReset: { - required: false, - serializedName: 'properties.enableTcpReset', - type: { - name: 'Boolean' - } - }, - idleTimeoutInMinutes: { - required: false, - serializedName: 'properties.idleTimeoutInMinutes', - type: { - name: 'Number' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = OutboundRule; diff --git a/lib/services/networkManagement2/lib/models/p2SVpnGateway.js b/lib/services/networkManagement2/lib/models/p2SVpnGateway.js deleted file mode 100644 index 52c0a8e4a..000000000 --- a/lib/services/networkManagement2/lib/models/p2SVpnGateway.js +++ /dev/null @@ -1,175 +0,0 @@ -/* - * 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'); - -/** - * P2SVpnGateway Resource. - * - * @extends models['Resource'] - */ -class P2SVpnGateway extends models['Resource'] { - /** - * Create a P2SVpnGateway. - * @property {object} [virtualHub] The VirtualHub to which the gateway - * belongs - * @property {string} [virtualHub.id] Resource ID. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * @property {number} [vpnGatewayScaleUnit] The scale unit for this p2s vpn - * gateway. - * @property {object} [p2SVpnServerConfiguration] The - * P2SVpnServerConfiguration to which the p2sVpnGateway is attached to. - * @property {string} [p2SVpnServerConfiguration.id] Resource ID. - * @property {object} [vpnClientAddressPool] The reference of the address - * space resource which represents Address space for P2S VpnClient. - * @property {array} [vpnClientAddressPool.addressPrefixes] A list of address - * blocks reserved for this virtual network in CIDR notation. - * @property {object} [vpnClientConnectionHealth] All P2S vpnclients' - * connection health status. - * @property {number} - * [vpnClientConnectionHealth.totalIngressBytesTransferred] Total of the - * Ingress Bytes Transferred in this P2S Vpn connection - * @property {number} [vpnClientConnectionHealth.totalEgressBytesTransferred] - * Total of the Egress Bytes Transferred in this connection - * @property {number} [vpnClientConnectionHealth.vpnClientConnectionsCount] - * The total of p2s vpn clients connected at this time to this P2SVpnGateway. - * @property {array} [vpnClientConnectionHealth.allocatedIpAddresses] List of - * allocated ip addresses to the connected p2s vpn clients. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of P2SVpnGateway - * - * @returns {object} metadata of P2SVpnGateway - * - */ - mapper() { - return { - required: false, - serializedName: 'P2SVpnGateway', - type: { - name: 'Composite', - className: 'P2SVpnGateway', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - virtualHub: { - required: false, - serializedName: 'properties.virtualHub', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - vpnGatewayScaleUnit: { - required: false, - serializedName: 'properties.vpnGatewayScaleUnit', - type: { - name: 'Number' - } - }, - p2SVpnServerConfiguration: { - required: false, - serializedName: 'properties.p2SVpnServerConfiguration', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - vpnClientAddressPool: { - required: false, - serializedName: 'properties.vpnClientAddressPool', - type: { - name: 'Composite', - className: 'AddressSpace' - } - }, - vpnClientConnectionHealth: { - required: false, - readOnly: true, - serializedName: 'properties.vpnClientConnectionHealth', - type: { - name: 'Composite', - className: 'VpnClientConnectionHealth' - } - }, - etag: { - required: false, - readOnly: true, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = P2SVpnGateway; diff --git a/lib/services/networkManagement2/lib/models/p2SVpnProfileParameters.js b/lib/services/networkManagement2/lib/models/p2SVpnProfileParameters.js deleted file mode 100644 index d404ecb56..000000000 --- a/lib/services/networkManagement2/lib/models/p2SVpnProfileParameters.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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'; - -/** - * Vpn Client Parameters for package generation - * - */ -class P2SVpnProfileParameters { - /** - * Create a P2SVpnProfileParameters. - * @property {string} [authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - */ - constructor() { - } - - /** - * Defines the metadata of P2SVpnProfileParameters - * - * @returns {object} metadata of P2SVpnProfileParameters - * - */ - mapper() { - return { - required: false, - serializedName: 'P2SVpnProfileParameters', - type: { - name: 'Composite', - className: 'P2SVpnProfileParameters', - modelProperties: { - authenticationMethod: { - required: false, - serializedName: 'authenticationMethod', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = P2SVpnProfileParameters; diff --git a/lib/services/networkManagement2/lib/models/p2SVpnServerConfigRadiusClientRootCertificate.js b/lib/services/networkManagement2/lib/models/p2SVpnServerConfigRadiusClientRootCertificate.js deleted file mode 100644 index 871dc18e2..000000000 --- a/lib/services/networkManagement2/lib/models/p2SVpnServerConfigRadiusClientRootCertificate.js +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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'); - -/** - * Radius client root certificate of P2SVpnServerConfiguration. - * - * @extends models['SubResource'] - */ -class P2SVpnServerConfigRadiusClientRootCertificate extends models['SubResource'] { - /** - * Create a P2SVpnServerConfigRadiusClientRootCertificate. - * @property {string} [thumbprint] The Radius client root certificate - * thumbprint. - * @property {string} [provisioningState] The provisioning state of the - * Radius client root certificate resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [name] The 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 P2SVpnServerConfigRadiusClientRootCertificate - * - * @returns {object} metadata of P2SVpnServerConfigRadiusClientRootCertificate - * - */ - mapper() { - return { - required: false, - serializedName: 'P2SVpnServerConfigRadiusClientRootCertificate', - type: { - name: 'Composite', - className: 'P2SVpnServerConfigRadiusClientRootCertificate', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - thumbprint: { - required: false, - serializedName: 'properties.thumbprint', - 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, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = P2SVpnServerConfigRadiusClientRootCertificate; diff --git a/lib/services/networkManagement2/lib/models/p2SVpnServerConfigRadiusServerRootCertificate.js b/lib/services/networkManagement2/lib/models/p2SVpnServerConfigRadiusServerRootCertificate.js deleted file mode 100644 index 597eb1655..000000000 --- a/lib/services/networkManagement2/lib/models/p2SVpnServerConfigRadiusServerRootCertificate.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * 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'); - -/** - * Radius Server root certificate of P2SVpnServerConfiguration. - * - * @extends models['SubResource'] - */ -class P2SVpnServerConfigRadiusServerRootCertificate extends models['SubResource'] { - /** - * Create a P2SVpnServerConfigRadiusServerRootCertificate. - * @property {string} publicCertData The certificate public data. - * @property {string} [provisioningState] The provisioning state of the - * P2SVpnServerConfiguration Radius Server root certificate resource. - * Possible values are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [name] The 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 P2SVpnServerConfigRadiusServerRootCertificate - * - * @returns {object} metadata of P2SVpnServerConfigRadiusServerRootCertificate - * - */ - mapper() { - return { - required: false, - serializedName: 'P2SVpnServerConfigRadiusServerRootCertificate', - type: { - name: 'Composite', - className: 'P2SVpnServerConfigRadiusServerRootCertificate', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - publicCertData: { - required: true, - serializedName: 'properties.publicCertData', - 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, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = P2SVpnServerConfigRadiusServerRootCertificate; diff --git a/lib/services/networkManagement2/lib/models/p2SVpnServerConfigVpnClientRevokedCertificate.js b/lib/services/networkManagement2/lib/models/p2SVpnServerConfigVpnClientRevokedCertificate.js deleted file mode 100644 index 7aec17920..000000000 --- a/lib/services/networkManagement2/lib/models/p2SVpnServerConfigVpnClientRevokedCertificate.js +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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'); - -/** - * VPN client revoked certificate of P2SVpnServerConfiguration. - * - * @extends models['SubResource'] - */ -class P2SVpnServerConfigVpnClientRevokedCertificate extends models['SubResource'] { - /** - * Create a P2SVpnServerConfigVpnClientRevokedCertificate. - * @property {string} [thumbprint] The revoked VPN client certificate - * thumbprint. - * @property {string} [provisioningState] The provisioning state of the VPN - * client revoked certificate resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [name] The 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 P2SVpnServerConfigVpnClientRevokedCertificate - * - * @returns {object} metadata of P2SVpnServerConfigVpnClientRevokedCertificate - * - */ - mapper() { - return { - required: false, - serializedName: 'P2SVpnServerConfigVpnClientRevokedCertificate', - type: { - name: 'Composite', - className: 'P2SVpnServerConfigVpnClientRevokedCertificate', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - thumbprint: { - required: false, - serializedName: 'properties.thumbprint', - 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, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = P2SVpnServerConfigVpnClientRevokedCertificate; diff --git a/lib/services/networkManagement2/lib/models/p2SVpnServerConfigVpnClientRootCertificate.js b/lib/services/networkManagement2/lib/models/p2SVpnServerConfigVpnClientRootCertificate.js deleted file mode 100644 index e7e7fb0ca..000000000 --- a/lib/services/networkManagement2/lib/models/p2SVpnServerConfigVpnClientRootCertificate.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * 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'); - -/** - * VPN client root certificate of P2SVpnServerConfiguration. - * - * @extends models['SubResource'] - */ -class P2SVpnServerConfigVpnClientRootCertificate extends models['SubResource'] { - /** - * Create a P2SVpnServerConfigVpnClientRootCertificate. - * @property {string} publicCertData The certificate public data. - * @property {string} [provisioningState] The provisioning state of the - * P2SVpnServerConfiguration VPN client root certificate resource. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [name] The 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 P2SVpnServerConfigVpnClientRootCertificate - * - * @returns {object} metadata of P2SVpnServerConfigVpnClientRootCertificate - * - */ - mapper() { - return { - required: false, - serializedName: 'P2SVpnServerConfigVpnClientRootCertificate', - type: { - name: 'Composite', - className: 'P2SVpnServerConfigVpnClientRootCertificate', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - publicCertData: { - required: true, - serializedName: 'properties.publicCertData', - 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, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = P2SVpnServerConfigVpnClientRootCertificate; diff --git a/lib/services/networkManagement2/lib/models/p2SVpnServerConfiguration.js b/lib/services/networkManagement2/lib/models/p2SVpnServerConfiguration.js deleted file mode 100644 index 0ae7cb204..000000000 --- a/lib/services/networkManagement2/lib/models/p2SVpnServerConfiguration.js +++ /dev/null @@ -1,243 +0,0 @@ -/* - * 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'); - -/** - * P2SVpnServerConfiguration Resource. - * - * @extends models['SubResource'] - */ -class P2SVpnServerConfiguration extends models['SubResource'] { - /** - * Create a P2SVpnServerConfiguration. - * @property {string} [p2SVpnServerConfigurationPropertiesName] The name of - * the P2SVpnServerConfiguration that is unique within a VirtualWan in a - * resource group. This name can be used to access the resource along with - * Paren VirtualWan resource name. - * @property {array} [vpnProtocols] vpnProtocols for the - * P2SVpnServerConfiguration. - * @property {array} [p2SVpnServerConfigVpnClientRootCertificates] VPN client - * root certificate of P2SVpnServerConfiguration. - * @property {array} [p2SVpnServerConfigVpnClientRevokedCertificates] VPN - * client revoked certificate of P2SVpnServerConfiguration. - * @property {array} [p2SVpnServerConfigRadiusServerRootCertificates] Radius - * Server root certificate of P2SVpnServerConfiguration. - * @property {array} [p2SVpnServerConfigRadiusClientRootCertificates] Radius - * client root certificate of P2SVpnServerConfiguration. - * @property {array} [vpnClientIpsecPolicies] VpnClientIpsecPolicies for - * P2SVpnServerConfiguration. - * @property {string} [radiusServerAddress] The radius server address - * property of the P2SVpnServerConfiguration resource for point to site - * client connection. - * @property {string} [radiusServerSecret] The radius secret property of the - * P2SVpnServerConfiguration resource for for point to site client - * connection. - * @property {string} [provisioningState] The provisioning state of the - * P2SVpnServerConfiguration resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {array} [p2SVpnGateways] - * @property {string} [p2SVpnServerConfigurationPropertiesEtag] A unique - * read-only string that changes whenever the resource is updated. - * @property {string} [name] The name of the resource that is unique within a - * resource group. This name can be used to access the resource. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of P2SVpnServerConfiguration - * - * @returns {object} metadata of P2SVpnServerConfiguration - * - */ - mapper() { - return { - required: false, - serializedName: 'P2SVpnServerConfiguration', - type: { - name: 'Composite', - className: 'P2SVpnServerConfiguration', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - p2SVpnServerConfigurationPropertiesName: { - required: false, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, - vpnProtocols: { - required: false, - serializedName: 'properties.vpnProtocols', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'VpnGatewayTunnelingProtocolElementType', - type: { - name: 'String' - } - } - } - }, - p2SVpnServerConfigVpnClientRootCertificates: { - required: false, - serializedName: 'properties.p2SVpnServerConfigVpnClientRootCertificates', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'P2SVpnServerConfigVpnClientRootCertificateElementType', - type: { - name: 'Composite', - className: 'P2SVpnServerConfigVpnClientRootCertificate' - } - } - } - }, - p2SVpnServerConfigVpnClientRevokedCertificates: { - required: false, - serializedName: 'properties.p2SVpnServerConfigVpnClientRevokedCertificates', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'P2SVpnServerConfigVpnClientRevokedCertificateElementType', - type: { - name: 'Composite', - className: 'P2SVpnServerConfigVpnClientRevokedCertificate' - } - } - } - }, - p2SVpnServerConfigRadiusServerRootCertificates: { - required: false, - serializedName: 'properties.p2SVpnServerConfigRadiusServerRootCertificates', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'P2SVpnServerConfigRadiusServerRootCertificateElementType', - type: { - name: 'Composite', - className: 'P2SVpnServerConfigRadiusServerRootCertificate' - } - } - } - }, - p2SVpnServerConfigRadiusClientRootCertificates: { - required: false, - serializedName: 'properties.p2SVpnServerConfigRadiusClientRootCertificates', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'P2SVpnServerConfigRadiusClientRootCertificateElementType', - type: { - name: 'Composite', - className: 'P2SVpnServerConfigRadiusClientRootCertificate' - } - } - } - }, - vpnClientIpsecPolicies: { - required: false, - serializedName: 'properties.vpnClientIpsecPolicies', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'IpsecPolicyElementType', - type: { - name: 'Composite', - className: 'IpsecPolicy' - } - } - } - }, - radiusServerAddress: { - required: false, - serializedName: 'properties.radiusServerAddress', - type: { - name: 'String' - } - }, - radiusServerSecret: { - required: false, - serializedName: 'properties.radiusServerSecret', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - p2SVpnGateways: { - required: false, - readOnly: true, - serializedName: 'properties.p2SVpnGateways', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SubResourceElementType', - type: { - name: 'Composite', - className: 'SubResource' - } - } - } - }, - p2SVpnServerConfigurationPropertiesEtag: { - required: false, - serializedName: 'properties.etag', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - readOnly: true, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = P2SVpnServerConfiguration; diff --git a/lib/services/networkManagement2/lib/models/packetCapture.js b/lib/services/networkManagement2/lib/models/packetCapture.js deleted file mode 100644 index 0005ff0d8..000000000 --- a/lib/services/networkManagement2/lib/models/packetCapture.js +++ /dev/null @@ -1,118 +0,0 @@ -/* - * 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'; - -/** - * Parameters that define the create packet capture operation. - * - */ -class PacketCapture { - /** - * Create a PacketCapture. - * @property {string} target The ID of the targeted resource, only VM is - * currently supported. - * @property {number} [bytesToCapturePerPacket] Number of bytes captured per - * packet, the remaining bytes are truncated. Default value: 0 . - * @property {number} [totalBytesPerSession] Maximum size of the capture - * output. Default value: 1073741824 . - * @property {number} [timeLimitInSeconds] Maximum duration of the capture - * session in seconds. Default value: 18000 . - * @property {object} storageLocation - * @property {string} [storageLocation.storageId] The ID of the storage - * account to save the packet capture session. Required if no local file path - * is provided. - * @property {string} [storageLocation.storagePath] The URI of the storage - * path to save the packet capture. Must be a well-formed URI describing the - * location to save the packet capture. - * @property {string} [storageLocation.filePath] A valid local path on the - * targeting VM. Must include the name of the capture file (*.cap). For linux - * virtual machine it must start with /var/captures. Required if no storage - * ID is provided, otherwise optional. - * @property {array} [filters] - */ - constructor() { - } - - /** - * Defines the metadata of PacketCapture - * - * @returns {object} metadata of PacketCapture - * - */ - mapper() { - return { - required: false, - serializedName: 'PacketCapture', - type: { - name: 'Composite', - className: 'PacketCapture', - modelProperties: { - target: { - required: true, - serializedName: 'properties.target', - type: { - name: 'String' - } - }, - bytesToCapturePerPacket: { - required: false, - serializedName: 'properties.bytesToCapturePerPacket', - defaultValue: 0, - type: { - name: 'Number' - } - }, - totalBytesPerSession: { - required: false, - serializedName: 'properties.totalBytesPerSession', - defaultValue: 1073741824, - type: { - name: 'Number' - } - }, - timeLimitInSeconds: { - required: false, - serializedName: 'properties.timeLimitInSeconds', - defaultValue: 18000, - type: { - name: 'Number' - } - }, - storageLocation: { - required: true, - serializedName: 'properties.storageLocation', - type: { - name: 'Composite', - className: 'PacketCaptureStorageLocation' - } - }, - filters: { - required: false, - serializedName: 'properties.filters', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'PacketCaptureFilterElementType', - type: { - name: 'Composite', - className: 'PacketCaptureFilter' - } - } - } - } - } - } - }; - } -} - -module.exports = PacketCapture; diff --git a/lib/services/networkManagement2/lib/models/packetCaptureFilter.js b/lib/services/networkManagement2/lib/models/packetCaptureFilter.js deleted file mode 100644 index 637b7f990..000000000 --- a/lib/services/networkManagement2/lib/models/packetCaptureFilter.js +++ /dev/null @@ -1,101 +0,0 @@ -/* - * 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'; - -/** - * Filter that is applied to packet capture request. Multiple filters can be - * applied. - * - */ -class PacketCaptureFilter { - /** - * Create a PacketCaptureFilter. - * @property {string} [protocol] Protocol to be filtered on. Possible values - * include: 'TCP', 'UDP', 'Any'. Default value: 'Any' . - * @property {string} [localIPAddress] Local IP Address to be filtered on. - * Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" - * for range. "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges - * not currently supported. Mixing ranges with multiple entries not currently - * supported. Default = null. - * @property {string} [remoteIPAddress] Local IP Address to be filtered on. - * Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" - * for range. "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges - * not currently supported. Mixing ranges with multiple entries not currently - * supported. Default = null. - * @property {string} [localPort] Local port to be filtered on. Notation: - * "80" for single port entry."80-85" for range. "80;443;" for multiple - * entries. Multiple ranges not currently supported. Mixing ranges with - * multiple entries not currently supported. Default = null. - * @property {string} [remotePort] Remote port to be filtered on. Notation: - * "80" for single port entry."80-85" for range. "80;443;" for multiple - * entries. Multiple ranges not currently supported. Mixing ranges with - * multiple entries not currently supported. Default = null. - */ - constructor() { - } - - /** - * Defines the metadata of PacketCaptureFilter - * - * @returns {object} metadata of PacketCaptureFilter - * - */ - mapper() { - return { - required: false, - serializedName: 'PacketCaptureFilter', - type: { - name: 'Composite', - className: 'PacketCaptureFilter', - modelProperties: { - protocol: { - required: false, - serializedName: 'protocol', - defaultValue: 'Any', - type: { - name: 'String' - } - }, - localIPAddress: { - required: false, - serializedName: 'localIPAddress', - type: { - name: 'String' - } - }, - remoteIPAddress: { - required: false, - serializedName: 'remoteIPAddress', - type: { - name: 'String' - } - }, - localPort: { - required: false, - serializedName: 'localPort', - type: { - name: 'String' - } - }, - remotePort: { - required: false, - serializedName: 'remotePort', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = PacketCaptureFilter; diff --git a/lib/services/networkManagement2/lib/models/packetCaptureListResult.js b/lib/services/networkManagement2/lib/models/packetCaptureListResult.js deleted file mode 100644 index 83e0404f3..000000000 --- a/lib/services/networkManagement2/lib/models/packetCaptureListResult.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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'; - -/** - * List of packet capture sessions. - */ -class PacketCaptureListResult extends Array { - /** - * Create a PacketCaptureListResult. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of PacketCaptureListResult - * - * @returns {object} metadata of PacketCaptureListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'PacketCaptureListResult', - type: { - name: 'Composite', - className: 'PacketCaptureListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'PacketCaptureResultElementType', - type: { - name: 'Composite', - className: 'PacketCaptureResult' - } - } - } - } - } - } - }; - } -} - -module.exports = PacketCaptureListResult; diff --git a/lib/services/networkManagement2/lib/models/packetCaptureParameters.js b/lib/services/networkManagement2/lib/models/packetCaptureParameters.js deleted file mode 100644 index 59b17b4d8..000000000 --- a/lib/services/networkManagement2/lib/models/packetCaptureParameters.js +++ /dev/null @@ -1,118 +0,0 @@ -/* - * 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'; - -/** - * Parameters that define the create packet capture operation. - * - */ -class PacketCaptureParameters { - /** - * Create a PacketCaptureParameters. - * @property {string} target The ID of the targeted resource, only VM is - * currently supported. - * @property {number} [bytesToCapturePerPacket] Number of bytes captured per - * packet, the remaining bytes are truncated. Default value: 0 . - * @property {number} [totalBytesPerSession] Maximum size of the capture - * output. Default value: 1073741824 . - * @property {number} [timeLimitInSeconds] Maximum duration of the capture - * session in seconds. Default value: 18000 . - * @property {object} storageLocation - * @property {string} [storageLocation.storageId] The ID of the storage - * account to save the packet capture session. Required if no local file path - * is provided. - * @property {string} [storageLocation.storagePath] The URI of the storage - * path to save the packet capture. Must be a well-formed URI describing the - * location to save the packet capture. - * @property {string} [storageLocation.filePath] A valid local path on the - * targeting VM. Must include the name of the capture file (*.cap). For linux - * virtual machine it must start with /var/captures. Required if no storage - * ID is provided, otherwise optional. - * @property {array} [filters] - */ - constructor() { - } - - /** - * Defines the metadata of PacketCaptureParameters - * - * @returns {object} metadata of PacketCaptureParameters - * - */ - mapper() { - return { - required: false, - serializedName: 'PacketCaptureParameters', - type: { - name: 'Composite', - className: 'PacketCaptureParameters', - modelProperties: { - target: { - required: true, - serializedName: 'target', - type: { - name: 'String' - } - }, - bytesToCapturePerPacket: { - required: false, - serializedName: 'bytesToCapturePerPacket', - defaultValue: 0, - type: { - name: 'Number' - } - }, - totalBytesPerSession: { - required: false, - serializedName: 'totalBytesPerSession', - defaultValue: 1073741824, - type: { - name: 'Number' - } - }, - timeLimitInSeconds: { - required: false, - serializedName: 'timeLimitInSeconds', - defaultValue: 18000, - type: { - name: 'Number' - } - }, - storageLocation: { - required: true, - serializedName: 'storageLocation', - type: { - name: 'Composite', - className: 'PacketCaptureStorageLocation' - } - }, - filters: { - required: false, - serializedName: 'filters', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'PacketCaptureFilterElementType', - type: { - name: 'Composite', - className: 'PacketCaptureFilter' - } - } - } - } - } - } - }; - } -} - -module.exports = PacketCaptureParameters; diff --git a/lib/services/networkManagement2/lib/models/packetCaptureQueryStatusResult.js b/lib/services/networkManagement2/lib/models/packetCaptureQueryStatusResult.js deleted file mode 100644 index 4d02500d5..000000000 --- a/lib/services/networkManagement2/lib/models/packetCaptureQueryStatusResult.js +++ /dev/null @@ -1,104 +0,0 @@ -/* - * 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'; - -/** - * Status of packet capture session. - * - */ -class PacketCaptureQueryStatusResult { - /** - * Create a PacketCaptureQueryStatusResult. - * @property {string} [name] The name of the packet capture resource. - * @property {string} [id] The ID of the packet capture resource. - * @property {date} [captureStartTime] The start time of the packet capture - * session. - * @property {string} [packetCaptureStatus] The status of the packet capture - * session. Possible values include: 'NotStarted', 'Running', 'Stopped', - * 'Error', 'Unknown' - * @property {string} [stopReason] The reason the current packet capture - * session was stopped. - * @property {array} [packetCaptureError] List of errors of packet capture - * session. - */ - constructor() { - } - - /** - * Defines the metadata of PacketCaptureQueryStatusResult - * - * @returns {object} metadata of PacketCaptureQueryStatusResult - * - */ - mapper() { - return { - required: false, - serializedName: 'PacketCaptureQueryStatusResult', - type: { - name: 'Composite', - className: 'PacketCaptureQueryStatusResult', - modelProperties: { - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - captureStartTime: { - required: false, - serializedName: 'captureStartTime', - type: { - name: 'DateTime' - } - }, - packetCaptureStatus: { - required: false, - serializedName: 'packetCaptureStatus', - type: { - name: 'String' - } - }, - stopReason: { - required: false, - serializedName: 'stopReason', - type: { - name: 'String' - } - }, - packetCaptureError: { - required: false, - serializedName: 'packetCaptureError', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'PcErrorElementType', - type: { - name: 'String' - } - } - } - } - } - } - }; - } -} - -module.exports = PacketCaptureQueryStatusResult; diff --git a/lib/services/networkManagement2/lib/models/packetCaptureResult.js b/lib/services/networkManagement2/lib/models/packetCaptureResult.js deleted file mode 100644 index 5492bebed..000000000 --- a/lib/services/networkManagement2/lib/models/packetCaptureResult.js +++ /dev/null @@ -1,156 +0,0 @@ -/* - * 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'; - -/** - * Information about packet capture session. - * - */ -class PacketCaptureResult { - /** - * Create a PacketCaptureResult. - * @property {string} [name] Name of the packet capture session. - * @property {string} [id] ID of the packet capture operation. - * @property {string} [etag] Default value: 'A unique read-only string that - * changes whenever the resource is updated.' . - * @property {string} target The ID of the targeted resource, only VM is - * currently supported. - * @property {number} [bytesToCapturePerPacket] Number of bytes captured per - * packet, the remaining bytes are truncated. Default value: 0 . - * @property {number} [totalBytesPerSession] Maximum size of the capture - * output. Default value: 1073741824 . - * @property {number} [timeLimitInSeconds] Maximum duration of the capture - * session in seconds. Default value: 18000 . - * @property {object} storageLocation - * @property {string} [storageLocation.storageId] The ID of the storage - * account to save the packet capture session. Required if no local file path - * is provided. - * @property {string} [storageLocation.storagePath] The URI of the storage - * path to save the packet capture. Must be a well-formed URI describing the - * location to save the packet capture. - * @property {string} [storageLocation.filePath] A valid local path on the - * targeting VM. Must include the name of the capture file (*.cap). For linux - * virtual machine it must start with /var/captures. Required if no storage - * ID is provided, otherwise optional. - * @property {array} [filters] - * @property {string} [provisioningState] The provisioning state of the - * packet capture session. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - */ - constructor() { - } - - /** - * Defines the metadata of PacketCaptureResult - * - * @returns {object} metadata of PacketCaptureResult - * - */ - mapper() { - return { - required: false, - serializedName: 'PacketCaptureResult', - type: { - name: 'Composite', - className: 'PacketCaptureResult', - modelProperties: { - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - id: { - required: false, - readOnly: true, - serializedName: 'id', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - defaultValue: 'A unique read-only string that changes whenever the resource is updated.', - type: { - name: 'String' - } - }, - target: { - required: true, - serializedName: 'properties.target', - type: { - name: 'String' - } - }, - bytesToCapturePerPacket: { - required: false, - serializedName: 'properties.bytesToCapturePerPacket', - defaultValue: 0, - type: { - name: 'Number' - } - }, - totalBytesPerSession: { - required: false, - serializedName: 'properties.totalBytesPerSession', - defaultValue: 1073741824, - type: { - name: 'Number' - } - }, - timeLimitInSeconds: { - required: false, - serializedName: 'properties.timeLimitInSeconds', - defaultValue: 18000, - type: { - name: 'Number' - } - }, - storageLocation: { - required: true, - serializedName: 'properties.storageLocation', - type: { - name: 'Composite', - className: 'PacketCaptureStorageLocation' - } - }, - filters: { - required: false, - serializedName: 'properties.filters', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'PacketCaptureFilterElementType', - type: { - name: 'Composite', - className: 'PacketCaptureFilter' - } - } - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = PacketCaptureResult; diff --git a/lib/services/networkManagement2/lib/models/packetCaptureStorageLocation.js b/lib/services/networkManagement2/lib/models/packetCaptureStorageLocation.js deleted file mode 100644 index 84402c132..000000000 --- a/lib/services/networkManagement2/lib/models/packetCaptureStorageLocation.js +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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'; - -/** - * Describes the storage location for a packet capture session. - * - */ -class PacketCaptureStorageLocation { - /** - * Create a PacketCaptureStorageLocation. - * @property {string} [storageId] The ID of the storage account to save the - * packet capture session. Required if no local file path is provided. - * @property {string} [storagePath] The URI of the storage path to save the - * packet capture. Must be a well-formed URI describing the location to save - * the packet capture. - * @property {string} [filePath] A valid local path on the targeting VM. Must - * include the name of the capture file (*.cap). For linux virtual machine it - * must start with /var/captures. Required if no storage ID is provided, - * otherwise optional. - */ - constructor() { - } - - /** - * Defines the metadata of PacketCaptureStorageLocation - * - * @returns {object} metadata of PacketCaptureStorageLocation - * - */ - mapper() { - return { - required: false, - serializedName: 'PacketCaptureStorageLocation', - type: { - name: 'Composite', - className: 'PacketCaptureStorageLocation', - modelProperties: { - storageId: { - required: false, - serializedName: 'storageId', - type: { - name: 'String' - } - }, - storagePath: { - required: false, - serializedName: 'storagePath', - type: { - name: 'String' - } - }, - filePath: { - required: false, - serializedName: 'filePath', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = PacketCaptureStorageLocation; diff --git a/lib/services/networkManagement2/lib/models/patchRouteFilter.js b/lib/services/networkManagement2/lib/models/patchRouteFilter.js deleted file mode 100644 index 657016c29..000000000 --- a/lib/services/networkManagement2/lib/models/patchRouteFilter.js +++ /dev/null @@ -1,144 +0,0 @@ -/* - * 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'); - -/** - * Route Filter Resource. - * - * @extends models['SubResource'] - */ -class PatchRouteFilter extends models['SubResource'] { - /** - * Create a PatchRouteFilter. - * @property {array} [rules] Collection of RouteFilterRules contained within - * a route filter. - * @property {array} [peerings] A collection of references to express route - * circuit peerings. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and - * 'Failed'. - * @property {string} [name] The 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. - * @property {string} [type] Resource type. - * @property {object} [tags] Resource tags. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of PatchRouteFilter - * - * @returns {object} metadata of PatchRouteFilter - * - */ - mapper() { - return { - required: false, - serializedName: 'PatchRouteFilter', - type: { - name: 'Composite', - className: 'PatchRouteFilter', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - rules: { - required: false, - serializedName: 'properties.rules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'RouteFilterRuleElementType', - type: { - name: 'Composite', - className: 'RouteFilterRule' - } - } - } - }, - peerings: { - required: false, - serializedName: 'properties.peerings', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ExpressRouteCircuitPeeringElementType', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitPeering' - } - } - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - readOnly: true, - serializedName: 'etag', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - } - } - } - }; - } -} - -module.exports = PatchRouteFilter; diff --git a/lib/services/networkManagement2/lib/models/patchRouteFilterRule.js b/lib/services/networkManagement2/lib/models/patchRouteFilterRule.js deleted file mode 100644 index 9eede0b05..000000000 --- a/lib/services/networkManagement2/lib/models/patchRouteFilterRule.js +++ /dev/null @@ -1,120 +0,0 @@ -/* - * 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'); - -/** - * Route Filter Rule Resource - * - * @extends models['SubResource'] - */ -class PatchRouteFilterRule extends models['SubResource'] { - /** - * Create a PatchRouteFilterRule. - * @property {string} access The access type of the rule. Valid values are: - * 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' - * @property {array} communities The collection for bgp community values to - * filter on. e.g. ['12076:5010','12076:5020'] - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and - * 'Failed'. - * @property {string} [name] The 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 PatchRouteFilterRule - * - * @returns {object} metadata of PatchRouteFilterRule - * - */ - mapper() { - return { - required: false, - serializedName: 'PatchRouteFilterRule', - type: { - name: 'Composite', - className: 'PatchRouteFilterRule', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - access: { - required: true, - serializedName: 'properties.access', - type: { - name: 'String' - } - }, - routeFilterRuleType: { - required: true, - isConstant: true, - serializedName: 'properties.routeFilterRuleType', - defaultValue: 'Community', - type: { - name: 'String' - } - }, - communities: { - required: true, - serializedName: 'properties.communities', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - readOnly: true, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = PatchRouteFilterRule; diff --git a/lib/services/networkManagement2/lib/models/probe.js b/lib/services/networkManagement2/lib/models/probe.js deleted file mode 100644 index c65bdf8a0..000000000 --- a/lib/services/networkManagement2/lib/models/probe.js +++ /dev/null @@ -1,155 +0,0 @@ -/* - * 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'); - -/** - * A load balancer probe. - * - * @extends models['SubResource'] - */ -class Probe extends models['SubResource'] { - /** - * Create a Probe. - * @property {array} [loadBalancingRules] The load balancer rules that use - * this probe. - * @property {string} protocol The protocol of the end point. Possible values - * are: 'Http', 'Tcp', or 'Https'. If 'Tcp' is specified, a received ACK is - * required for the probe to be successful. If 'Http' or 'Https' is - * specified, a 200 OK response from the specifies URI is required for the - * probe to be successful. Possible values include: 'Http', 'Tcp', 'Https' - * @property {number} port The port for communicating the probe. Possible - * values range from 1 to 65535, inclusive. - * @property {number} [intervalInSeconds] The interval, in seconds, for how - * frequently to probe the endpoint for health status. Typically, the - * interval is slightly less than half the allocated timeout period (in - * seconds) which allows two full probes before taking the instance out of - * rotation. The default value is 15, the minimum value is 5. - * @property {number} [numberOfProbes] The number of probes where if no - * response, will result in stopping further traffic from being delivered to - * the endpoint. This values allows endpoints to be taken out of rotation - * faster or slower than the typical times used in Azure. - * @property {string} [requestPath] The URI used for requesting health status - * from the VM. Path is required if a protocol is set to http. Otherwise, it - * is not allowed. There is no default value. - * @property {string} [provisioningState] Gets the provisioning state of the - * public IP resource. Possible values are: '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 Probe - * - * @returns {object} metadata of Probe - * - */ - mapper() { - return { - required: false, - serializedName: 'Probe', - type: { - name: 'Composite', - className: 'Probe', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - loadBalancingRules: { - required: false, - readOnly: true, - serializedName: 'properties.loadBalancingRules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SubResourceElementType', - type: { - name: 'Composite', - className: 'SubResource' - } - } - } - }, - protocol: { - required: true, - serializedName: 'properties.protocol', - type: { - name: 'String' - } - }, - port: { - required: true, - serializedName: 'properties.port', - type: { - name: 'Number' - } - }, - intervalInSeconds: { - required: false, - serializedName: 'properties.intervalInSeconds', - type: { - name: 'Number' - } - }, - numberOfProbes: { - required: false, - serializedName: 'properties.numberOfProbes', - type: { - name: 'Number' - } - }, - requestPath: { - required: false, - serializedName: 'properties.requestPath', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = Probe; diff --git a/lib/services/networkManagement2/lib/models/protocolConfiguration.js b/lib/services/networkManagement2/lib/models/protocolConfiguration.js deleted file mode 100644 index 5df596eb1..000000000 --- a/lib/services/networkManagement2/lib/models/protocolConfiguration.js +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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'; - -/** - * Configuration of the protocol. - * - */ -class ProtocolConfiguration { - /** - * Create a ProtocolConfiguration. - * @property {object} [hTTPConfiguration] - * @property {string} [hTTPConfiguration.method] HTTP method. Possible values - * include: 'Get' - * @property {array} [hTTPConfiguration.headers] List of HTTP headers. - * @property {array} [hTTPConfiguration.validStatusCodes] Valid status codes. - */ - constructor() { - } - - /** - * Defines the metadata of ProtocolConfiguration - * - * @returns {object} metadata of ProtocolConfiguration - * - */ - mapper() { - return { - required: false, - serializedName: 'ProtocolConfiguration', - type: { - name: 'Composite', - className: 'ProtocolConfiguration', - modelProperties: { - hTTPConfiguration: { - required: false, - serializedName: 'HTTPConfiguration', - type: { - name: 'Composite', - className: 'HTTPConfiguration' - } - } - } - } - }; - } -} - -module.exports = ProtocolConfiguration; diff --git a/lib/services/networkManagement2/lib/models/publicIPAddress.js b/lib/services/networkManagement2/lib/models/publicIPAddress.js deleted file mode 100644 index 761e9f476..000000000 --- a/lib/services/networkManagement2/lib/models/publicIPAddress.js +++ /dev/null @@ -1,331 +0,0 @@ -/* - * 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'); - -/** - * Public IP address resource. - * - * @extends models['Resource'] - */ -class PublicIPAddress extends models['Resource'] { - /** - * Create a PublicIPAddress. - * @property {object} [sku] The public IP address SKU. - * @property {string} [sku.name] Name of a public IP address SKU. Possible - * values include: 'Basic', 'Standard' - * @property {string} [publicIPAllocationMethod] The public IP allocation - * method. Possible values are: 'Static' and 'Dynamic'. Possible values - * include: 'Static', 'Dynamic' - * @property {string} [publicIPAddressVersion] The public IP address version. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * @property {object} [ipConfiguration] The IP configuration associated with - * the public IP address. - * @property {string} [ipConfiguration.privateIPAddress] The private IP - * address of the IP configuration. - * @property {string} [ipConfiguration.privateIPAllocationMethod] The private - * IP allocation method. Possible values are 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' - * @property {object} [ipConfiguration.subnet] The reference of the subnet - * resource. - * @property {string} [ipConfiguration.subnet.addressPrefix] The address - * prefix for the subnet. - * @property {array} [ipConfiguration.subnet.addressPrefixes] List of - * address prefixes for the subnet. - * @property {object} [ipConfiguration.subnet.networkSecurityGroup] The - * reference of the NetworkSecurityGroup resource. - * @property {array} - * [ipConfiguration.subnet.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * @property {array} - * [ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * @property {array} - * [ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] A - * collection of references to network interfaces. - * @property {array} [ipConfiguration.subnet.networkSecurityGroup.subnets] A - * collection of references to subnets. - * @property {string} - * [ipConfiguration.subnet.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. - * @property {string} - * [ipConfiguration.subnet.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [ipConfiguration.subnet.networkSecurityGroup.etag] A - * unique read-only string that changes whenever the resource is updated. - * @property {object} [ipConfiguration.subnet.routeTable] The reference of - * the RouteTable resource. - * @property {array} [ipConfiguration.subnet.routeTable.routes] Collection of - * routes contained within a route table. - * @property {array} [ipConfiguration.subnet.routeTable.subnets] A collection - * of references to subnets. - * @property {boolean} - * [ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] Gets or - * sets whether to disable the routes learned by BGP on that route table. - * True means disable. - * @property {string} [ipConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [ipConfiguration.subnet.routeTable.etag] Gets a unique - * read-only string that changes whenever the resource is updated. - * @property {array} [ipConfiguration.subnet.serviceEndpoints] An array of - * service endpoints. - * @property {array} [ipConfiguration.subnet.serviceEndpointPolicies] An - * array of service endpoint policies. - * @property {array} [ipConfiguration.subnet.interfaceEndpoints] An array of - * references to interface endpoints - * @property {array} [ipConfiguration.subnet.ipConfigurations] Gets an array - * of references to the network interface IP configurations using subnet. - * @property {array} [ipConfiguration.subnet.ipConfigurationProfiles] Array - * of IP configuration profiles which reference this subnet. - * @property {array} [ipConfiguration.subnet.resourceNavigationLinks] Gets an - * array of references to the external resources using subnet. - * @property {array} [ipConfiguration.subnet.serviceAssociationLinks] Gets an - * array of references to services injecting into this subnet. - * @property {array} [ipConfiguration.subnet.delegations] Gets an array of - * references to the delegations on the subnet. - * @property {string} [ipConfiguration.subnet.purpose] A read-only string - * identifying the intention of use for this subnet based on delegations and - * other user-defined properties. - * @property {string} [ipConfiguration.subnet.provisioningState] The - * provisioning state of the resource. - * @property {string} [ipConfiguration.subnet.name] The name of the resource - * that is unique within a resource group. This name can be used to access - * the resource. - * @property {string} [ipConfiguration.subnet.etag] A unique read-only string - * that changes whenever the resource is updated. - * @property {object} [ipConfiguration.publicIPAddress] The reference of the - * public IP resource. - * @property {string} [ipConfiguration.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [ipConfiguration.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * @property {string} [ipConfiguration.etag] A unique read-only string that - * changes whenever the resource is updated. - * @property {object} [dnsSettings] The FQDN of the DNS record associated - * with the public IP address. - * @property {string} [dnsSettings.domainNameLabel] Gets or sets the Domain - * name label.The concatenation of the domain name label and the regionalized - * DNS zone make up the fully qualified domain name associated with the - * public IP address. If a domain name label is specified, an A DNS record is - * created for the public IP in the Microsoft Azure DNS system. - * @property {string} [dnsSettings.fqdn] Gets the FQDN, Fully qualified - * domain name of the A DNS record associated with the public IP. This is the - * concatenation of the domainNameLabel and the regionalized DNS zone. - * @property {string} [dnsSettings.reverseFqdn] Gets or Sets the Reverse - * FQDN. A user-visible, fully qualified domain name that resolves to this - * public IP address. If the reverseFqdn is specified, then a PTR DNS record - * is created pointing from the IP address in the in-addr.arpa domain to the - * reverse FQDN. - * @property {array} [ipTags] The list of tags associated with the public IP - * address. - * @property {string} [ipAddress] The IP address associated with the public - * IP address resource. - * @property {object} [publicIPPrefix] The Public IP Prefix this Public IP - * Address should be allocated from. - * @property {string} [publicIPPrefix.id] Resource ID. - * @property {number} [idleTimeoutInMinutes] The idle timeout of the public - * IP address. - * @property {string} [resourceGuid] The resource GUID property of the public - * IP resource. - * @property {string} [provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {array} [zones] A list of availability zones denoting the IP - * allocated for the resource needs to come from. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of PublicIPAddress - * - * @returns {object} metadata of PublicIPAddress - * - */ - mapper() { - return { - required: false, - serializedName: 'PublicIPAddress', - type: { - name: 'Composite', - className: 'PublicIPAddress', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - sku: { - required: false, - serializedName: 'sku', - type: { - name: 'Composite', - className: 'PublicIPAddressSku' - } - }, - publicIPAllocationMethod: { - required: false, - serializedName: 'properties.publicIPAllocationMethod', - type: { - name: 'String' - } - }, - publicIPAddressVersion: { - required: false, - serializedName: 'properties.publicIPAddressVersion', - type: { - name: 'String' - } - }, - ipConfiguration: { - required: false, - readOnly: true, - serializedName: 'properties.ipConfiguration', - type: { - name: 'Composite', - className: 'IPConfiguration' - } - }, - dnsSettings: { - required: false, - serializedName: 'properties.dnsSettings', - type: { - name: 'Composite', - className: 'PublicIPAddressDnsSettings' - } - }, - ipTags: { - required: false, - serializedName: 'properties.ipTags', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'IpTagElementType', - type: { - name: 'Composite', - className: 'IpTag' - } - } - } - }, - ipAddress: { - required: false, - serializedName: 'properties.ipAddress', - type: { - name: 'String' - } - }, - publicIPPrefix: { - required: false, - serializedName: 'properties.publicIPPrefix', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - idleTimeoutInMinutes: { - required: false, - serializedName: 'properties.idleTimeoutInMinutes', - type: { - name: 'Number' - } - }, - resourceGuid: { - required: false, - serializedName: 'properties.resourceGuid', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - }, - zones: { - required: false, - serializedName: 'zones', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - } - } - } - }; - } -} - -module.exports = PublicIPAddress; diff --git a/lib/services/networkManagement2/lib/models/publicIPAddressDnsSettings.js b/lib/services/networkManagement2/lib/models/publicIPAddressDnsSettings.js deleted file mode 100644 index 2b78e949c..000000000 --- a/lib/services/networkManagement2/lib/models/publicIPAddressDnsSettings.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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'; - -/** - * Contains FQDN of the DNS record associated with the public IP address - * - */ -class PublicIPAddressDnsSettings { - /** - * Create a PublicIPAddressDnsSettings. - * @property {string} [domainNameLabel] Gets or sets the Domain name - * label.The concatenation of the domain name label and the regionalized DNS - * zone make up the fully qualified domain name associated with the public IP - * address. If a domain name label is specified, an A DNS record is created - * for the public IP in the Microsoft Azure DNS system. - * @property {string} [fqdn] Gets the FQDN, Fully qualified domain name of - * the A DNS record associated with the public IP. This is the concatenation - * of the domainNameLabel and the regionalized DNS zone. - * @property {string} [reverseFqdn] Gets or Sets the Reverse FQDN. A - * user-visible, fully qualified domain name that resolves to this public IP - * address. If the reverseFqdn is specified, then a PTR DNS record is created - * pointing from the IP address in the in-addr.arpa domain to the reverse - * FQDN. - */ - constructor() { - } - - /** - * Defines the metadata of PublicIPAddressDnsSettings - * - * @returns {object} metadata of PublicIPAddressDnsSettings - * - */ - mapper() { - return { - required: false, - serializedName: 'PublicIPAddressDnsSettings', - type: { - name: 'Composite', - className: 'PublicIPAddressDnsSettings', - modelProperties: { - domainNameLabel: { - required: false, - serializedName: 'domainNameLabel', - type: { - name: 'String' - } - }, - fqdn: { - required: false, - serializedName: 'fqdn', - type: { - name: 'String' - } - }, - reverseFqdn: { - required: false, - serializedName: 'reverseFqdn', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = PublicIPAddressDnsSettings; diff --git a/lib/services/networkManagement2/lib/models/publicIPAddressListResult.js b/lib/services/networkManagement2/lib/models/publicIPAddressListResult.js deleted file mode 100644 index 9baed5f64..000000000 --- a/lib/services/networkManagement2/lib/models/publicIPAddressListResult.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 ListPublicIpAddresses API service call. - */ -class PublicIPAddressListResult extends Array { - /** - * Create a PublicIPAddressListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of PublicIPAddressListResult - * - * @returns {object} metadata of PublicIPAddressListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'PublicIPAddressListResult', - type: { - name: 'Composite', - className: 'PublicIPAddressListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'PublicIPAddressElementType', - type: { - name: 'Composite', - className: 'PublicIPAddress' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = PublicIPAddressListResult; diff --git a/lib/services/networkManagement2/lib/models/publicIPAddressSku.js b/lib/services/networkManagement2/lib/models/publicIPAddressSku.js deleted file mode 100644 index 4b51a49f7..000000000 --- a/lib/services/networkManagement2/lib/models/publicIPAddressSku.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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'; - -/** - * SKU of a public IP address - * - */ -class PublicIPAddressSku { - /** - * Create a PublicIPAddressSku. - * @property {string} [name] Name of a public IP address SKU. Possible values - * include: 'Basic', 'Standard' - */ - constructor() { - } - - /** - * Defines the metadata of PublicIPAddressSku - * - * @returns {object} metadata of PublicIPAddressSku - * - */ - mapper() { - return { - required: false, - serializedName: 'PublicIPAddressSku', - type: { - name: 'Composite', - className: 'PublicIPAddressSku', - modelProperties: { - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = PublicIPAddressSku; diff --git a/lib/services/networkManagement2/lib/models/publicIPPrefix.js b/lib/services/networkManagement2/lib/models/publicIPPrefix.js deleted file mode 100644 index 86392b0ed..000000000 --- a/lib/services/networkManagement2/lib/models/publicIPPrefix.js +++ /dev/null @@ -1,207 +0,0 @@ -/* - * 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'); - -/** - * Public IP prefix resource. - * - * @extends models['Resource'] - */ -class PublicIPPrefix extends models['Resource'] { - /** - * Create a PublicIPPrefix. - * @property {object} [sku] The public IP prefix SKU. - * @property {string} [sku.name] Name of a public IP prefix SKU. Possible - * values include: 'Standard' - * @property {string} [publicIPAddressVersion] The public IP address version. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * @property {array} [ipTags] The list of tags associated with the public IP - * prefix. - * @property {number} [prefixLength] The Length of the Public IP Prefix. - * @property {string} [ipPrefix] The allocated Prefix - * @property {array} [publicIPAddresses] The list of all referenced - * PublicIPAddresses - * @property {string} [resourceGuid] The resource GUID property of the public - * IP prefix resource. - * @property {string} [provisioningState] The provisioning state of the - * Public IP prefix resource. Possible values are: 'Updating', 'Deleting', - * and 'Failed'. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - * @property {array} [zones] A list of availability zones denoting the IP - * allocated for the resource needs to come from. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of PublicIPPrefix - * - * @returns {object} metadata of PublicIPPrefix - * - */ - mapper() { - return { - required: false, - serializedName: 'PublicIPPrefix', - type: { - name: 'Composite', - className: 'PublicIPPrefix', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - sku: { - required: false, - serializedName: 'sku', - type: { - name: 'Composite', - className: 'PublicIPPrefixSku' - } - }, - publicIPAddressVersion: { - required: false, - serializedName: 'properties.publicIPAddressVersion', - type: { - name: 'String' - } - }, - ipTags: { - required: false, - serializedName: 'properties.ipTags', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'IpTagElementType', - type: { - name: 'Composite', - className: 'IpTag' - } - } - } - }, - prefixLength: { - required: false, - serializedName: 'properties.prefixLength', - type: { - name: 'Number' - } - }, - ipPrefix: { - required: false, - serializedName: 'properties.ipPrefix', - type: { - name: 'String' - } - }, - publicIPAddresses: { - required: false, - serializedName: 'properties.publicIPAddresses', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ReferencedPublicIpAddressElementType', - type: { - name: 'Composite', - className: 'ReferencedPublicIpAddress' - } - } - } - }, - resourceGuid: { - required: false, - serializedName: 'properties.resourceGuid', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - }, - zones: { - required: false, - serializedName: 'zones', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - } - } - } - }; - } -} - -module.exports = PublicIPPrefix; diff --git a/lib/services/networkManagement2/lib/models/publicIPPrefixListResult.js b/lib/services/networkManagement2/lib/models/publicIPPrefixListResult.js deleted file mode 100644 index f74416a96..000000000 --- a/lib/services/networkManagement2/lib/models/publicIPPrefixListResult.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 ListPublicIpPrefixes API service call. - */ -class PublicIPPrefixListResult extends Array { - /** - * Create a PublicIPPrefixListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of PublicIPPrefixListResult - * - * @returns {object} metadata of PublicIPPrefixListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'PublicIPPrefixListResult', - type: { - name: 'Composite', - className: 'PublicIPPrefixListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'PublicIPPrefixElementType', - type: { - name: 'Composite', - className: 'PublicIPPrefix' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = PublicIPPrefixListResult; diff --git a/lib/services/networkManagement2/lib/models/publicIPPrefixSku.js b/lib/services/networkManagement2/lib/models/publicIPPrefixSku.js deleted file mode 100644 index f9ce9a7be..000000000 --- a/lib/services/networkManagement2/lib/models/publicIPPrefixSku.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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'; - -/** - * SKU of a public IP prefix - * - */ -class PublicIPPrefixSku { - /** - * Create a PublicIPPrefixSku. - * @property {string} [name] Name of a public IP prefix SKU. Possible values - * include: 'Standard' - */ - constructor() { - } - - /** - * Defines the metadata of PublicIPPrefixSku - * - * @returns {object} metadata of PublicIPPrefixSku - * - */ - mapper() { - return { - required: false, - serializedName: 'PublicIPPrefixSku', - type: { - name: 'Composite', - className: 'PublicIPPrefixSku', - modelProperties: { - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = PublicIPPrefixSku; diff --git a/lib/services/networkManagement2/lib/models/queryTroubleshootingParameters.js b/lib/services/networkManagement2/lib/models/queryTroubleshootingParameters.js deleted file mode 100644 index 26952c93d..000000000 --- a/lib/services/networkManagement2/lib/models/queryTroubleshootingParameters.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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'; - -/** - * Parameters that define the resource to query the troubleshooting result. - * - */ -class QueryTroubleshootingParameters { - /** - * Create a QueryTroubleshootingParameters. - * @property {string} targetResourceId The target resource ID to query the - * troubleshooting result. - */ - constructor() { - } - - /** - * Defines the metadata of QueryTroubleshootingParameters - * - * @returns {object} metadata of QueryTroubleshootingParameters - * - */ - mapper() { - return { - required: false, - serializedName: 'QueryTroubleshootingParameters', - type: { - name: 'Composite', - className: 'QueryTroubleshootingParameters', - modelProperties: { - targetResourceId: { - required: true, - serializedName: 'targetResourceId', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = QueryTroubleshootingParameters; diff --git a/lib/services/networkManagement2/lib/models/referencedPublicIpAddress.js b/lib/services/networkManagement2/lib/models/referencedPublicIpAddress.js deleted file mode 100644 index 9e7149557..000000000 --- a/lib/services/networkManagement2/lib/models/referencedPublicIpAddress.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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'; - -/** - * Class representing a ReferencedPublicIpAddress. - */ -class ReferencedPublicIpAddress { - /** - * Create a ReferencedPublicIpAddress. - * @property {string} [id] The PublicIPAddress Reference - */ - constructor() { - } - - /** - * Defines the metadata of ReferencedPublicIpAddress - * - * @returns {object} metadata of ReferencedPublicIpAddress - * - */ - mapper() { - return { - required: false, - serializedName: 'ReferencedPublicIpAddress', - type: { - name: 'Composite', - className: 'ReferencedPublicIpAddress', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ReferencedPublicIpAddress; diff --git a/lib/services/networkManagement2/lib/models/resource.js b/lib/services/networkManagement2/lib/models/resource.js deleted file mode 100644 index c220802ef..000000000 --- a/lib/services/networkManagement2/lib/models/resource.js +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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'); - -/** - * Common resource representation. - * - * @extends models['BaseResource'] - */ -class Resource extends models['BaseResource'] { - /** - * Create a Resource. - * @property {string} [id] Resource ID. - * @property {string} [name] Resource name. - * @property {string} [type] Resource type. - * @property {string} [location] Resource location. - * @property {object} [tags] Resource tags. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of Resource - * - * @returns {object} metadata of Resource - * - */ - mapper() { - return { - required: false, - serializedName: 'Resource', - type: { - name: 'Composite', - className: 'Resource', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - } - } - } - }; - } -} - -module.exports = Resource; diff --git a/lib/services/networkManagement2/lib/models/resourceNavigationLink.js b/lib/services/networkManagement2/lib/models/resourceNavigationLink.js deleted file mode 100644 index 84e4e0889..000000000 --- a/lib/services/networkManagement2/lib/models/resourceNavigationLink.js +++ /dev/null @@ -1,101 +0,0 @@ -/* - * 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'); - -/** - * ResourceNavigationLink resource. - * - * @extends models['SubResource'] - */ -class ResourceNavigationLink extends models['SubResource'] { - /** - * Create a ResourceNavigationLink. - * @property {string} [linkedResourceType] Resource type of the linked - * resource. - * @property {string} [link] Link to the external resource - * @property {string} [provisioningState] Provisioning state of the - * ResourceNavigationLink resource. - * @property {string} [name] 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 ResourceNavigationLink - * - * @returns {object} metadata of ResourceNavigationLink - * - */ - mapper() { - return { - required: false, - serializedName: 'ResourceNavigationLink', - type: { - name: 'Composite', - className: 'ResourceNavigationLink', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - linkedResourceType: { - required: false, - serializedName: 'properties.linkedResourceType', - type: { - name: 'String' - } - }, - link: { - required: false, - serializedName: 'properties.link', - 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 = ResourceNavigationLink; diff --git a/lib/services/networkManagement2/lib/models/retentionPolicyParameters.js b/lib/services/networkManagement2/lib/models/retentionPolicyParameters.js deleted file mode 100644 index fe32bc2fe..000000000 --- a/lib/services/networkManagement2/lib/models/retentionPolicyParameters.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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'; - -/** - * Parameters that define the retention policy for flow log. - * - */ -class RetentionPolicyParameters { - /** - * Create a RetentionPolicyParameters. - * @property {number} [days] Number of days to retain flow log records. - * Default value: 0 . - * @property {boolean} [enabled] Flag to enable/disable retention. Default - * value: false . - */ - constructor() { - } - - /** - * Defines the metadata of RetentionPolicyParameters - * - * @returns {object} metadata of RetentionPolicyParameters - * - */ - mapper() { - return { - required: false, - serializedName: 'RetentionPolicyParameters', - type: { - name: 'Composite', - className: 'RetentionPolicyParameters', - modelProperties: { - days: { - required: false, - serializedName: 'days', - defaultValue: 0, - type: { - name: 'Number' - } - }, - enabled: { - required: false, - serializedName: 'enabled', - defaultValue: false, - type: { - name: 'Boolean' - } - } - } - } - }; - } -} - -module.exports = RetentionPolicyParameters; diff --git a/lib/services/networkManagement2/lib/models/route.js b/lib/services/networkManagement2/lib/models/route.js deleted file mode 100644 index e5d5060e7..000000000 --- a/lib/services/networkManagement2/lib/models/route.js +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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'); - -/** - * Route resource - * - * @extends models['SubResource'] - */ -class Route extends models['SubResource'] { - /** - * Create a Route. - * @property {string} [addressPrefix] The destination CIDR to which the route - * applies. - * @property {string} nextHopType The type of Azure hop the packet should be - * sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', - * 'Internet', 'VirtualAppliance', and 'None'. Possible values include: - * 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', - * 'None' - * @property {string} [nextHopIpAddress] The IP address packets should be - * forwarded to. Next hop values are only allowed in routes where the next - * hop type is VirtualAppliance. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [name] The 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 Route - * - * @returns {object} metadata of Route - * - */ - mapper() { - return { - required: false, - serializedName: 'Route', - type: { - name: 'Composite', - className: 'Route', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - addressPrefix: { - required: false, - serializedName: 'properties.addressPrefix', - type: { - name: 'String' - } - }, - nextHopType: { - required: true, - serializedName: 'properties.nextHopType', - type: { - name: 'String' - } - }, - nextHopIpAddress: { - required: false, - serializedName: 'properties.nextHopIpAddress', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = Route; diff --git a/lib/services/networkManagement2/lib/models/routeFilter.js b/lib/services/networkManagement2/lib/models/routeFilter.js deleted file mode 100644 index 9ea6b7ebf..000000000 --- a/lib/services/networkManagement2/lib/models/routeFilter.js +++ /dev/null @@ -1,147 +0,0 @@ -/* - * 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'); - -/** - * Route Filter Resource. - * - * @extends models['Resource'] - */ -class RouteFilter extends models['Resource'] { - /** - * Create a RouteFilter. - * @property {array} [rules] Collection of RouteFilterRules contained within - * a route filter. - * @property {array} [peerings] A collection of references to express route - * circuit peerings. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and - * 'Failed'. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of RouteFilter - * - * @returns {object} metadata of RouteFilter - * - */ - mapper() { - return { - required: false, - serializedName: 'RouteFilter', - type: { - name: 'Composite', - className: 'RouteFilter', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - rules: { - required: false, - serializedName: 'properties.rules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'RouteFilterRuleElementType', - type: { - name: 'Composite', - className: 'RouteFilterRule' - } - } - } - }, - peerings: { - required: false, - serializedName: 'properties.peerings', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ExpressRouteCircuitPeeringElementType', - type: { - name: 'Composite', - className: 'ExpressRouteCircuitPeering' - } - } - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - etag: { - required: false, - readOnly: true, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = RouteFilter; diff --git a/lib/services/networkManagement2/lib/models/routeFilterListResult.js b/lib/services/networkManagement2/lib/models/routeFilterListResult.js deleted file mode 100644 index 4de8a1b91..000000000 --- a/lib/services/networkManagement2/lib/models/routeFilterListResult.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 the ListRouteFilters API service call. - */ -class RouteFilterListResult extends Array { - /** - * Create a RouteFilterListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of RouteFilterListResult - * - * @returns {object} metadata of RouteFilterListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'RouteFilterListResult', - type: { - name: 'Composite', - className: 'RouteFilterListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'RouteFilterElementType', - type: { - name: 'Composite', - className: 'RouteFilter' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = RouteFilterListResult; diff --git a/lib/services/networkManagement2/lib/models/routeFilterRule.js b/lib/services/networkManagement2/lib/models/routeFilterRule.js deleted file mode 100644 index b02d449f6..000000000 --- a/lib/services/networkManagement2/lib/models/routeFilterRule.js +++ /dev/null @@ -1,127 +0,0 @@ -/* - * 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'); - -/** - * Route Filter Rule Resource - * - * @extends models['SubResource'] - */ -class RouteFilterRule extends models['SubResource'] { - /** - * Create a RouteFilterRule. - * @property {string} access The access type of the rule. Valid values are: - * 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' - * @property {array} communities The collection for bgp community values to - * filter on. e.g. ['12076:5010','12076:5020'] - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and - * 'Failed'. - * @property {string} [name] The name of the resource that is unique within a - * resource group. This name can be used to access the resource. - * @property {string} [location] Resource location. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of RouteFilterRule - * - * @returns {object} metadata of RouteFilterRule - * - */ - mapper() { - return { - required: false, - serializedName: 'RouteFilterRule', - type: { - name: 'Composite', - className: 'RouteFilterRule', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - access: { - required: true, - serializedName: 'properties.access', - type: { - name: 'String' - } - }, - routeFilterRuleType: { - required: true, - isConstant: true, - serializedName: 'properties.routeFilterRuleType', - defaultValue: 'Community', - type: { - name: 'String' - } - }, - communities: { - required: true, - serializedName: 'properties.communities', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - etag: { - required: false, - readOnly: true, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = RouteFilterRule; diff --git a/lib/services/networkManagement2/lib/models/routeFilterRuleListResult.js b/lib/services/networkManagement2/lib/models/routeFilterRuleListResult.js deleted file mode 100644 index 21c158f52..000000000 --- a/lib/services/networkManagement2/lib/models/routeFilterRuleListResult.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 the ListRouteFilterRules API service call - */ -class RouteFilterRuleListResult extends Array { - /** - * Create a RouteFilterRuleListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of RouteFilterRuleListResult - * - * @returns {object} metadata of RouteFilterRuleListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'RouteFilterRuleListResult', - type: { - name: 'Composite', - className: 'RouteFilterRuleListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'RouteFilterRuleElementType', - type: { - name: 'Composite', - className: 'RouteFilterRule' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = RouteFilterRuleListResult; diff --git a/lib/services/networkManagement2/lib/models/routeListResult.js b/lib/services/networkManagement2/lib/models/routeListResult.js deleted file mode 100644 index e90ab9dd6..000000000 --- a/lib/services/networkManagement2/lib/models/routeListResult.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 the ListRoute API service call - */ -class RouteListResult extends Array { - /** - * Create a RouteListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of RouteListResult - * - * @returns {object} metadata of RouteListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'RouteListResult', - type: { - name: 'Composite', - className: 'RouteListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'RouteElementType', - type: { - name: 'Composite', - className: 'Route' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = RouteListResult; diff --git a/lib/services/networkManagement2/lib/models/routeTable.js b/lib/services/networkManagement2/lib/models/routeTable.js deleted file mode 100644 index bedf8cc4e..000000000 --- a/lib/services/networkManagement2/lib/models/routeTable.js +++ /dev/null @@ -1,153 +0,0 @@ -/* - * 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'); - -/** - * Route table resource. - * - * @extends models['Resource'] - */ -class RouteTable extends models['Resource'] { - /** - * Create a RouteTable. - * @property {array} [routes] Collection of routes contained within a route - * table. - * @property {array} [subnets] A collection of references to subnets. - * @property {boolean} [disableBgpRoutePropagation] Gets or sets whether to - * disable the routes learned by BGP on that route table. True means disable. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of RouteTable - * - * @returns {object} metadata of RouteTable - * - */ - mapper() { - return { - required: false, - serializedName: 'RouteTable', - type: { - name: 'Composite', - className: 'RouteTable', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - routes: { - required: false, - serializedName: 'properties.routes', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'RouteElementType', - type: { - name: 'Composite', - className: 'Route' - } - } - } - }, - subnets: { - required: false, - readOnly: true, - serializedName: 'properties.subnets', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SubnetElementType', - type: { - name: 'Composite', - className: 'Subnet' - } - } - } - }, - disableBgpRoutePropagation: { - required: false, - serializedName: 'properties.disableBgpRoutePropagation', - type: { - name: 'Boolean' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = RouteTable; diff --git a/lib/services/networkManagement2/lib/models/routeTableListResult.js b/lib/services/networkManagement2/lib/models/routeTableListResult.js deleted file mode 100644 index 5498bc590..000000000 --- a/lib/services/networkManagement2/lib/models/routeTableListResult.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 the ListRouteTable API service call. - */ -class RouteTableListResult extends Array { - /** - * Create a RouteTableListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of RouteTableListResult - * - * @returns {object} metadata of RouteTableListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'RouteTableListResult', - type: { - name: 'Composite', - className: 'RouteTableListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'RouteTableElementType', - type: { - name: 'Composite', - className: 'RouteTable' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = RouteTableListResult; diff --git a/lib/services/networkManagement2/lib/models/securityGroupNetworkInterface.js b/lib/services/networkManagement2/lib/models/securityGroupNetworkInterface.js deleted file mode 100644 index e45ddcfb5..000000000 --- a/lib/services/networkManagement2/lib/models/securityGroupNetworkInterface.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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'; - -/** - * Network interface and all its associated security rules. - * - */ -class SecurityGroupNetworkInterface { - /** - * Create a SecurityGroupNetworkInterface. - * @property {string} [id] ID of the network interface. - * @property {object} [securityRuleAssociations] - * @property {object} [securityRuleAssociations.networkInterfaceAssociation] - * @property {string} - * [securityRuleAssociations.networkInterfaceAssociation.id] Network - * interface ID. - * @property {array} - * [securityRuleAssociations.networkInterfaceAssociation.securityRules] - * Collection of custom security rules. - * @property {object} [securityRuleAssociations.subnetAssociation] - * @property {string} [securityRuleAssociations.subnetAssociation.id] Subnet - * ID. - * @property {array} - * [securityRuleAssociations.subnetAssociation.securityRules] Collection of - * custom security rules. - * @property {array} [securityRuleAssociations.defaultSecurityRules] - * Collection of default security rules of the network security group. - * @property {array} [securityRuleAssociations.effectiveSecurityRules] - * Collection of effective security rules. - */ - constructor() { - } - - /** - * Defines the metadata of SecurityGroupNetworkInterface - * - * @returns {object} metadata of SecurityGroupNetworkInterface - * - */ - mapper() { - return { - required: false, - serializedName: 'SecurityGroupNetworkInterface', - type: { - name: 'Composite', - className: 'SecurityGroupNetworkInterface', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - securityRuleAssociations: { - required: false, - serializedName: 'securityRuleAssociations', - type: { - name: 'Composite', - className: 'SecurityRuleAssociations' - } - } - } - } - }; - } -} - -module.exports = SecurityGroupNetworkInterface; diff --git a/lib/services/networkManagement2/lib/models/securityGroupViewParameters.js b/lib/services/networkManagement2/lib/models/securityGroupViewParameters.js deleted file mode 100644 index b93b5445f..000000000 --- a/lib/services/networkManagement2/lib/models/securityGroupViewParameters.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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'; - -/** - * Parameters that define the VM to check security groups for. - * - */ -class SecurityGroupViewParameters { - /** - * Create a SecurityGroupViewParameters. - * @property {string} targetResourceId ID of the target VM. - */ - constructor() { - } - - /** - * Defines the metadata of SecurityGroupViewParameters - * - * @returns {object} metadata of SecurityGroupViewParameters - * - */ - mapper() { - return { - required: false, - serializedName: 'SecurityGroupViewParameters', - type: { - name: 'Composite', - className: 'SecurityGroupViewParameters', - modelProperties: { - targetResourceId: { - required: true, - serializedName: 'targetResourceId', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = SecurityGroupViewParameters; diff --git a/lib/services/networkManagement2/lib/models/securityGroupViewResult.js b/lib/services/networkManagement2/lib/models/securityGroupViewResult.js deleted file mode 100644 index 06cb6c490..000000000 --- a/lib/services/networkManagement2/lib/models/securityGroupViewResult.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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'; - -/** - * The information about security rules applied to the specified VM. - * - */ -class SecurityGroupViewResult { - /** - * Create a SecurityGroupViewResult. - * @property {array} [networkInterfaces] List of network interfaces on the - * specified VM. - */ - constructor() { - } - - /** - * Defines the metadata of SecurityGroupViewResult - * - * @returns {object} metadata of SecurityGroupViewResult - * - */ - mapper() { - return { - required: false, - serializedName: 'SecurityGroupViewResult', - type: { - name: 'Composite', - className: 'SecurityGroupViewResult', - modelProperties: { - networkInterfaces: { - required: false, - serializedName: 'networkInterfaces', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SecurityGroupNetworkInterfaceElementType', - type: { - name: 'Composite', - className: 'SecurityGroupNetworkInterface' - } - } - } - } - } - } - }; - } -} - -module.exports = SecurityGroupViewResult; diff --git a/lib/services/networkManagement2/lib/models/securityRule.js b/lib/services/networkManagement2/lib/models/securityRule.js deleted file mode 100644 index a40f02a12..000000000 --- a/lib/services/networkManagement2/lib/models/securityRule.js +++ /dev/null @@ -1,271 +0,0 @@ -/* - * 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'); - -/** - * Network security rule. - * - * @extends models['SubResource'] - */ -class SecurityRule extends models['SubResource'] { - /** - * Create a SecurityRule. - * @property {string} [description] A description for this rule. Restricted - * to 140 chars. - * @property {string} protocol Network protocol this rule applies to. - * Possible values are 'Tcp', 'Udp', and '*'. Possible values include: 'Tcp', - * 'Udp', '*' - * @property {string} [sourcePortRange] The source port or range. Integer or - * range between 0 and 65535. Asterix '*' can also be used to match all - * ports. - * @property {string} [destinationPortRange] The destination port or range. - * Integer or range between 0 and 65535. Asterix '*' can also be used to - * match all ports. - * @property {string} [sourceAddressPrefix] The CIDR or source IP range. - * Asterix '*' can also be used to match all source IPs. Default tags such as - * 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If - * this is an ingress rule, specifies where network traffic originates from. - * @property {array} [sourceAddressPrefixes] The CIDR or source IP ranges. - * @property {array} [sourceApplicationSecurityGroups] The application - * security group specified as source. - * @property {string} [destinationAddressPrefix] The destination address - * prefix. CIDR or destination IP range. Asterix '*' can also be used to - * match all source IPs. Default tags such as 'VirtualNetwork', - * 'AzureLoadBalancer' and 'Internet' can also be used. - * @property {array} [destinationAddressPrefixes] The destination address - * prefixes. CIDR or destination IP ranges. - * @property {array} [destinationApplicationSecurityGroups] The application - * security group specified as destination. - * @property {array} [sourcePortRanges] The source port ranges. - * @property {array} [destinationPortRanges] The destination port ranges. - * @property {string} access The network traffic is allowed or denied. - * Possible values are: 'Allow' and 'Deny'. Possible values include: 'Allow', - * 'Deny' - * @property {number} [priority] The priority of the rule. The value can be - * between 100 and 4096. The priority number must be unique for each rule in - * the collection. The lower the priority number, the higher the priority of - * the rule. - * @property {string} direction The direction of the rule. The direction - * specifies if rule will be evaluated on incoming or outcoming traffic. - * Possible values are: 'Inbound' and 'Outbound'. Possible values include: - * 'Inbound', 'Outbound' - * @property {string} [provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [name] The 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 SecurityRule - * - * @returns {object} metadata of SecurityRule - * - */ - mapper() { - return { - required: false, - serializedName: 'SecurityRule', - type: { - name: 'Composite', - className: 'SecurityRule', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - description: { - required: false, - serializedName: 'properties.description', - type: { - name: 'String' - } - }, - protocol: { - required: true, - serializedName: 'properties.protocol', - type: { - name: 'String' - } - }, - sourcePortRange: { - required: false, - serializedName: 'properties.sourcePortRange', - type: { - name: 'String' - } - }, - destinationPortRange: { - required: false, - serializedName: 'properties.destinationPortRange', - type: { - name: 'String' - } - }, - sourceAddressPrefix: { - required: false, - serializedName: 'properties.sourceAddressPrefix', - type: { - name: 'String' - } - }, - sourceAddressPrefixes: { - required: false, - serializedName: 'properties.sourceAddressPrefixes', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - sourceApplicationSecurityGroups: { - required: false, - serializedName: 'properties.sourceApplicationSecurityGroups', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationSecurityGroupElementType', - type: { - name: 'Composite', - className: 'ApplicationSecurityGroup' - } - } - } - }, - destinationAddressPrefix: { - required: false, - serializedName: 'properties.destinationAddressPrefix', - type: { - name: 'String' - } - }, - destinationAddressPrefixes: { - required: false, - serializedName: 'properties.destinationAddressPrefixes', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - destinationApplicationSecurityGroups: { - required: false, - serializedName: 'properties.destinationApplicationSecurityGroups', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ApplicationSecurityGroupElementType', - type: { - name: 'Composite', - className: 'ApplicationSecurityGroup' - } - } - } - }, - sourcePortRanges: { - required: false, - serializedName: 'properties.sourcePortRanges', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - destinationPortRanges: { - required: false, - serializedName: 'properties.destinationPortRanges', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - access: { - required: true, - serializedName: 'properties.access', - type: { - name: 'String' - } - }, - priority: { - required: false, - serializedName: 'properties.priority', - type: { - name: 'Number' - } - }, - direction: { - required: true, - serializedName: 'properties.direction', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = SecurityRule; diff --git a/lib/services/networkManagement2/lib/models/securityRuleAssociations.js b/lib/services/networkManagement2/lib/models/securityRuleAssociations.js deleted file mode 100644 index 1a322cc92..000000000 --- a/lib/services/networkManagement2/lib/models/securityRuleAssociations.js +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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'; - -/** - * All security rules associated with the network interface. - * - */ -class SecurityRuleAssociations { - /** - * Create a SecurityRuleAssociations. - * @property {object} [networkInterfaceAssociation] - * @property {string} [networkInterfaceAssociation.id] Network interface ID. - * @property {array} [networkInterfaceAssociation.securityRules] Collection - * of custom security rules. - * @property {object} [subnetAssociation] - * @property {string} [subnetAssociation.id] Subnet ID. - * @property {array} [subnetAssociation.securityRules] Collection of custom - * security rules. - * @property {array} [defaultSecurityRules] Collection of default security - * rules of the network security group. - * @property {array} [effectiveSecurityRules] Collection of effective - * security rules. - */ - constructor() { - } - - /** - * Defines the metadata of SecurityRuleAssociations - * - * @returns {object} metadata of SecurityRuleAssociations - * - */ - mapper() { - return { - required: false, - serializedName: 'SecurityRuleAssociations', - type: { - name: 'Composite', - className: 'SecurityRuleAssociations', - modelProperties: { - networkInterfaceAssociation: { - required: false, - serializedName: 'networkInterfaceAssociation', - type: { - name: 'Composite', - className: 'NetworkInterfaceAssociation' - } - }, - subnetAssociation: { - required: false, - serializedName: 'subnetAssociation', - type: { - name: 'Composite', - className: 'SubnetAssociation' - } - }, - defaultSecurityRules: { - required: false, - serializedName: 'defaultSecurityRules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SecurityRuleElementType', - type: { - name: 'Composite', - className: 'SecurityRule' - } - } - } - }, - effectiveSecurityRules: { - required: false, - serializedName: 'effectiveSecurityRules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'EffectiveNetworkSecurityRuleElementType', - type: { - name: 'Composite', - className: 'EffectiveNetworkSecurityRule' - } - } - } - } - } - } - }; - } -} - -module.exports = SecurityRuleAssociations; diff --git a/lib/services/networkManagement2/lib/models/securityRuleListResult.js b/lib/services/networkManagement2/lib/models/securityRuleListResult.js deleted file mode 100644 index 4a6eae986..000000000 --- a/lib/services/networkManagement2/lib/models/securityRuleListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 ListSecurityRule API service call. Retrieves all security rules - * that belongs to a network security group. - */ -class SecurityRuleListResult extends Array { - /** - * Create a SecurityRuleListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of SecurityRuleListResult - * - * @returns {object} metadata of SecurityRuleListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'SecurityRuleListResult', - type: { - name: 'Composite', - className: 'SecurityRuleListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SecurityRuleElementType', - type: { - name: 'Composite', - className: 'SecurityRule' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = SecurityRuleListResult; diff --git a/lib/services/networkManagement2/lib/models/serviceAssociationLink.js b/lib/services/networkManagement2/lib/models/serviceAssociationLink.js deleted file mode 100644 index 0e5e80067..000000000 --- a/lib/services/networkManagement2/lib/models/serviceAssociationLink.js +++ /dev/null @@ -1,101 +0,0 @@ -/* - * 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'); - -/** - * ServiceAssociationLink resource. - * - * @extends models['SubResource'] - */ -class ServiceAssociationLink extends models['SubResource'] { - /** - * Create a ServiceAssociationLink. - * @property {string} [linkedResourceType] Resource type of the linked - * resource. - * @property {string} [link] Link to the external resource. - * @property {string} [provisioningState] Provisioning state of the - * ServiceAssociationLink resource. - * @property {string} [name] 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 ServiceAssociationLink - * - * @returns {object} metadata of ServiceAssociationLink - * - */ - mapper() { - return { - required: false, - serializedName: 'ServiceAssociationLink', - type: { - name: 'Composite', - className: 'ServiceAssociationLink', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - linkedResourceType: { - required: false, - serializedName: 'properties.linkedResourceType', - type: { - name: 'String' - } - }, - link: { - required: false, - serializedName: 'properties.link', - 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 = ServiceAssociationLink; diff --git a/lib/services/networkManagement2/lib/models/serviceEndpointPolicy.js b/lib/services/networkManagement2/lib/models/serviceEndpointPolicy.js deleted file mode 100644 index 8b47652fb..000000000 --- a/lib/services/networkManagement2/lib/models/serviceEndpointPolicy.js +++ /dev/null @@ -1,156 +0,0 @@ -/* - * 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'); - -/** - * Service End point policy resource. - * - * @extends models['Resource'] - */ -class ServiceEndpointPolicy extends models['Resource'] { - /** - * Create a ServiceEndpointPolicy. - * @property {array} [serviceEndpointPolicyDefinitions] A collection of - * service endpoint policy definitions of the service endpoint policy. - * @property {array} [subnets] A collection of references to subnets. - * @property {string} [resourceGuid] The resource GUID property of the - * service endpoint policy resource. - * @property {string} [provisioningState] The provisioning state of the - * service endpoint policy. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [etag] A unique read-only string that changes whenever - * the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ServiceEndpointPolicy - * - * @returns {object} metadata of ServiceEndpointPolicy - * - */ - mapper() { - return { - required: false, - serializedName: 'ServiceEndpointPolicy', - type: { - name: 'Composite', - className: 'ServiceEndpointPolicy', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - serviceEndpointPolicyDefinitions: { - required: false, - serializedName: 'properties.serviceEndpointPolicyDefinitions', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ServiceEndpointPolicyDefinitionElementType', - type: { - name: 'Composite', - className: 'ServiceEndpointPolicyDefinition' - } - } - } - }, - subnets: { - required: false, - readOnly: true, - serializedName: 'properties.subnets', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SubnetElementType', - type: { - name: 'Composite', - className: 'Subnet' - } - } - } - }, - resourceGuid: { - required: false, - readOnly: true, - serializedName: 'properties.resourceGuid', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ServiceEndpointPolicy; diff --git a/lib/services/networkManagement2/lib/models/serviceEndpointPolicyDefinition.js b/lib/services/networkManagement2/lib/models/serviceEndpointPolicyDefinition.js deleted file mode 100644 index 623b59ac0..000000000 --- a/lib/services/networkManagement2/lib/models/serviceEndpointPolicyDefinition.js +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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'); - -/** - * Service Endpoint policy definitions. - * - * @extends models['SubResource'] - */ -class ServiceEndpointPolicyDefinition extends models['SubResource'] { - /** - * Create a ServiceEndpointPolicyDefinition. - * @property {string} [description] A description for this rule. Restricted - * to 140 chars. - * @property {string} [service] service endpoint name. - * @property {array} [serviceResources] A list of service resources. - * @property {string} [provisioningState] The provisioning state of the - * service end point policy definition. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [name] The 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 ServiceEndpointPolicyDefinition - * - * @returns {object} metadata of ServiceEndpointPolicyDefinition - * - */ - mapper() { - return { - required: false, - serializedName: 'ServiceEndpointPolicyDefinition', - type: { - name: 'Composite', - className: 'ServiceEndpointPolicyDefinition', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - description: { - required: false, - serializedName: 'properties.description', - type: { - name: 'String' - } - }, - service: { - required: false, - serializedName: 'properties.service', - type: { - name: 'String' - } - }, - serviceResources: { - required: false, - serializedName: 'properties.serviceResources', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - 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, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ServiceEndpointPolicyDefinition; diff --git a/lib/services/networkManagement2/lib/models/serviceEndpointPolicyDefinitionListResult.js b/lib/services/networkManagement2/lib/models/serviceEndpointPolicyDefinitionListResult.js deleted file mode 100644 index 68e9f172d..000000000 --- a/lib/services/networkManagement2/lib/models/serviceEndpointPolicyDefinitionListResult.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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 ListServiceEndpointPolicyDefinition API service call. Retrieves - * all service endpoint policy definition that belongs to a service endpoint - * policy. - */ -class ServiceEndpointPolicyDefinitionListResult extends Array { - /** - * Create a ServiceEndpointPolicyDefinitionListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ServiceEndpointPolicyDefinitionListResult - * - * @returns {object} metadata of ServiceEndpointPolicyDefinitionListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ServiceEndpointPolicyDefinitionListResult', - type: { - name: 'Composite', - className: 'ServiceEndpointPolicyDefinitionListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ServiceEndpointPolicyDefinitionElementType', - type: { - name: 'Composite', - className: 'ServiceEndpointPolicyDefinition' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ServiceEndpointPolicyDefinitionListResult; diff --git a/lib/services/networkManagement2/lib/models/serviceEndpointPolicyListResult.js b/lib/services/networkManagement2/lib/models/serviceEndpointPolicyListResult.js deleted file mode 100644 index aae5392b5..000000000 --- a/lib/services/networkManagement2/lib/models/serviceEndpointPolicyListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 ListServiceEndpointPolicies API service call. - */ -class ServiceEndpointPolicyListResult extends Array { - /** - * Create a ServiceEndpointPolicyListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ServiceEndpointPolicyListResult - * - * @returns {object} metadata of ServiceEndpointPolicyListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'ServiceEndpointPolicyListResult', - type: { - name: 'Composite', - className: 'ServiceEndpointPolicyListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ServiceEndpointPolicyElementType', - type: { - name: 'Composite', - className: 'ServiceEndpointPolicy' - } - } - } - }, - nextLink: { - required: false, - readOnly: true, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ServiceEndpointPolicyListResult; diff --git a/lib/services/networkManagement2/lib/models/serviceEndpointPropertiesFormat.js b/lib/services/networkManagement2/lib/models/serviceEndpointPropertiesFormat.js deleted file mode 100644 index b3f5746af..000000000 --- a/lib/services/networkManagement2/lib/models/serviceEndpointPropertiesFormat.js +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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'; - -/** - * The service endpoint properties. - * - */ -class ServiceEndpointPropertiesFormat { - /** - * Create a ServiceEndpointPropertiesFormat. - * @property {string} [service] The type of the endpoint service. - * @property {array} [locations] A list of locations. - * @property {string} [provisioningState] The provisioning state of the - * resource. - */ - constructor() { - } - - /** - * Defines the metadata of ServiceEndpointPropertiesFormat - * - * @returns {object} metadata of ServiceEndpointPropertiesFormat - * - */ - mapper() { - return { - required: false, - serializedName: 'ServiceEndpointPropertiesFormat', - type: { - name: 'Composite', - className: 'ServiceEndpointPropertiesFormat', - modelProperties: { - service: { - required: false, - serializedName: 'service', - type: { - name: 'String' - } - }, - locations: { - required: false, - serializedName: 'locations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - provisioningState: { - required: false, - serializedName: 'provisioningState', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ServiceEndpointPropertiesFormat; diff --git a/lib/services/networkManagement2/lib/models/subResource.js b/lib/services/networkManagement2/lib/models/subResource.js deleted file mode 100644 index f59dea3bb..000000000 --- a/lib/services/networkManagement2/lib/models/subResource.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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'); - -/** - * Reference to another subresource. - * - * @extends models['BaseResource'] - */ -class SubResource extends models['BaseResource'] { - /** - * Create a SubResource. - * @property {string} [id] Resource ID. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of SubResource - * - * @returns {object} metadata of SubResource - * - */ - mapper() { - return { - required: false, - serializedName: 'SubResource', - type: { - name: 'Composite', - className: 'SubResource', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = SubResource; diff --git a/lib/services/networkManagement2/lib/models/subnet.js b/lib/services/networkManagement2/lib/models/subnet.js deleted file mode 100644 index e0d3e37db..000000000 --- a/lib/services/networkManagement2/lib/models/subnet.js +++ /dev/null @@ -1,301 +0,0 @@ -/* - * 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'); - -/** - * Subnet in a virtual network resource. - * - * @extends models['SubResource'] - */ -class Subnet extends models['SubResource'] { - /** - * Create a Subnet. - * @property {string} [addressPrefix] The address prefix for the subnet. - * @property {array} [addressPrefixes] List of address prefixes for the - * subnet. - * @property {object} [networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * @property {array} [networkSecurityGroup.securityRules] A collection of - * security rules of the network security group. - * @property {array} [networkSecurityGroup.defaultSecurityRules] The default - * security rules of network security group. - * @property {array} [networkSecurityGroup.networkInterfaces] A collection of - * references to network interfaces. - * @property {array} [networkSecurityGroup.subnets] A collection of - * references to subnets. - * @property {string} [networkSecurityGroup.resourceGuid] The resource GUID - * property of the network security group resource. - * @property {string} [networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [networkSecurityGroup.etag] A unique read-only string - * that changes whenever the resource is updated. - * @property {object} [routeTable] The reference of the RouteTable resource. - * @property {array} [routeTable.routes] Collection of routes contained - * within a route table. - * @property {array} [routeTable.subnets] A collection of references to - * subnets. - * @property {boolean} [routeTable.disableBgpRoutePropagation] Gets or sets - * whether to disable the routes learned by BGP on that route table. True - * means disable. - * @property {string} [routeTable.provisioningState] The provisioning state - * of the resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [routeTable.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * @property {array} [serviceEndpoints] An array of service endpoints. - * @property {array} [serviceEndpointPolicies] An array of service endpoint - * policies. - * @property {array} [interfaceEndpoints] An array of references to interface - * endpoints - * @property {array} [ipConfigurations] Gets an array of references to the - * network interface IP configurations using subnet. - * @property {array} [ipConfigurationProfiles] Array of IP configuration - * profiles which reference this subnet. - * @property {array} [resourceNavigationLinks] Gets an array of references to - * the external resources using subnet. - * @property {array} [serviceAssociationLinks] Gets an array of references to - * services injecting into this subnet. - * @property {array} [delegations] Gets an array of references to the - * delegations on the subnet. - * @property {string} [purpose] A read-only string identifying the intention - * of use for this subnet based on delegations and other user-defined - * properties. - * @property {string} [provisioningState] The provisioning state of the - * resource. - * @property {string} [name] The 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 Subnet - * - * @returns {object} metadata of Subnet - * - */ - mapper() { - return { - required: false, - serializedName: 'Subnet', - type: { - name: 'Composite', - className: 'Subnet', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - addressPrefix: { - required: false, - serializedName: 'properties.addressPrefix', - type: { - name: 'String' - } - }, - addressPrefixes: { - required: false, - serializedName: 'properties.addressPrefixes', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - networkSecurityGroup: { - required: false, - serializedName: 'properties.networkSecurityGroup', - type: { - name: 'Composite', - className: 'NetworkSecurityGroup' - } - }, - routeTable: { - required: false, - serializedName: 'properties.routeTable', - type: { - name: 'Composite', - className: 'RouteTable' - } - }, - serviceEndpoints: { - required: false, - serializedName: 'properties.serviceEndpoints', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ServiceEndpointPropertiesFormatElementType', - type: { - name: 'Composite', - className: 'ServiceEndpointPropertiesFormat' - } - } - } - }, - serviceEndpointPolicies: { - required: false, - serializedName: 'properties.serviceEndpointPolicies', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ServiceEndpointPolicyElementType', - type: { - name: 'Composite', - className: 'ServiceEndpointPolicy' - } - } - } - }, - interfaceEndpoints: { - required: false, - readOnly: true, - serializedName: 'properties.interfaceEndpoints', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'InterfaceEndpointElementType', - type: { - name: 'Composite', - className: 'InterfaceEndpoint' - } - } - } - }, - ipConfigurations: { - required: false, - readOnly: true, - serializedName: 'properties.ipConfigurations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'IPConfigurationElementType', - type: { - name: 'Composite', - className: 'IPConfiguration' - } - } - } - }, - ipConfigurationProfiles: { - required: false, - readOnly: true, - serializedName: 'properties.ipConfigurationProfiles', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'IPConfigurationProfileElementType', - type: { - name: 'Composite', - className: 'IPConfigurationProfile' - } - } - } - }, - resourceNavigationLinks: { - required: false, - serializedName: 'properties.resourceNavigationLinks', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ResourceNavigationLinkElementType', - type: { - name: 'Composite', - className: 'ResourceNavigationLink' - } - } - } - }, - serviceAssociationLinks: { - required: false, - serializedName: 'properties.serviceAssociationLinks', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ServiceAssociationLinkElementType', - type: { - name: 'Composite', - className: 'ServiceAssociationLink' - } - } - } - }, - delegations: { - required: false, - serializedName: 'properties.delegations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'DelegationElementType', - type: { - name: 'Composite', - className: 'Delegation' - } - } - } - }, - purpose: { - required: false, - readOnly: true, - serializedName: 'properties.purpose', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = Subnet; diff --git a/lib/services/networkManagement2/lib/models/subnetAssociation.js b/lib/services/networkManagement2/lib/models/subnetAssociation.js deleted file mode 100644 index 6c91bc204..000000000 --- a/lib/services/networkManagement2/lib/models/subnetAssociation.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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'; - -/** - * Network interface and its custom security rules. - * - */ -class SubnetAssociation { - /** - * Create a SubnetAssociation. - * @property {string} [id] Subnet ID. - * @property {array} [securityRules] Collection of custom security rules. - */ - constructor() { - } - - /** - * Defines the metadata of SubnetAssociation - * - * @returns {object} metadata of SubnetAssociation - * - */ - mapper() { - return { - required: false, - serializedName: 'SubnetAssociation', - type: { - name: 'Composite', - className: 'SubnetAssociation', - modelProperties: { - id: { - required: false, - readOnly: true, - serializedName: 'id', - type: { - name: 'String' - } - }, - securityRules: { - required: false, - serializedName: 'securityRules', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SecurityRuleElementType', - type: { - name: 'Composite', - className: 'SecurityRule' - } - } - } - } - } - } - }; - } -} - -module.exports = SubnetAssociation; diff --git a/lib/services/networkManagement2/lib/models/subnetListResult.js b/lib/services/networkManagement2/lib/models/subnetListResult.js deleted file mode 100644 index c9006e6b0..000000000 --- a/lib/services/networkManagement2/lib/models/subnetListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 ListSubnets API service callRetrieves all subnet that belongs - * to a virtual network - */ -class SubnetListResult extends Array { - /** - * Create a SubnetListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of SubnetListResult - * - * @returns {object} metadata of SubnetListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'SubnetListResult', - type: { - name: 'Composite', - className: 'SubnetListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SubnetElementType', - type: { - name: 'Composite', - className: 'Subnet' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = SubnetListResult; diff --git a/lib/services/networkManagement2/lib/models/tagsObject.js b/lib/services/networkManagement2/lib/models/tagsObject.js deleted file mode 100644 index a22fc07df..000000000 --- a/lib/services/networkManagement2/lib/models/tagsObject.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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'; - -/** - * Tags object for patch operations. - * - */ -class TagsObject { - /** - * Create a TagsObject. - * @property {object} [tags] Resource tags. - */ - constructor() { - } - - /** - * Defines the metadata of TagsObject - * - * @returns {object} metadata of TagsObject - * - */ - mapper() { - return { - required: false, - serializedName: 'TagsObject', - type: { - name: 'Composite', - className: 'TagsObject', - modelProperties: { - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - } - } - } - }; - } -} - -module.exports = TagsObject; diff --git a/lib/services/networkManagement2/lib/models/topology.js b/lib/services/networkManagement2/lib/models/topology.js deleted file mode 100644 index 31fb32e3b..000000000 --- a/lib/services/networkManagement2/lib/models/topology.js +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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'; - -/** - * Topology of the specified resource group. - * - */ -class Topology { - /** - * Create a Topology. - * @property {string} [id] GUID representing the operation id. - * @property {date} [createdDateTime] The datetime when the topology was - * initially created for the resource group. - * @property {date} [lastModified] The datetime when the topology was last - * modified. - * @property {array} [resources] - */ - constructor() { - } - - /** - * Defines the metadata of Topology - * - * @returns {object} metadata of Topology - * - */ - mapper() { - return { - required: false, - serializedName: 'Topology', - type: { - name: 'Composite', - className: 'Topology', - modelProperties: { - id: { - required: false, - readOnly: true, - serializedName: 'id', - type: { - name: 'String' - } - }, - createdDateTime: { - required: false, - readOnly: true, - serializedName: 'createdDateTime', - type: { - name: 'DateTime' - } - }, - lastModified: { - required: false, - readOnly: true, - serializedName: 'lastModified', - type: { - name: 'DateTime' - } - }, - resources: { - required: false, - serializedName: 'resources', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'TopologyResourceElementType', - type: { - name: 'Composite', - className: 'TopologyResource' - } - } - } - } - } - } - }; - } -} - -module.exports = Topology; diff --git a/lib/services/networkManagement2/lib/models/topologyAssociation.js b/lib/services/networkManagement2/lib/models/topologyAssociation.js deleted file mode 100644 index 5967b0f7a..000000000 --- a/lib/services/networkManagement2/lib/models/topologyAssociation.js +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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'; - -/** - * Resources that have an association with the parent resource. - * - */ -class TopologyAssociation { - /** - * Create a TopologyAssociation. - * @property {string} [name] The name of the resource that is associated with - * the parent resource. - * @property {string} [resourceId] The ID of the resource that is associated - * with the parent resource. - * @property {string} [associationType] The association type of the child - * resource to the parent resource. Possible values include: 'Associated', - * 'Contains' - */ - constructor() { - } - - /** - * Defines the metadata of TopologyAssociation - * - * @returns {object} metadata of TopologyAssociation - * - */ - mapper() { - return { - required: false, - serializedName: 'TopologyAssociation', - type: { - name: 'Composite', - className: 'TopologyAssociation', - modelProperties: { - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - resourceId: { - required: false, - serializedName: 'resourceId', - type: { - name: 'String' - } - }, - associationType: { - required: false, - serializedName: 'associationType', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = TopologyAssociation; diff --git a/lib/services/networkManagement2/lib/models/topologyParameters.js b/lib/services/networkManagement2/lib/models/topologyParameters.js deleted file mode 100644 index f503a9dc1..000000000 --- a/lib/services/networkManagement2/lib/models/topologyParameters.js +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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'; - -/** - * Parameters that define the representation of topology. - * - */ -class TopologyParameters { - /** - * Create a TopologyParameters. - * @property {string} [targetResourceGroupName] The name of the target - * resource group to perform topology on. - * @property {object} [targetVirtualNetwork] The reference of the Virtual - * Network resource. - * @property {string} [targetVirtualNetwork.id] Resource ID. - * @property {object} [targetSubnet] The reference of the Subnet resource. - * @property {string} [targetSubnet.id] Resource ID. - */ - constructor() { - } - - /** - * Defines the metadata of TopologyParameters - * - * @returns {object} metadata of TopologyParameters - * - */ - mapper() { - return { - required: false, - serializedName: 'TopologyParameters', - type: { - name: 'Composite', - className: 'TopologyParameters', - modelProperties: { - targetResourceGroupName: { - required: false, - serializedName: 'targetResourceGroupName', - type: { - name: 'String' - } - }, - targetVirtualNetwork: { - required: false, - serializedName: 'targetVirtualNetwork', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - targetSubnet: { - required: false, - serializedName: 'targetSubnet', - type: { - name: 'Composite', - className: 'SubResource' - } - } - } - } - }; - } -} - -module.exports = TopologyParameters; diff --git a/lib/services/networkManagement2/lib/models/topologyResource.js b/lib/services/networkManagement2/lib/models/topologyResource.js deleted file mode 100644 index 18c8aa440..000000000 --- a/lib/services/networkManagement2/lib/models/topologyResource.js +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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'; - -/** - * The network resource topology information for the given resource group. - * - */ -class TopologyResource { - /** - * Create a TopologyResource. - * @property {string} [name] Name of the resource. - * @property {string} [id] ID of the resource. - * @property {string} [location] Resource location. - * @property {array} [associations] Holds the associations the resource has - * with other resources in the resource group. - */ - constructor() { - } - - /** - * Defines the metadata of TopologyResource - * - * @returns {object} metadata of TopologyResource - * - */ - mapper() { - return { - required: false, - serializedName: 'TopologyResource', - type: { - name: 'Composite', - className: 'TopologyResource', - modelProperties: { - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - associations: { - required: false, - serializedName: 'associations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'TopologyAssociationElementType', - type: { - name: 'Composite', - className: 'TopologyAssociation' - } - } - } - } - } - } - }; - } -} - -module.exports = TopologyResource; diff --git a/lib/services/networkManagement2/lib/models/trafficAnalyticsConfigurationProperties.js b/lib/services/networkManagement2/lib/models/trafficAnalyticsConfigurationProperties.js deleted file mode 100644 index 6277575e4..000000000 --- a/lib/services/networkManagement2/lib/models/trafficAnalyticsConfigurationProperties.js +++ /dev/null @@ -1,86 +0,0 @@ -/* - * 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'; - -/** - * Parameters that define the configuration of traffic analytics. - * - */ -class TrafficAnalyticsConfigurationProperties { - /** - * Create a TrafficAnalyticsConfigurationProperties. - * @property {boolean} enabled Flag to enable/disable traffic analytics. - * @property {string} workspaceId The resource guid of the attached workspace - * @property {string} workspaceRegion The location of the attached workspace - * @property {string} workspaceResourceId Resource Id of the attached - * workspace - * @property {number} [trafficAnalyticsInterval] The interval in minutes - * which would decide how frequently TA service should do flow analytics - */ - constructor() { - } - - /** - * Defines the metadata of TrafficAnalyticsConfigurationProperties - * - * @returns {object} metadata of TrafficAnalyticsConfigurationProperties - * - */ - mapper() { - return { - required: false, - serializedName: 'TrafficAnalyticsConfigurationProperties', - type: { - name: 'Composite', - className: 'TrafficAnalyticsConfigurationProperties', - modelProperties: { - enabled: { - required: true, - serializedName: 'enabled', - type: { - name: 'Boolean' - } - }, - workspaceId: { - required: true, - serializedName: 'workspaceId', - type: { - name: 'String' - } - }, - workspaceRegion: { - required: true, - serializedName: 'workspaceRegion', - type: { - name: 'String' - } - }, - workspaceResourceId: { - required: true, - serializedName: 'workspaceResourceId', - type: { - name: 'String' - } - }, - trafficAnalyticsInterval: { - required: false, - serializedName: 'trafficAnalyticsInterval', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = TrafficAnalyticsConfigurationProperties; diff --git a/lib/services/networkManagement2/lib/models/trafficAnalyticsProperties.js b/lib/services/networkManagement2/lib/models/trafficAnalyticsProperties.js deleted file mode 100644 index 40b3c2c59..000000000 --- a/lib/services/networkManagement2/lib/models/trafficAnalyticsProperties.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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'; - -/** - * Parameters that define the configuration of traffic analytics. - * - */ -class TrafficAnalyticsProperties { - /** - * Create a TrafficAnalyticsProperties. - * @property {object} networkWatcherFlowAnalyticsConfiguration - * @property {boolean} [networkWatcherFlowAnalyticsConfiguration.enabled] - * Flag to enable/disable traffic analytics. - * @property {string} [networkWatcherFlowAnalyticsConfiguration.workspaceId] - * The resource guid of the attached workspace - * @property {string} - * [networkWatcherFlowAnalyticsConfiguration.workspaceRegion] The location of - * the attached workspace - * @property {string} - * [networkWatcherFlowAnalyticsConfiguration.workspaceResourceId] Resource Id - * of the attached workspace - * @property {number} - * [networkWatcherFlowAnalyticsConfiguration.trafficAnalyticsInterval] The - * interval in minutes which would decide how frequently TA service should do - * flow analytics - */ - constructor() { - } - - /** - * Defines the metadata of TrafficAnalyticsProperties - * - * @returns {object} metadata of TrafficAnalyticsProperties - * - */ - mapper() { - return { - required: false, - serializedName: 'TrafficAnalyticsProperties', - type: { - name: 'Composite', - className: 'TrafficAnalyticsProperties', - modelProperties: { - networkWatcherFlowAnalyticsConfiguration: { - required: true, - serializedName: 'networkWatcherFlowAnalyticsConfiguration', - type: { - name: 'Composite', - className: 'TrafficAnalyticsConfigurationProperties' - } - } - } - } - }; - } -} - -module.exports = TrafficAnalyticsProperties; diff --git a/lib/services/networkManagement2/lib/models/trafficQuery.js b/lib/services/networkManagement2/lib/models/trafficQuery.js deleted file mode 100644 index 29bbed73a..000000000 --- a/lib/services/networkManagement2/lib/models/trafficQuery.js +++ /dev/null @@ -1,91 +0,0 @@ -/* - * 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'; - -/** - * Parameters to compare with network configuration. - * - */ -class TrafficQuery { - /** - * Create a TrafficQuery. - * @member {string} direction The direction of the traffic. Accepted values - * are 'Inbound' and 'Outbound'. Possible values include: 'Inbound', - * 'Outbound' - * @member {string} protocol Protocol to be verified on. Accepted values are - * '*', TCP, UDP. - * @member {string} source Traffic source. Accepted values are '*', IP - * Address/CIDR, Service Tag. - * @member {string} destination Traffic destination. Accepted values are: - * '*', IP Address/CIDR, Service Tag. - * @member {string} destinationPort Traffice destination port. Accepted - * values are '*', port (for example, 3389) and port range (for example, - * 80-100). - */ - constructor() { - } - - /** - * Defines the metadata of TrafficQuery - * - * @returns {object} metadata of TrafficQuery - * - */ - mapper() { - return { - required: false, - serializedName: 'TrafficQuery', - type: { - name: 'Composite', - className: 'TrafficQuery', - modelProperties: { - direction: { - required: true, - serializedName: 'direction', - type: { - name: 'String' - } - }, - protocol: { - required: true, - serializedName: 'protocol', - type: { - name: 'String' - } - }, - source: { - required: true, - serializedName: 'source', - type: { - name: 'String' - } - }, - destination: { - required: true, - serializedName: 'destination', - type: { - name: 'String' - } - }, - destinationPort: { - required: true, - serializedName: 'destinationPort', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = TrafficQuery; diff --git a/lib/services/networkManagement2/lib/models/troubleshootingDetails.js b/lib/services/networkManagement2/lib/models/troubleshootingDetails.js deleted file mode 100644 index fe3d042bc..000000000 --- a/lib/services/networkManagement2/lib/models/troubleshootingDetails.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * 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'; - -/** - * Information gained from troubleshooting of specified resource. - * - */ -class TroubleshootingDetails { - /** - * Create a TroubleshootingDetails. - * @property {string} [id] The id of the get troubleshoot operation. - * @property {string} [reasonType] Reason type of failure. - * @property {string} [summary] A summary of troubleshooting. - * @property {string} [detail] Details on troubleshooting results. - * @property {array} [recommendedActions] List of recommended actions. - */ - constructor() { - } - - /** - * Defines the metadata of TroubleshootingDetails - * - * @returns {object} metadata of TroubleshootingDetails - * - */ - mapper() { - return { - required: false, - serializedName: 'TroubleshootingDetails', - type: { - name: 'Composite', - className: 'TroubleshootingDetails', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - reasonType: { - required: false, - serializedName: 'reasonType', - type: { - name: 'String' - } - }, - summary: { - required: false, - serializedName: 'summary', - type: { - name: 'String' - } - }, - detail: { - required: false, - serializedName: 'detail', - type: { - name: 'String' - } - }, - recommendedActions: { - required: false, - serializedName: 'recommendedActions', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'TroubleshootingRecommendedActionsElementType', - type: { - name: 'Composite', - className: 'TroubleshootingRecommendedActions' - } - } - } - } - } - } - }; - } -} - -module.exports = TroubleshootingDetails; diff --git a/lib/services/networkManagement2/lib/models/troubleshootingParameters.js b/lib/services/networkManagement2/lib/models/troubleshootingParameters.js deleted file mode 100644 index bffe8084a..000000000 --- a/lib/services/networkManagement2/lib/models/troubleshootingParameters.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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'; - -/** - * Parameters that define the resource to troubleshoot. - * - */ -class TroubleshootingParameters { - /** - * Create a TroubleshootingParameters. - * @property {string} targetResourceId The target resource to troubleshoot. - * @property {string} storageId The ID for the storage account to save the - * troubleshoot result. - * @property {string} storagePath The path to the blob to save the - * troubleshoot result in. - */ - constructor() { - } - - /** - * Defines the metadata of TroubleshootingParameters - * - * @returns {object} metadata of TroubleshootingParameters - * - */ - mapper() { - return { - required: false, - serializedName: 'TroubleshootingParameters', - type: { - name: 'Composite', - className: 'TroubleshootingParameters', - modelProperties: { - targetResourceId: { - required: true, - serializedName: 'targetResourceId', - type: { - name: 'String' - } - }, - storageId: { - required: true, - serializedName: 'properties.storageId', - type: { - name: 'String' - } - }, - storagePath: { - required: true, - serializedName: 'properties.storagePath', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = TroubleshootingParameters; diff --git a/lib/services/networkManagement2/lib/models/troubleshootingRecommendedActions.js b/lib/services/networkManagement2/lib/models/troubleshootingRecommendedActions.js deleted file mode 100644 index a72fedff2..000000000 --- a/lib/services/networkManagement2/lib/models/troubleshootingRecommendedActions.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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'; - -/** - * Recommended actions based on discovered issues. - * - */ -class TroubleshootingRecommendedActions { - /** - * Create a TroubleshootingRecommendedActions. - * @property {string} [actionId] ID of the recommended action. - * @property {string} [actionText] Description of recommended actions. - * @property {string} [actionUri] The uri linking to a documentation for the - * recommended troubleshooting actions. - * @property {string} [actionUriText] The information from the URI for the - * recommended troubleshooting actions. - */ - constructor() { - } - - /** - * Defines the metadata of TroubleshootingRecommendedActions - * - * @returns {object} metadata of TroubleshootingRecommendedActions - * - */ - mapper() { - return { - required: false, - serializedName: 'TroubleshootingRecommendedActions', - type: { - name: 'Composite', - className: 'TroubleshootingRecommendedActions', - modelProperties: { - actionId: { - required: false, - serializedName: 'actionId', - type: { - name: 'String' - } - }, - actionText: { - required: false, - serializedName: 'actionText', - type: { - name: 'String' - } - }, - actionUri: { - required: false, - serializedName: 'actionUri', - type: { - name: 'String' - } - }, - actionUriText: { - required: false, - serializedName: 'actionUriText', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = TroubleshootingRecommendedActions; diff --git a/lib/services/networkManagement2/lib/models/troubleshootingResult.js b/lib/services/networkManagement2/lib/models/troubleshootingResult.js deleted file mode 100644 index 6ca815312..000000000 --- a/lib/services/networkManagement2/lib/models/troubleshootingResult.js +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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'; - -/** - * Troubleshooting information gained from specified resource. - * - */ -class TroubleshootingResult { - /** - * Create a TroubleshootingResult. - * @property {date} [startTime] The start time of the troubleshooting. - * @property {date} [endTime] The end time of the troubleshooting. - * @property {string} [code] The result code of the troubleshooting. - * @property {array} [results] Information from troubleshooting. - */ - constructor() { - } - - /** - * Defines the metadata of TroubleshootingResult - * - * @returns {object} metadata of TroubleshootingResult - * - */ - mapper() { - return { - required: false, - serializedName: 'TroubleshootingResult', - type: { - name: 'Composite', - className: 'TroubleshootingResult', - modelProperties: { - startTime: { - required: false, - serializedName: 'startTime', - type: { - name: 'DateTime' - } - }, - endTime: { - required: false, - serializedName: 'endTime', - type: { - name: 'DateTime' - } - }, - code: { - required: false, - serializedName: 'code', - type: { - name: 'String' - } - }, - results: { - required: false, - serializedName: 'results', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'TroubleshootingDetailsElementType', - type: { - name: 'Composite', - className: 'TroubleshootingDetails' - } - } - } - } - } - } - }; - } -} - -module.exports = TroubleshootingResult; diff --git a/lib/services/networkManagement2/lib/models/tunnelConnectionHealth.js b/lib/services/networkManagement2/lib/models/tunnelConnectionHealth.js deleted file mode 100644 index 6a3c0d011..000000000 --- a/lib/services/networkManagement2/lib/models/tunnelConnectionHealth.js +++ /dev/null @@ -1,94 +0,0 @@ -/* - * 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'; - -/** - * VirtualNetworkGatewayConnection properties - * - */ -class TunnelConnectionHealth { - /** - * Create a TunnelConnectionHealth. - * @property {string} [tunnel] Tunnel name. - * @property {string} [connectionStatus] Virtual network Gateway connection - * status. Possible values include: 'Unknown', 'Connecting', 'Connected', - * 'NotConnected' - * @property {number} [ingressBytesTransferred] The Ingress Bytes Transferred - * in this connection - * @property {number} [egressBytesTransferred] The Egress Bytes Transferred - * in this connection - * @property {string} [lastConnectionEstablishedUtcTime] The time at which - * connection was established in Utc format. - */ - constructor() { - } - - /** - * Defines the metadata of TunnelConnectionHealth - * - * @returns {object} metadata of TunnelConnectionHealth - * - */ - mapper() { - return { - required: false, - serializedName: 'TunnelConnectionHealth', - type: { - name: 'Composite', - className: 'TunnelConnectionHealth', - modelProperties: { - tunnel: { - required: false, - readOnly: true, - serializedName: 'tunnel', - type: { - name: 'String' - } - }, - connectionStatus: { - required: false, - readOnly: true, - serializedName: 'connectionStatus', - type: { - name: 'String' - } - }, - ingressBytesTransferred: { - required: false, - readOnly: true, - serializedName: 'ingressBytesTransferred', - type: { - name: 'Number' - } - }, - egressBytesTransferred: { - required: false, - readOnly: true, - serializedName: 'egressBytesTransferred', - type: { - name: 'Number' - } - }, - lastConnectionEstablishedUtcTime: { - required: false, - readOnly: true, - serializedName: 'lastConnectionEstablishedUtcTime', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = TunnelConnectionHealth; diff --git a/lib/services/networkManagement2/lib/models/usage.js b/lib/services/networkManagement2/lib/models/usage.js deleted file mode 100644 index 2fdcbfe81..000000000 --- a/lib/services/networkManagement2/lib/models/usage.js +++ /dev/null @@ -1,90 +0,0 @@ -/* - * 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'; - -/** - * Describes network resource usage. - * - */ -class Usage { - /** - * Create a Usage. - * @property {string} [id] Resource identifier. - * @property {number} currentValue The current value of the usage. - * @property {number} limit The limit of usage. - * @property {object} name The name of the type of usage. - * @property {string} [name.value] A string describing the resource name. - * @property {string} [name.localizedValue] A localized string describing the - * resource name. - */ - constructor() { - } - - /** - * Defines the metadata of Usage - * - * @returns {object} metadata of Usage - * - */ - mapper() { - return { - required: false, - serializedName: 'Usage', - type: { - name: 'Composite', - className: 'Usage', - modelProperties: { - id: { - required: false, - readOnly: true, - serializedName: 'id', - type: { - name: 'String' - } - }, - unit: { - required: true, - isConstant: true, - serializedName: 'unit', - defaultValue: 'Count', - type: { - name: 'String' - } - }, - currentValue: { - required: true, - serializedName: 'currentValue', - type: { - name: 'Number' - } - }, - limit: { - required: true, - serializedName: 'limit', - type: { - name: 'Number' - } - }, - name: { - required: true, - serializedName: 'name', - type: { - name: 'Composite', - className: 'UsageName' - } - } - } - } - }; - } -} - -module.exports = Usage; diff --git a/lib/services/networkManagement2/lib/models/usageName.js b/lib/services/networkManagement2/lib/models/usageName.js deleted file mode 100644 index d6e59b9fd..000000000 --- a/lib/services/networkManagement2/lib/models/usageName.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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'; - -/** - * The usage names. - * - */ -class UsageName { - /** - * Create a UsageName. - * @property {string} [value] A string describing the resource name. - * @property {string} [localizedValue] A localized string describing the - * resource name. - */ - constructor() { - } - - /** - * Defines the metadata of UsageName - * - * @returns {object} metadata of UsageName - * - */ - mapper() { - return { - required: false, - serializedName: 'UsageName', - type: { - name: 'Composite', - className: 'UsageName', - modelProperties: { - value: { - required: false, - serializedName: 'value', - type: { - name: 'String' - } - }, - localizedValue: { - required: false, - serializedName: 'localizedValue', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = UsageName; diff --git a/lib/services/networkManagement2/lib/models/usagesListResult.js b/lib/services/networkManagement2/lib/models/usagesListResult.js deleted file mode 100644 index 448f03cc3..000000000 --- a/lib/services/networkManagement2/lib/models/usagesListResult.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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'; - -/** - * The list usages operation response. - */ -class UsagesListResult extends Array { - /** - * Create a UsagesListResult. - * @property {string} [nextLink] URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of UsagesListResult - * - * @returns {object} metadata of UsagesListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'UsagesListResult', - type: { - name: 'Composite', - className: 'UsagesListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'UsageElementType', - type: { - name: 'Composite', - className: 'Usage' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = UsagesListResult; diff --git a/lib/services/networkManagement2/lib/models/verificationIPFlowParameters.js b/lib/services/networkManagement2/lib/models/verificationIPFlowParameters.js deleted file mode 100644 index 897d5eed2..000000000 --- a/lib/services/networkManagement2/lib/models/verificationIPFlowParameters.js +++ /dev/null @@ -1,119 +0,0 @@ -/* - * 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'; - -/** - * Parameters that define the IP flow to be verified. - * - */ -class VerificationIPFlowParameters { - /** - * Create a VerificationIPFlowParameters. - * @property {string} targetResourceId The ID of the target resource to - * perform next-hop on. - * @property {string} direction The direction of the packet represented as a - * 5-tuple. Possible values include: 'Inbound', 'Outbound' - * @property {string} protocol Protocol to be verified on. Possible values - * include: 'TCP', 'UDP' - * @property {string} localPort The local port. Acceptable values are a - * single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * @property {string} remotePort The remote port. Acceptable values are a - * single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * @property {string} localIPAddress The local IP address. Acceptable values - * are valid IPv4 addresses. - * @property {string} remoteIPAddress The remote IP address. Acceptable - * values are valid IPv4 addresses. - * @property {string} [targetNicResourceId] The NIC ID. (If VM has multiple - * NICs and IP forwarding is enabled on any of them, then this parameter must - * be specified. Otherwise optional). - */ - constructor() { - } - - /** - * Defines the metadata of VerificationIPFlowParameters - * - * @returns {object} metadata of VerificationIPFlowParameters - * - */ - mapper() { - return { - required: false, - serializedName: 'VerificationIPFlowParameters', - type: { - name: 'Composite', - className: 'VerificationIPFlowParameters', - modelProperties: { - targetResourceId: { - required: true, - serializedName: 'targetResourceId', - type: { - name: 'String' - } - }, - direction: { - required: true, - serializedName: 'direction', - type: { - name: 'String' - } - }, - protocol: { - required: true, - serializedName: 'protocol', - type: { - name: 'String' - } - }, - localPort: { - required: true, - serializedName: 'localPort', - type: { - name: 'String' - } - }, - remotePort: { - required: true, - serializedName: 'remotePort', - type: { - name: 'String' - } - }, - localIPAddress: { - required: true, - serializedName: 'localIPAddress', - type: { - name: 'String' - } - }, - remoteIPAddress: { - required: true, - serializedName: 'remoteIPAddress', - type: { - name: 'String' - } - }, - targetNicResourceId: { - required: false, - serializedName: 'targetNicResourceId', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VerificationIPFlowParameters; diff --git a/lib/services/networkManagement2/lib/models/verificationIPFlowResult.js b/lib/services/networkManagement2/lib/models/verificationIPFlowResult.js deleted file mode 100644 index 97754cfb7..000000000 --- a/lib/services/networkManagement2/lib/models/verificationIPFlowResult.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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'; - -/** - * Results of IP flow verification on the target resource. - * - */ -class VerificationIPFlowResult { - /** - * Create a VerificationIPFlowResult. - * @property {string} [access] Indicates whether the traffic is allowed or - * denied. Possible values include: 'Allow', 'Deny' - * @property {string} [ruleName] Name of the rule. If input is not matched - * against any security rule, it is not displayed. - */ - constructor() { - } - - /** - * Defines the metadata of VerificationIPFlowResult - * - * @returns {object} metadata of VerificationIPFlowResult - * - */ - mapper() { - return { - required: false, - serializedName: 'VerificationIPFlowResult', - type: { - name: 'Composite', - className: 'VerificationIPFlowResult', - modelProperties: { - access: { - required: false, - serializedName: 'access', - type: { - name: 'String' - } - }, - ruleName: { - required: false, - serializedName: 'ruleName', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VerificationIPFlowResult; diff --git a/lib/services/networkManagement2/lib/models/virtualHub.js b/lib/services/networkManagement2/lib/models/virtualHub.js deleted file mode 100644 index 3ad330778..000000000 --- a/lib/services/networkManagement2/lib/models/virtualHub.js +++ /dev/null @@ -1,192 +0,0 @@ -/* - * 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'); - -/** - * VirtualHub Resource. - * - * @extends models['Resource'] - */ -class VirtualHub extends models['Resource'] { - /** - * Create a VirtualHub. - * @property {object} [virtualWan] The VirtualWAN to which the VirtualHub - * belongs - * @property {string} [virtualWan.id] Resource ID. - * @property {object} [vpnGateway] The VpnGateway associated with this - * VirtualHub - * @property {string} [vpnGateway.id] Resource ID. - * @property {object} [p2SVpnGateway] The P2SVpnGateway associated with this - * VirtualHub - * @property {string} [p2SVpnGateway.id] Resource ID. - * @property {object} [expressRouteGateway] The expressRouteGateway - * associated with this VirtualHub - * @property {string} [expressRouteGateway.id] Resource ID. - * @property {array} [virtualNetworkConnections] list of all vnet connections - * with this VirtualHub. - * @property {string} [addressPrefix] Address-prefix for this VirtualHub. - * @property {object} [routeTable] The routeTable associated with this - * virtual hub. - * @property {array} [routeTable.routes] list of all routes. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of VirtualHub - * - * @returns {object} metadata of VirtualHub - * - */ - mapper() { - return { - required: false, - serializedName: 'VirtualHub', - type: { - name: 'Composite', - className: 'VirtualHub', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - virtualWan: { - required: false, - serializedName: 'properties.virtualWan', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - vpnGateway: { - required: false, - serializedName: 'properties.vpnGateway', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - p2SVpnGateway: { - required: false, - serializedName: 'properties.p2SVpnGateway', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - expressRouteGateway: { - required: false, - serializedName: 'properties.expressRouteGateway', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - virtualNetworkConnections: { - required: false, - serializedName: 'properties.virtualNetworkConnections', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'HubVirtualNetworkConnectionElementType', - type: { - name: 'Composite', - className: 'HubVirtualNetworkConnection' - } - } - } - }, - addressPrefix: { - required: false, - serializedName: 'properties.addressPrefix', - type: { - name: 'String' - } - }, - routeTable: { - required: false, - serializedName: 'properties.routeTable', - type: { - name: 'Composite', - className: 'VirtualHubRouteTable' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - etag: { - required: false, - readOnly: true, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VirtualHub; diff --git a/lib/services/networkManagement2/lib/models/virtualHubId.js b/lib/services/networkManagement2/lib/models/virtualHubId.js deleted file mode 100644 index 3c9244d28..000000000 --- a/lib/services/networkManagement2/lib/models/virtualHubId.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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'; - -/** - * Virtual Hub identifier. - * - */ -class VirtualHubId { - /** - * Create a VirtualHubId. - * @property {string} [id] The resource URI for the Virtual Hub where the - * ExpressRoute gateway is or will be deployed. The Virtual Hub resource and - * the ExpressRoute gateway resource reside in the same subscription. - */ - constructor() { - } - - /** - * Defines the metadata of VirtualHubId - * - * @returns {object} metadata of VirtualHubId - * - */ - mapper() { - return { - required: false, - serializedName: 'VirtualHubId', - type: { - name: 'Composite', - className: 'VirtualHubId', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VirtualHubId; diff --git a/lib/services/networkManagement2/lib/models/virtualHubRoute.js b/lib/services/networkManagement2/lib/models/virtualHubRoute.js deleted file mode 100644 index 0958a270e..000000000 --- a/lib/services/networkManagement2/lib/models/virtualHubRoute.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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'; - -/** - * VirtualHub route - * - */ -class VirtualHubRoute { - /** - * Create a VirtualHubRoute. - * @property {array} [addressPrefixes] list of all addressPrefixes. - * @property {string} [nextHopIpAddress] NextHop ip address. - */ - constructor() { - } - - /** - * Defines the metadata of VirtualHubRoute - * - * @returns {object} metadata of VirtualHubRoute - * - */ - mapper() { - return { - required: false, - serializedName: 'VirtualHubRoute', - type: { - name: 'Composite', - className: 'VirtualHubRoute', - modelProperties: { - addressPrefixes: { - required: false, - serializedName: 'addressPrefixes', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - nextHopIpAddress: { - required: false, - serializedName: 'nextHopIpAddress', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VirtualHubRoute; diff --git a/lib/services/networkManagement2/lib/models/virtualHubRouteTable.js b/lib/services/networkManagement2/lib/models/virtualHubRouteTable.js deleted file mode 100644 index 535228bcc..000000000 --- a/lib/services/networkManagement2/lib/models/virtualHubRouteTable.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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'; - -/** - * VirtualHub route table - * - */ -class VirtualHubRouteTable { - /** - * Create a VirtualHubRouteTable. - * @property {array} [routes] list of all routes. - */ - constructor() { - } - - /** - * Defines the metadata of VirtualHubRouteTable - * - * @returns {object} metadata of VirtualHubRouteTable - * - */ - mapper() { - return { - required: false, - serializedName: 'VirtualHubRouteTable', - type: { - name: 'Composite', - className: 'VirtualHubRouteTable', - modelProperties: { - routes: { - required: false, - serializedName: 'routes', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'VirtualHubRouteElementType', - type: { - name: 'Composite', - className: 'VirtualHubRoute' - } - } - } - } - } - } - }; - } -} - -module.exports = VirtualHubRouteTable; diff --git a/lib/services/networkManagement2/lib/models/virtualNetwork.js b/lib/services/networkManagement2/lib/models/virtualNetwork.js deleted file mode 100644 index ff3fe44ba..000000000 --- a/lib/services/networkManagement2/lib/models/virtualNetwork.js +++ /dev/null @@ -1,210 +0,0 @@ -/* - * 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'); - -/** - * Virtual Network resource. - * - * @extends models['Resource'] - */ -class VirtualNetwork extends models['Resource'] { - /** - * Create a VirtualNetwork. - * @property {object} [addressSpace] The AddressSpace that contains an array - * of IP address ranges that can be used by subnets. - * @property {array} [addressSpace.addressPrefixes] A list of address blocks - * reserved for this virtual network in CIDR notation. - * @property {object} [dhcpOptions] The dhcpOptions that contains an array of - * DNS servers available to VMs deployed in the virtual network. - * @property {array} [dhcpOptions.dnsServers] The list of DNS servers IP - * addresses. - * @property {array} [subnets] A list of subnets in a Virtual Network. - * @property {array} [virtualNetworkPeerings] A list of peerings in a Virtual - * Network. - * @property {string} [resourceGuid] The resourceGuid property of the Virtual - * Network resource. - * @property {string} [provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {boolean} [enableDdosProtection] Indicates if DDoS protection is - * enabled for all the protected resources in the virtual network. It - * requires a DDoS protection plan associated with the resource. Default - * value: false . - * @property {boolean} [enableVmProtection] Indicates if VM protection is - * enabled for all the subnets in the virtual network. Default value: false . - * @property {object} [ddosProtectionPlan] The DDoS protection plan - * associated with the virtual network. - * @property {string} [ddosProtectionPlan.id] Resource ID. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of VirtualNetwork - * - * @returns {object} metadata of VirtualNetwork - * - */ - mapper() { - return { - required: false, - serializedName: 'VirtualNetwork', - type: { - name: 'Composite', - className: 'VirtualNetwork', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - addressSpace: { - required: false, - serializedName: 'properties.addressSpace', - type: { - name: 'Composite', - className: 'AddressSpace' - } - }, - dhcpOptions: { - required: false, - serializedName: 'properties.dhcpOptions', - type: { - name: 'Composite', - className: 'DhcpOptions' - } - }, - subnets: { - required: false, - serializedName: 'properties.subnets', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SubnetElementType', - type: { - name: 'Composite', - className: 'Subnet' - } - } - } - }, - virtualNetworkPeerings: { - required: false, - serializedName: 'properties.virtualNetworkPeerings', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'VirtualNetworkPeeringElementType', - type: { - name: 'Composite', - className: 'VirtualNetworkPeering' - } - } - } - }, - resourceGuid: { - required: false, - serializedName: 'properties.resourceGuid', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - enableDdosProtection: { - required: false, - serializedName: 'properties.enableDdosProtection', - defaultValue: false, - type: { - name: 'Boolean' - } - }, - enableVmProtection: { - required: false, - serializedName: 'properties.enableVmProtection', - defaultValue: false, - type: { - name: 'Boolean' - } - }, - ddosProtectionPlan: { - required: false, - serializedName: 'properties.ddosProtectionPlan', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VirtualNetwork; diff --git a/lib/services/networkManagement2/lib/models/virtualNetworkConnectionGatewayReference.js b/lib/services/networkManagement2/lib/models/virtualNetworkConnectionGatewayReference.js deleted file mode 100644 index f65c434a5..000000000 --- a/lib/services/networkManagement2/lib/models/virtualNetworkConnectionGatewayReference.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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'; - -/** - * A reference to VirtualNetworkGateway or LocalNetworkGateway resource. - * - */ -class VirtualNetworkConnectionGatewayReference { - /** - * Create a VirtualNetworkConnectionGatewayReference. - * @property {string} id The ID of VirtualNetworkGateway or - * LocalNetworkGateway resource. - */ - constructor() { - } - - /** - * Defines the metadata of VirtualNetworkConnectionGatewayReference - * - * @returns {object} metadata of VirtualNetworkConnectionGatewayReference - * - */ - mapper() { - return { - required: false, - serializedName: 'virtualNetworkConnectionGatewayReference', - type: { - name: 'Composite', - className: 'VirtualNetworkConnectionGatewayReference', - modelProperties: { - id: { - required: true, - serializedName: 'id', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VirtualNetworkConnectionGatewayReference; diff --git a/lib/services/networkManagement2/lib/models/virtualNetworkGateway.js b/lib/services/networkManagement2/lib/models/virtualNetworkGateway.js deleted file mode 100644 index 59e2fd1e8..000000000 --- a/lib/services/networkManagement2/lib/models/virtualNetworkGateway.js +++ /dev/null @@ -1,253 +0,0 @@ -/* - * 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'); - -/** - * A common class for general resource information - * - * @extends models['Resource'] - */ -class VirtualNetworkGateway extends models['Resource'] { - /** - * Create a VirtualNetworkGateway. - * @property {array} [ipConfigurations] IP configurations for virtual network - * gateway. - * @property {string} [gatewayType] The type of this virtual network gateway. - * Possible values are: 'Vpn' and 'ExpressRoute'. Possible values include: - * 'Vpn', 'ExpressRoute' - * @property {string} [vpnType] The type of this virtual network gateway. - * Possible values are: 'PolicyBased' and 'RouteBased'. Possible values - * include: 'PolicyBased', 'RouteBased' - * @property {boolean} [enableBgp] Whether BGP is enabled for this virtual - * network gateway or not. - * @property {boolean} [activeActive] ActiveActive flag - * @property {object} [gatewayDefaultSite] The reference of the - * LocalNetworkGateway resource which represents local network site having - * default routes. Assign Null value in case of removing existing default - * site setting. - * @property {string} [gatewayDefaultSite.id] Resource ID. - * @property {object} [sku] The reference of the VirtualNetworkGatewaySku - * resource which represents the SKU selected for Virtual network gateway. - * @property {string} [sku.name] Gateway SKU name. Possible values include: - * 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', - * 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * @property {string} [sku.tier] Gateway SKU tier. Possible values include: - * 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', - * 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * @property {number} [sku.capacity] The capacity. - * @property {object} [vpnClientConfiguration] The reference of the - * VpnClientConfiguration resource which represents the P2S VpnClient - * configurations. - * @property {object} [vpnClientConfiguration.vpnClientAddressPool] The - * reference of the address space resource which represents Address space for - * P2S VpnClient. - * @property {array} - * [vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A list of - * address blocks reserved for this virtual network in CIDR notation. - * @property {array} [vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. - * @property {array} [vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. - * @property {array} [vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. - * @property {array} [vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. - * @property {string} [vpnClientConfiguration.radiusServerAddress] The radius - * server address property of the VirtualNetworkGateway resource for vpn - * client connection. - * @property {string} [vpnClientConfiguration.radiusServerSecret] The radius - * secret property of the VirtualNetworkGateway resource for vpn client - * connection. - * @property {object} [bgpSettings] Virtual network gateway's BGP speaker - * settings. - * @property {number} [bgpSettings.asn] The BGP speaker's ASN. - * @property {string} [bgpSettings.bgpPeeringAddress] The BGP peering address - * and BGP identifier of this BGP speaker. - * @property {number} [bgpSettings.peerWeight] The weight added to routes - * learned from this BGP speaker. - * @property {string} [resourceGuid] The resource GUID property of the - * VirtualNetworkGateway resource. - * @property {string} [provisioningState] The provisioning state of the - * VirtualNetworkGateway resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of VirtualNetworkGateway - * - * @returns {object} metadata of VirtualNetworkGateway - * - */ - mapper() { - return { - required: false, - serializedName: 'VirtualNetworkGateway', - type: { - name: 'Composite', - className: 'VirtualNetworkGateway', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - ipConfigurations: { - required: false, - serializedName: 'properties.ipConfigurations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'VirtualNetworkGatewayIPConfigurationElementType', - type: { - name: 'Composite', - className: 'VirtualNetworkGatewayIPConfiguration' - } - } - } - }, - gatewayType: { - required: false, - serializedName: 'properties.gatewayType', - type: { - name: 'String' - } - }, - vpnType: { - required: false, - serializedName: 'properties.vpnType', - type: { - name: 'String' - } - }, - enableBgp: { - required: false, - serializedName: 'properties.enableBgp', - type: { - name: 'Boolean' - } - }, - activeActive: { - required: false, - serializedName: 'properties.activeActive', - type: { - name: 'Boolean' - } - }, - gatewayDefaultSite: { - required: false, - serializedName: 'properties.gatewayDefaultSite', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - sku: { - required: false, - serializedName: 'properties.sku', - type: { - name: 'Composite', - className: 'VirtualNetworkGatewaySku' - } - }, - vpnClientConfiguration: { - required: false, - serializedName: 'properties.vpnClientConfiguration', - type: { - name: 'Composite', - className: 'VpnClientConfiguration' - } - }, - bgpSettings: { - required: false, - serializedName: 'properties.bgpSettings', - type: { - name: 'Composite', - className: 'BgpSettings' - } - }, - resourceGuid: { - required: false, - serializedName: 'properties.resourceGuid', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VirtualNetworkGateway; diff --git a/lib/services/networkManagement2/lib/models/virtualNetworkGatewayConnection.js b/lib/services/networkManagement2/lib/models/virtualNetworkGatewayConnection.js deleted file mode 100644 index 4f8a433ad..000000000 --- a/lib/services/networkManagement2/lib/models/virtualNetworkGatewayConnection.js +++ /dev/null @@ -1,471 +0,0 @@ -/* - * 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'); - -/** - * A common class for general resource information - * - * @extends models['Resource'] - */ -class VirtualNetworkGatewayConnection extends models['Resource'] { - /** - * Create a VirtualNetworkGatewayConnection. - * @property {string} [authorizationKey] The authorizationKey. - * @property {object} virtualNetworkGateway1 The reference to virtual network - * gateway resource. - * @property {array} [virtualNetworkGateway1.ipConfigurations] IP - * configurations for virtual network gateway. - * @property {string} [virtualNetworkGateway1.gatewayType] The type of this - * virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. - * Possible values include: 'Vpn', 'ExpressRoute' - * @property {string} [virtualNetworkGateway1.vpnType] The type of this - * virtual network gateway. Possible values are: 'PolicyBased' and - * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' - * @property {boolean} [virtualNetworkGateway1.enableBgp] Whether BGP is - * enabled for this virtual network gateway or not. - * @property {boolean} [virtualNetworkGateway1.activeActive] ActiveActive - * flag - * @property {object} [virtualNetworkGateway1.gatewayDefaultSite] The - * reference of the LocalNetworkGateway resource which represents local - * network site having default routes. Assign Null value in case of removing - * existing default site setting. - * @property {string} [virtualNetworkGateway1.gatewayDefaultSite.id] Resource - * ID. - * @property {object} [virtualNetworkGateway1.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. - * @property {string} [virtualNetworkGateway1.sku.name] Gateway SKU name. - * Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * @property {string} [virtualNetworkGateway1.sku.tier] Gateway SKU tier. - * Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * @property {number} [virtualNetworkGateway1.sku.capacity] The capacity. - * @property {object} [virtualNetworkGateway1.vpnClientConfiguration] The - * reference of the VpnClientConfiguration resource which represents the P2S - * VpnClient configurations. - * @property {object} - * [virtualNetworkGateway1.vpnClientConfiguration.vpnClientAddressPool] The - * reference of the address space resource which represents Address space for - * P2S VpnClient. - * @property {array} - * [virtualNetworkGateway1.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] - * A list of address blocks reserved for this virtual network in CIDR - * notation. - * @property {array} - * [virtualNetworkGateway1.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. - * @property {array} - * [virtualNetworkGateway1.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. - * @property {array} - * [virtualNetworkGateway1.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. - * @property {array} - * [virtualNetworkGateway1.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. - * @property {string} - * [virtualNetworkGateway1.vpnClientConfiguration.radiusServerAddress] The - * radius server address property of the VirtualNetworkGateway resource for - * vpn client connection. - * @property {string} - * [virtualNetworkGateway1.vpnClientConfiguration.radiusServerSecret] The - * radius secret property of the VirtualNetworkGateway resource for vpn - * client connection. - * @property {object} [virtualNetworkGateway1.bgpSettings] Virtual network - * gateway's BGP speaker settings. - * @property {number} [virtualNetworkGateway1.bgpSettings.asn] The BGP - * speaker's ASN. - * @property {string} [virtualNetworkGateway1.bgpSettings.bgpPeeringAddress] - * The BGP peering address and BGP identifier of this BGP speaker. - * @property {number} [virtualNetworkGateway1.bgpSettings.peerWeight] The - * weight added to routes learned from this BGP speaker. - * @property {string} [virtualNetworkGateway1.resourceGuid] The resource GUID - * property of the VirtualNetworkGateway resource. - * @property {string} [virtualNetworkGateway1.provisioningState] The - * provisioning state of the VirtualNetworkGateway resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [virtualNetworkGateway1.etag] Gets a unique read-only - * string that changes whenever the resource is updated. - * @property {object} [virtualNetworkGateway2] The reference to virtual - * network gateway resource. - * @property {array} [virtualNetworkGateway2.ipConfigurations] IP - * configurations for virtual network gateway. - * @property {string} [virtualNetworkGateway2.gatewayType] The type of this - * virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. - * Possible values include: 'Vpn', 'ExpressRoute' - * @property {string} [virtualNetworkGateway2.vpnType] The type of this - * virtual network gateway. Possible values are: 'PolicyBased' and - * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' - * @property {boolean} [virtualNetworkGateway2.enableBgp] Whether BGP is - * enabled for this virtual network gateway or not. - * @property {boolean} [virtualNetworkGateway2.activeActive] ActiveActive - * flag - * @property {object} [virtualNetworkGateway2.gatewayDefaultSite] The - * reference of the LocalNetworkGateway resource which represents local - * network site having default routes. Assign Null value in case of removing - * existing default site setting. - * @property {string} [virtualNetworkGateway2.gatewayDefaultSite.id] Resource - * ID. - * @property {object} [virtualNetworkGateway2.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. - * @property {string} [virtualNetworkGateway2.sku.name] Gateway SKU name. - * Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * @property {string} [virtualNetworkGateway2.sku.tier] Gateway SKU tier. - * Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * @property {number} [virtualNetworkGateway2.sku.capacity] The capacity. - * @property {object} [virtualNetworkGateway2.vpnClientConfiguration] The - * reference of the VpnClientConfiguration resource which represents the P2S - * VpnClient configurations. - * @property {object} - * [virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] The - * reference of the address space resource which represents Address space for - * P2S VpnClient. - * @property {array} - * [virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] - * A list of address blocks reserved for this virtual network in CIDR - * notation. - * @property {array} - * [virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. - * @property {array} - * [virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. - * @property {array} - * [virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. - * @property {array} - * [virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. - * @property {string} - * [virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] The - * radius server address property of the VirtualNetworkGateway resource for - * vpn client connection. - * @property {string} - * [virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] The - * radius secret property of the VirtualNetworkGateway resource for vpn - * client connection. - * @property {object} [virtualNetworkGateway2.bgpSettings] Virtual network - * gateway's BGP speaker settings. - * @property {number} [virtualNetworkGateway2.bgpSettings.asn] The BGP - * speaker's ASN. - * @property {string} [virtualNetworkGateway2.bgpSettings.bgpPeeringAddress] - * The BGP peering address and BGP identifier of this BGP speaker. - * @property {number} [virtualNetworkGateway2.bgpSettings.peerWeight] The - * weight added to routes learned from this BGP speaker. - * @property {string} [virtualNetworkGateway2.resourceGuid] The resource GUID - * property of the VirtualNetworkGateway resource. - * @property {string} [virtualNetworkGateway2.provisioningState] The - * provisioning state of the VirtualNetworkGateway resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [virtualNetworkGateway2.etag] Gets a unique read-only - * string that changes whenever the resource is updated. - * @property {object} [localNetworkGateway2] The reference to local network - * gateway resource. - * @property {object} [localNetworkGateway2.localNetworkAddressSpace] Local - * network site address space. - * @property {array} - * [localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A list of - * address blocks reserved for this virtual network in CIDR notation. - * @property {string} [localNetworkGateway2.gatewayIpAddress] IP address of - * local network gateway. - * @property {object} [localNetworkGateway2.bgpSettings] Local network - * gateway's BGP speaker settings. - * @property {number} [localNetworkGateway2.bgpSettings.asn] The BGP - * speaker's ASN. - * @property {string} [localNetworkGateway2.bgpSettings.bgpPeeringAddress] - * The BGP peering address and BGP identifier of this BGP speaker. - * @property {number} [localNetworkGateway2.bgpSettings.peerWeight] The - * weight added to routes learned from this BGP speaker. - * @property {string} [localNetworkGateway2.resourceGuid] The resource GUID - * property of the LocalNetworkGateway resource. - * @property {string} [localNetworkGateway2.provisioningState] The - * provisioning state of the LocalNetworkGateway resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [localNetworkGateway2.etag] A unique read-only string - * that changes whenever the resource is updated. - * @property {string} connectionType Gateway connection type. Possible values - * are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values - * include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' - * @property {string} [connectionProtocol] Connection protocol used for this - * connection. Possible values include: 'IKEv2', 'IKEv1' - * @property {number} [routingWeight] The routing weight. - * @property {string} [sharedKey] The IPSec shared key. - * @property {string} [connectionStatus] Virtual network Gateway connection - * status. Possible values are 'Unknown', 'Connecting', 'Connected' and - * 'NotConnected'. Possible values include: 'Unknown', 'Connecting', - * 'Connected', 'NotConnected' - * @property {array} [tunnelConnectionStatus] Collection of all tunnels' - * connection health status. - * @property {number} [egressBytesTransferred] The egress bytes transferred - * in this connection. - * @property {number} [ingressBytesTransferred] The ingress bytes transferred - * in this connection. - * @property {object} [peer] The reference to peerings resource. - * @property {string} [peer.id] Resource ID. - * @property {boolean} [enableBgp] EnableBgp flag - * @property {boolean} [usePolicyBasedTrafficSelectors] Enable policy-based - * traffic selectors. - * @property {array} [ipsecPolicies] The IPSec Policies to be considered by - * this connection. - * @property {string} [resourceGuid] The resource GUID property of the - * VirtualNetworkGatewayConnection resource. - * @property {string} [provisioningState] The provisioning state of the - * VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {boolean} [expressRouteGatewayBypass] Bypass ExpressRoute - * Gateway for data forwarding - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of VirtualNetworkGatewayConnection - * - * @returns {object} metadata of VirtualNetworkGatewayConnection - * - */ - mapper() { - return { - required: false, - serializedName: 'VirtualNetworkGatewayConnection', - type: { - name: 'Composite', - className: 'VirtualNetworkGatewayConnection', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - authorizationKey: { - required: false, - serializedName: 'properties.authorizationKey', - type: { - name: 'String' - } - }, - virtualNetworkGateway1: { - required: true, - serializedName: 'properties.virtualNetworkGateway1', - type: { - name: 'Composite', - className: 'VirtualNetworkGateway' - } - }, - virtualNetworkGateway2: { - required: false, - serializedName: 'properties.virtualNetworkGateway2', - type: { - name: 'Composite', - className: 'VirtualNetworkGateway' - } - }, - localNetworkGateway2: { - required: false, - serializedName: 'properties.localNetworkGateway2', - type: { - name: 'Composite', - className: 'LocalNetworkGateway' - } - }, - connectionType: { - required: true, - serializedName: 'properties.connectionType', - type: { - name: 'String' - } - }, - connectionProtocol: { - required: false, - serializedName: 'properties.connectionProtocol', - type: { - name: 'String' - } - }, - routingWeight: { - required: false, - serializedName: 'properties.routingWeight', - type: { - name: 'Number' - } - }, - sharedKey: { - required: false, - serializedName: 'properties.sharedKey', - type: { - name: 'String' - } - }, - connectionStatus: { - required: false, - readOnly: true, - serializedName: 'properties.connectionStatus', - type: { - name: 'String' - } - }, - tunnelConnectionStatus: { - required: false, - readOnly: true, - serializedName: 'properties.tunnelConnectionStatus', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'TunnelConnectionHealthElementType', - type: { - name: 'Composite', - className: 'TunnelConnectionHealth' - } - } - } - }, - egressBytesTransferred: { - required: false, - readOnly: true, - serializedName: 'properties.egressBytesTransferred', - type: { - name: 'Number' - } - }, - ingressBytesTransferred: { - required: false, - readOnly: true, - serializedName: 'properties.ingressBytesTransferred', - type: { - name: 'Number' - } - }, - peer: { - required: false, - serializedName: 'properties.peer', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - enableBgp: { - required: false, - serializedName: 'properties.enableBgp', - type: { - name: 'Boolean' - } - }, - usePolicyBasedTrafficSelectors: { - required: false, - serializedName: 'properties.usePolicyBasedTrafficSelectors', - type: { - name: 'Boolean' - } - }, - ipsecPolicies: { - required: false, - serializedName: 'properties.ipsecPolicies', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'IpsecPolicyElementType', - type: { - name: 'Composite', - className: 'IpsecPolicy' - } - } - } - }, - resourceGuid: { - required: false, - serializedName: 'properties.resourceGuid', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - expressRouteGatewayBypass: { - required: false, - serializedName: 'properties.expressRouteGatewayBypass', - type: { - name: 'Boolean' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VirtualNetworkGatewayConnection; diff --git a/lib/services/networkManagement2/lib/models/virtualNetworkGatewayConnectionListEntity.js b/lib/services/networkManagement2/lib/models/virtualNetworkGatewayConnectionListEntity.js deleted file mode 100644 index 21ffba124..000000000 --- a/lib/services/networkManagement2/lib/models/virtualNetworkGatewayConnectionListEntity.js +++ /dev/null @@ -1,303 +0,0 @@ -/* - * 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'); - -/** - * A common class for general resource information - * - * @extends models['Resource'] - */ -class VirtualNetworkGatewayConnectionListEntity extends models['Resource'] { - /** - * Create a VirtualNetworkGatewayConnectionListEntity. - * @property {string} [authorizationKey] The authorizationKey. - * @property {object} virtualNetworkGateway1 The reference to virtual network - * gateway resource. - * @property {string} [virtualNetworkGateway1.id] The ID of - * VirtualNetworkGateway or LocalNetworkGateway resource. - * @property {object} [virtualNetworkGateway2] The reference to virtual - * network gateway resource. - * @property {string} [virtualNetworkGateway2.id] The ID of - * VirtualNetworkGateway or LocalNetworkGateway resource. - * @property {object} [localNetworkGateway2] The reference to local network - * gateway resource. - * @property {string} [localNetworkGateway2.id] The ID of - * VirtualNetworkGateway or LocalNetworkGateway resource. - * @property {string} connectionType Gateway connection type. Possible values - * are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values - * include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' - * @property {string} [connectionProtocol] Connection protocol used for this - * connection. Possible values include: 'IKEv2', 'IKEv1' - * @property {number} [routingWeight] The routing weight. - * @property {string} [sharedKey] The IPSec shared key. - * @property {string} [connectionStatus] Virtual network Gateway connection - * status. Possible values are 'Unknown', 'Connecting', 'Connected' and - * 'NotConnected'. Possible values include: 'Unknown', 'Connecting', - * 'Connected', 'NotConnected' - * @property {array} [tunnelConnectionStatus] Collection of all tunnels' - * connection health status. - * @property {number} [egressBytesTransferred] The egress bytes transferred - * in this connection. - * @property {number} [ingressBytesTransferred] The ingress bytes transferred - * in this connection. - * @property {object} [peer] The reference to peerings resource. - * @property {string} [peer.id] Resource ID. - * @property {boolean} [enableBgp] EnableBgp flag - * @property {boolean} [usePolicyBasedTrafficSelectors] Enable policy-based - * traffic selectors. - * @property {array} [ipsecPolicies] The IPSec Policies to be considered by - * this connection. - * @property {string} [resourceGuid] The resource GUID property of the - * VirtualNetworkGatewayConnection resource. - * @property {string} [provisioningState] The provisioning state of the - * VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {boolean} [expressRouteGatewayBypass] Bypass ExpressRoute - * Gateway for data forwarding - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of VirtualNetworkGatewayConnectionListEntity - * - * @returns {object} metadata of VirtualNetworkGatewayConnectionListEntity - * - */ - mapper() { - return { - required: false, - serializedName: 'VirtualNetworkGatewayConnectionListEntity', - type: { - name: 'Composite', - className: 'VirtualNetworkGatewayConnectionListEntity', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - authorizationKey: { - required: false, - serializedName: 'properties.authorizationKey', - type: { - name: 'String' - } - }, - virtualNetworkGateway1: { - required: true, - serializedName: 'properties.virtualNetworkGateway1', - type: { - name: 'Composite', - className: 'VirtualNetworkConnectionGatewayReference' - } - }, - virtualNetworkGateway2: { - required: false, - serializedName: 'properties.virtualNetworkGateway2', - type: { - name: 'Composite', - className: 'VirtualNetworkConnectionGatewayReference' - } - }, - localNetworkGateway2: { - required: false, - serializedName: 'properties.localNetworkGateway2', - type: { - name: 'Composite', - className: 'VirtualNetworkConnectionGatewayReference' - } - }, - connectionType: { - required: true, - serializedName: 'properties.connectionType', - type: { - name: 'String' - } - }, - connectionProtocol: { - required: false, - serializedName: 'properties.connectionProtocol', - type: { - name: 'String' - } - }, - routingWeight: { - required: false, - serializedName: 'properties.routingWeight', - type: { - name: 'Number' - } - }, - sharedKey: { - required: false, - serializedName: 'properties.sharedKey', - type: { - name: 'String' - } - }, - connectionStatus: { - required: false, - readOnly: true, - serializedName: 'properties.connectionStatus', - type: { - name: 'String' - } - }, - tunnelConnectionStatus: { - required: false, - readOnly: true, - serializedName: 'properties.tunnelConnectionStatus', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'TunnelConnectionHealthElementType', - type: { - name: 'Composite', - className: 'TunnelConnectionHealth' - } - } - } - }, - egressBytesTransferred: { - required: false, - readOnly: true, - serializedName: 'properties.egressBytesTransferred', - type: { - name: 'Number' - } - }, - ingressBytesTransferred: { - required: false, - readOnly: true, - serializedName: 'properties.ingressBytesTransferred', - type: { - name: 'Number' - } - }, - peer: { - required: false, - serializedName: 'properties.peer', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - enableBgp: { - required: false, - serializedName: 'properties.enableBgp', - type: { - name: 'Boolean' - } - }, - usePolicyBasedTrafficSelectors: { - required: false, - serializedName: 'properties.usePolicyBasedTrafficSelectors', - type: { - name: 'Boolean' - } - }, - ipsecPolicies: { - required: false, - serializedName: 'properties.ipsecPolicies', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'IpsecPolicyElementType', - type: { - name: 'Composite', - className: 'IpsecPolicy' - } - } - } - }, - resourceGuid: { - required: false, - serializedName: 'properties.resourceGuid', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - expressRouteGatewayBypass: { - required: false, - serializedName: 'properties.expressRouteGatewayBypass', - type: { - name: 'Boolean' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VirtualNetworkGatewayConnectionListEntity; diff --git a/lib/services/networkManagement2/lib/models/virtualNetworkGatewayConnectionListResult.js b/lib/services/networkManagement2/lib/models/virtualNetworkGatewayConnectionListResult.js deleted file mode 100644 index 8bee812e8..000000000 --- a/lib/services/networkManagement2/lib/models/virtualNetworkGatewayConnectionListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 the ListVirtualNetworkGatewayConnections API service call - */ -class VirtualNetworkGatewayConnectionListResult extends Array { - /** - * Create a VirtualNetworkGatewayConnectionListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of VirtualNetworkGatewayConnectionListResult - * - * @returns {object} metadata of VirtualNetworkGatewayConnectionListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'VirtualNetworkGatewayConnectionListResult', - type: { - name: 'Composite', - className: 'VirtualNetworkGatewayConnectionListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'VirtualNetworkGatewayConnectionElementType', - type: { - name: 'Composite', - className: 'VirtualNetworkGatewayConnection' - } - } - } - }, - nextLink: { - required: false, - readOnly: true, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VirtualNetworkGatewayConnectionListResult; diff --git a/lib/services/networkManagement2/lib/models/virtualNetworkGatewayIPConfiguration.js b/lib/services/networkManagement2/lib/models/virtualNetworkGatewayIPConfiguration.js deleted file mode 100644 index d7eb83360..000000000 --- a/lib/services/networkManagement2/lib/models/virtualNetworkGatewayIPConfiguration.js +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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'); - -/** - * IP configuration for virtual network gateway - * - * @extends models['SubResource'] - */ -class VirtualNetworkGatewayIPConfiguration extends models['SubResource'] { - /** - * Create a VirtualNetworkGatewayIPConfiguration. - * @property {string} [privateIPAllocationMethod] The private IP allocation - * method. Possible values are: 'Static' and 'Dynamic'. Possible values - * include: 'Static', 'Dynamic' - * @property {object} [subnet] The reference of the subnet resource. - * @property {string} [subnet.id] Resource ID. - * @property {object} [publicIPAddress] The reference of the public IP - * resource. - * @property {string} [publicIPAddress.id] Resource ID. - * @property {string} [provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {string} [name] The 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 VirtualNetworkGatewayIPConfiguration - * - * @returns {object} metadata of VirtualNetworkGatewayIPConfiguration - * - */ - mapper() { - return { - required: false, - serializedName: 'VirtualNetworkGatewayIPConfiguration', - type: { - name: 'Composite', - className: 'VirtualNetworkGatewayIPConfiguration', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - privateIPAllocationMethod: { - required: false, - serializedName: 'properties.privateIPAllocationMethod', - type: { - name: 'String' - } - }, - subnet: { - required: false, - serializedName: 'properties.subnet', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - publicIPAddress: { - required: false, - serializedName: 'properties.publicIPAddress', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VirtualNetworkGatewayIPConfiguration; diff --git a/lib/services/networkManagement2/lib/models/virtualNetworkGatewayListConnectionsResult.js b/lib/services/networkManagement2/lib/models/virtualNetworkGatewayListConnectionsResult.js deleted file mode 100644 index 4546296ad..000000000 --- a/lib/services/networkManagement2/lib/models/virtualNetworkGatewayListConnectionsResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 the VirtualNetworkGatewayListConnections API service call - */ -class VirtualNetworkGatewayListConnectionsResult extends Array { - /** - * Create a VirtualNetworkGatewayListConnectionsResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of VirtualNetworkGatewayListConnectionsResult - * - * @returns {object} metadata of VirtualNetworkGatewayListConnectionsResult - * - */ - mapper() { - return { - required: false, - serializedName: 'VirtualNetworkGatewayListConnectionsResult', - type: { - name: 'Composite', - className: 'VirtualNetworkGatewayListConnectionsResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'VirtualNetworkGatewayConnectionListEntityElementType', - type: { - name: 'Composite', - className: 'VirtualNetworkGatewayConnectionListEntity' - } - } - } - }, - nextLink: { - required: false, - readOnly: true, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VirtualNetworkGatewayListConnectionsResult; diff --git a/lib/services/networkManagement2/lib/models/virtualNetworkGatewayListResult.js b/lib/services/networkManagement2/lib/models/virtualNetworkGatewayListResult.js deleted file mode 100644 index dbec4bd6d..000000000 --- a/lib/services/networkManagement2/lib/models/virtualNetworkGatewayListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 the ListVirtualNetworkGateways API service call. - */ -class VirtualNetworkGatewayListResult extends Array { - /** - * Create a VirtualNetworkGatewayListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of VirtualNetworkGatewayListResult - * - * @returns {object} metadata of VirtualNetworkGatewayListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'VirtualNetworkGatewayListResult', - type: { - name: 'Composite', - className: 'VirtualNetworkGatewayListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'VirtualNetworkGatewayElementType', - type: { - name: 'Composite', - className: 'VirtualNetworkGateway' - } - } - } - }, - nextLink: { - required: false, - readOnly: true, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VirtualNetworkGatewayListResult; diff --git a/lib/services/networkManagement2/lib/models/virtualNetworkGatewaySku.js b/lib/services/networkManagement2/lib/models/virtualNetworkGatewaySku.js deleted file mode 100644 index b0f94f82f..000000000 --- a/lib/services/networkManagement2/lib/models/virtualNetworkGatewaySku.js +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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'; - -/** - * VirtualNetworkGatewaySku details - * - */ -class VirtualNetworkGatewaySku { - /** - * Create a VirtualNetworkGatewaySku. - * @property {string} [name] Gateway SKU name. Possible values include: - * 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', - * 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * @property {string} [tier] Gateway SKU tier. Possible values include: - * 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', 'VpnGw1', - * 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * @property {number} [capacity] The capacity. - */ - constructor() { - } - - /** - * Defines the metadata of VirtualNetworkGatewaySku - * - * @returns {object} metadata of VirtualNetworkGatewaySku - * - */ - mapper() { - return { - required: false, - serializedName: 'VirtualNetworkGatewaySku', - type: { - name: 'Composite', - className: 'VirtualNetworkGatewaySku', - modelProperties: { - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - tier: { - required: false, - serializedName: 'tier', - type: { - name: 'String' - } - }, - capacity: { - required: false, - serializedName: 'capacity', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = VirtualNetworkGatewaySku; diff --git a/lib/services/networkManagement2/lib/models/virtualNetworkListResult.js b/lib/services/networkManagement2/lib/models/virtualNetworkListResult.js deleted file mode 100644 index 8d2d1783e..000000000 --- a/lib/services/networkManagement2/lib/models/virtualNetworkListResult.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 the ListVirtualNetworks API service call. - */ -class VirtualNetworkListResult extends Array { - /** - * Create a VirtualNetworkListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of VirtualNetworkListResult - * - * @returns {object} metadata of VirtualNetworkListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'VirtualNetworkListResult', - type: { - name: 'Composite', - className: 'VirtualNetworkListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'VirtualNetworkElementType', - type: { - name: 'Composite', - className: 'VirtualNetwork' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VirtualNetworkListResult; diff --git a/lib/services/networkManagement2/lib/models/virtualNetworkListUsageResult.js b/lib/services/networkManagement2/lib/models/virtualNetworkListUsageResult.js deleted file mode 100644 index f09e53c76..000000000 --- a/lib/services/networkManagement2/lib/models/virtualNetworkListUsageResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 the virtual networks GetUsage API service call. - */ -class VirtualNetworkListUsageResult extends Array { - /** - * Create a VirtualNetworkListUsageResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of VirtualNetworkListUsageResult - * - * @returns {object} metadata of VirtualNetworkListUsageResult - * - */ - mapper() { - return { - required: false, - serializedName: 'VirtualNetworkListUsageResult', - type: { - name: 'Composite', - className: 'VirtualNetworkListUsageResult', - modelProperties: { - value: { - required: false, - readOnly: true, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'VirtualNetworkUsageElementType', - type: { - name: 'Composite', - className: 'VirtualNetworkUsage' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VirtualNetworkListUsageResult; diff --git a/lib/services/networkManagement2/lib/models/virtualNetworkPeering.js b/lib/services/networkManagement2/lib/models/virtualNetworkPeering.js deleted file mode 100644 index cef9023dd..000000000 --- a/lib/services/networkManagement2/lib/models/virtualNetworkPeering.js +++ /dev/null @@ -1,159 +0,0 @@ -/* - * 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'); - -/** - * Peerings in a virtual network resource. - * - * @extends models['SubResource'] - */ -class VirtualNetworkPeering extends models['SubResource'] { - /** - * Create a VirtualNetworkPeering. - * @property {boolean} [allowVirtualNetworkAccess] Whether the VMs in the - * linked virtual network space would be able to access all the VMs in local - * Virtual network space. - * @property {boolean} [allowForwardedTraffic] Whether the forwarded traffic - * from the VMs in the remote virtual network will be allowed/disallowed. - * @property {boolean} [allowGatewayTransit] If gateway links can be used in - * remote virtual networking to link to this virtual network. - * @property {boolean} [useRemoteGateways] If remote gateways can be used on - * this virtual network. If the flag is set to true, and allowGatewayTransit - * on remote peering is also true, virtual network will use gateways of - * remote virtual network for transit. Only one peering can have this flag - * set to true. This flag cannot be set if virtual network already has a - * gateway. - * @property {object} [remoteVirtualNetwork] The reference of the remote - * virtual network. The remote virtual network can be in the same or - * different region (preview). See here to register for the preview and learn - * more - * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). - * @property {string} [remoteVirtualNetwork.id] Resource ID. - * @property {object} [remoteAddressSpace] The reference of the remote - * virtual network address space. - * @property {array} [remoteAddressSpace.addressPrefixes] A list of address - * blocks reserved for this virtual network in CIDR notation. - * @property {string} [peeringState] The status of the virtual network - * peering. Possible values are 'Initiated', 'Connected', and 'Disconnected'. - * Possible values include: 'Initiated', 'Connected', 'Disconnected' - * @property {string} [provisioningState] The provisioning state of the - * resource. - * @property {string} [name] The 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 VirtualNetworkPeering - * - * @returns {object} metadata of VirtualNetworkPeering - * - */ - mapper() { - return { - required: false, - serializedName: 'VirtualNetworkPeering', - type: { - name: 'Composite', - className: 'VirtualNetworkPeering', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - allowVirtualNetworkAccess: { - required: false, - serializedName: 'properties.allowVirtualNetworkAccess', - type: { - name: 'Boolean' - } - }, - allowForwardedTraffic: { - required: false, - serializedName: 'properties.allowForwardedTraffic', - type: { - name: 'Boolean' - } - }, - allowGatewayTransit: { - required: false, - serializedName: 'properties.allowGatewayTransit', - type: { - name: 'Boolean' - } - }, - useRemoteGateways: { - required: false, - serializedName: 'properties.useRemoteGateways', - type: { - name: 'Boolean' - } - }, - remoteVirtualNetwork: { - required: false, - serializedName: 'properties.remoteVirtualNetwork', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - remoteAddressSpace: { - required: false, - serializedName: 'properties.remoteAddressSpace', - type: { - name: 'Composite', - className: 'AddressSpace' - } - }, - peeringState: { - required: false, - serializedName: 'properties.peeringState', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VirtualNetworkPeering; diff --git a/lib/services/networkManagement2/lib/models/virtualNetworkPeeringListResult.js b/lib/services/networkManagement2/lib/models/virtualNetworkPeeringListResult.js deleted file mode 100644 index 298ee2478..000000000 --- a/lib/services/networkManagement2/lib/models/virtualNetworkPeeringListResult.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 ListSubnets API service call. Retrieves all subnets that belong - * to a virtual network. - */ -class VirtualNetworkPeeringListResult extends Array { - /** - * Create a VirtualNetworkPeeringListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of VirtualNetworkPeeringListResult - * - * @returns {object} metadata of VirtualNetworkPeeringListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'VirtualNetworkPeeringListResult', - type: { - name: 'Composite', - className: 'VirtualNetworkPeeringListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'VirtualNetworkPeeringElementType', - type: { - name: 'Composite', - className: 'VirtualNetworkPeering' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VirtualNetworkPeeringListResult; diff --git a/lib/services/networkManagement2/lib/models/virtualNetworkTap.js b/lib/services/networkManagement2/lib/models/virtualNetworkTap.js deleted file mode 100644 index 7a465cf8b..000000000 --- a/lib/services/networkManagement2/lib/models/virtualNetworkTap.js +++ /dev/null @@ -1,804 +0,0 @@ -/* - * 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'); - -/** - * Virtual Network Tap resource - * - * @extends models['Resource'] - */ -class VirtualNetworkTap extends models['Resource'] { - /** - * Create a VirtualNetworkTap. - * @property {array} [networkInterfaceTapConfigurations] Specifies the list - * of resource IDs for the network interface IP configuration that needs to - * be tapped. - * @property {string} [resourceGuid] The resourceGuid property of the virtual - * network tap. - * @property {string} [provisioningState] The provisioning state of the - * virtual network tap. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * @property {object} [destinationNetworkInterfaceIPConfiguration] The - * reference to the private IP Address of the collector nic that will receive - * the tap - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.virtualNetworkTaps] The - * reference to Virtual Network Taps. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.applicationGatewayBackendAddressPools] - * The reference of ApplicationGatewayBackendAddressPool resource. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.loadBalancerBackendAddressPools] - * The reference of LoadBalancerBackendAddressPool resource. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.loadBalancerInboundNatRules] A - * list of references of LoadBalancerInboundNatRules. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.privateIPAddress] Private IP - * address of the IP configuration. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.privateIPAllocationMethod] - * Defines how a private IP address is assigned. Possible values are: - * 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.privateIPAddressVersion] - * Available from Api-Version 2016-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * @property {object} [destinationNetworkInterfaceIPConfiguration.subnet] - * Subnet bound to the IP configuration. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.subnet.addressPrefix] The - * address prefix for the subnet. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.addressPrefixes] List - * of address prefixes for the subnet. - * @property {object} - * [destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.networkInterfaces] - * A collection of references to network interfaces. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.subnets] - * A collection of references to subnets. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [destinationNetworkInterfaceIPConfiguration.subnet.routeTable] The - * reference of the RouteTable resource. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.routeTable.subnets] A - * collection of references to subnets. - * @property {boolean} - * [destinationNetworkInterfaceIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.subnet.routeTable.etag] Gets a - * unique read-only string that changes whenever the resource is updated. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.serviceEndpoints] An - * array of service endpoints. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.interfaceEndpoints] An - * array of references to interface endpoints - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.ipConfigurations] Gets - * an array of references to the network interface IP configurations using - * subnet. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.ipConfigurationProfiles] - * Array of IP configuration profiles which reference this subnet. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.subnet.delegations] Gets an - * array of references to the delegations on the subnet. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.subnet.purpose] A read-only - * string identifying the intention of use for this subnet based on - * delegations and other user-defined properties. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.subnet.provisioningState] The - * provisioning state of the resource. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.subnet.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.subnet.etag] A unique - * read-only string that changes whenever the resource is updated. - * @property {boolean} [destinationNetworkInterfaceIPConfiguration.primary] - * Gets whether this is a primary customer address on the network interface. - * @property {object} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress] Public IP - * address bound to the IP configuration. - * @property {object} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.sku] The - * public IP address SKU. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.sku.name] Name - * of a public IP address SKU. Possible values include: 'Basic', 'Standard' - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * @property {object} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration] - * The IP configuration associated with the public IP address. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.privateIPAllocationMethod] - * The private IP allocation method. Possible values are 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {object} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet] - * The reference of the subnet resource. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * @property {object} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] - * A collection of references to network interfaces. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.subnets] - * A collection of references to subnets. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.subnets] - * A collection of references to subnets. - * @property {boolean} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.interfaceEndpoints] - * An array of references to interface endpoints - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurations] - * Gets an array of references to the network interface IP configurations - * using subnet. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurationProfiles] - * Array of IP configuration profiles which reference this subnet. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.purpose] - * A read-only string identifying the intention of use for this subnet based - * on delegations and other user-defined properties. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.subnet.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.publicIPAddress] - * The reference of the public IP resource. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain - * name associated with the public IP address. If a domain name label is - * specified, an A DNS record is created for the public IP in the Microsoft - * Azure DNS system. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and - * the regionalized DNS zone. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipTags] The - * list of tags associated with the public IP address. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.ipAddress] The - * IP address associated with the public IP address resource. - * @property {object} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.publicIPPrefix.id] - * Resource ID. - * @property {number} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.etag] A unique - * read-only string that changes whenever the resource is updated. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.publicIPAddress.zones] A list - * of availability zones denoting the IP allocated for the resource needs to - * come from. - * @property {array} - * [destinationNetworkInterfaceIPConfiguration.applicationSecurityGroups] - * Application security groups in which the IP configuration is included. - * @property {string} - * [destinationNetworkInterfaceIPConfiguration.provisioningState] The - * provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} [destinationNetworkInterfaceIPConfiguration.name] The - * name of the resource that is unique within a resource group. This name can - * be used to access the resource. - * @property {string} [destinationNetworkInterfaceIPConfiguration.etag] A - * unique read-only string that changes whenever the resource is updated. - * @property {object} [destinationLoadBalancerFrontEndIPConfiguration] The - * reference to the private IP address on the internal Load Balancer that - * will receive the tap - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.inboundNatRules] Read - * only. Inbound rules URIs that use this frontend IP. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.inboundNatPools] Read - * only. Inbound pools URIs that use this frontend IP. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.outboundRules] Read only. - * Outbound rules URIs that use this frontend IP. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.loadBalancingRules] Gets - * load balancing rules URIs that use this frontend IP. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.privateIPAddress] The - * private IP address of the IP configuration. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.privateIPAllocationMethod] - * The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {object} [destinationLoadBalancerFrontEndIPConfiguration.subnet] - * The reference of the subnet resource. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefix] The - * address prefix for the subnet. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * @property {object} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.networkInterfaces] - * A collection of references to network interfaces. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.subnets] - * A collection of references to subnets. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable] The - * reference of the RouteTable resource. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.subnets] - * A collection of references to subnets. - * @property {boolean} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.interfaceEndpoints] - * An array of references to interface endpoints - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.ipConfigurations] - * Gets an array of references to the network interface IP configurations - * using subnet. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.ipConfigurationProfiles] - * Array of IP configuration profiles which reference this subnet. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.delegations] Gets - * an array of references to the delegations on the subnet. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.purpose] A - * read-only string identifying the intention of use for this subnet based on - * delegations and other user-defined properties. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.name] The name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.subnet.etag] A unique - * read-only string that changes whenever the resource is updated. - * @property {object} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress] The - * reference of the Public IP resource. - * @property {object} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku] The - * public IP address SKU. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku.name] - * Name of a public IP address SKU. Possible values include: 'Basic', - * 'Standard' - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * @property {object} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration] - * The IP configuration associated with the public IP address. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.privateIPAllocationMethod] - * The private IP allocation method. Possible values are 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * @property {object} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet] - * The reference of the subnet resource. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * @property {object} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.networkInterfaces] - * A collection of references to network interfaces. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.subnets] - * A collection of references to subnets. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.subnets] - * A collection of references to subnets. - * @property {boolean} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.interfaceEndpoints] - * An array of references to interface endpoints - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurations] - * Gets an array of references to the network interface IP configurations - * using subnet. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.ipConfigurationProfiles] - * Array of IP configuration profiles which reference this subnet. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.purpose] - * A read-only string identifying the intention of use for this subnet based - * on delegations and other user-defined properties. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.subnet.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.publicIPAddress] - * The reference of the public IP resource. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values - * are: 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * @property {object} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain - * name associated with the public IP address. If a domain name label is - * specified, an A DNS record is created for the public IP in the Microsoft - * Azure DNS system. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and - * the regionalized DNS zone. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipTags] - * The list of tags associated with the public IP address. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipAddress] - * The IP address associated with the public IP address resource. - * @property {object} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix.id] - * Resource ID. - * @property {number} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.etag] A - * unique read-only string that changes whenever the resource is updated. - * @property {array} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.zones] A - * list of availability zones denoting the IP allocated for the resource - * needs to come from. - * @property {object} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix] The - * reference of the Public IP Prefix resource. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix.id] - * Resource ID. - * @property {string} - * [destinationLoadBalancerFrontEndIPConfiguration.provisioningState] Gets - * the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * @property {string} [destinationLoadBalancerFrontEndIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * @property {string} [destinationLoadBalancerFrontEndIPConfiguration.etag] A - * unique read-only string that changes whenever the resource is updated. - * @property {array} [destinationLoadBalancerFrontEndIPConfiguration.zones] A - * list of availability zones denoting the IP allocated for the resource - * needs to come from. - * @property {number} [destinationPort] The VXLAN destination port that will - * receive the tapped traffic. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of VirtualNetworkTap - * - * @returns {object} metadata of VirtualNetworkTap - * - */ - mapper() { - return { - required: false, - serializedName: 'VirtualNetworkTap', - type: { - name: 'Composite', - className: 'VirtualNetworkTap', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - networkInterfaceTapConfigurations: { - required: false, - readOnly: true, - serializedName: 'properties.networkInterfaceTapConfigurations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'NetworkInterfaceTapConfigurationElementType', - type: { - name: 'Composite', - className: 'NetworkInterfaceTapConfiguration' - } - } - } - }, - resourceGuid: { - required: false, - readOnly: true, - serializedName: 'properties.resourceGuid', - type: { - name: 'String' - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - destinationNetworkInterfaceIPConfiguration: { - required: false, - serializedName: 'properties.destinationNetworkInterfaceIPConfiguration', - type: { - name: 'Composite', - className: 'NetworkInterfaceIPConfiguration' - } - }, - destinationLoadBalancerFrontEndIPConfiguration: { - required: false, - serializedName: 'properties.destinationLoadBalancerFrontEndIPConfiguration', - type: { - name: 'Composite', - className: 'FrontendIPConfiguration' - } - }, - destinationPort: { - required: false, - serializedName: 'properties.destinationPort', - type: { - name: 'Number' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VirtualNetworkTap; diff --git a/lib/services/networkManagement2/lib/models/virtualNetworkTapListResult.js b/lib/services/networkManagement2/lib/models/virtualNetworkTapListResult.js deleted file mode 100644 index ac9069635..000000000 --- a/lib/services/networkManagement2/lib/models/virtualNetworkTapListResult.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 ListVirtualNetworkTap API service call. - */ -class VirtualNetworkTapListResult extends Array { - /** - * Create a VirtualNetworkTapListResult. - * @property {string} [nextLink] The URL to get the next set of results. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of VirtualNetworkTapListResult - * - * @returns {object} metadata of VirtualNetworkTapListResult - * - */ - mapper() { - return { - required: false, - serializedName: 'VirtualNetworkTapListResult', - type: { - name: 'Composite', - className: 'VirtualNetworkTapListResult', - modelProperties: { - value: { - required: false, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'VirtualNetworkTapElementType', - type: { - name: 'Composite', - className: 'VirtualNetworkTap' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VirtualNetworkTapListResult; diff --git a/lib/services/networkManagement2/lib/models/virtualNetworkUsage.js b/lib/services/networkManagement2/lib/models/virtualNetworkUsage.js deleted file mode 100644 index a5b32e217..000000000 --- a/lib/services/networkManagement2/lib/models/virtualNetworkUsage.js +++ /dev/null @@ -1,95 +0,0 @@ -/* - * 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'; - -/** - * Usage details for subnet. - * - */ -class VirtualNetworkUsage { - /** - * Create a VirtualNetworkUsage. - * @property {number} [currentValue] Indicates number of IPs used from the - * Subnet. - * @property {string} [id] Subnet identifier. - * @property {number} [limit] Indicates the size of the subnet. - * @property {object} [name] The name containing common and localized value - * for usage. - * @property {string} [name.localizedValue] Localized subnet size and usage - * string. - * @property {string} [name.value] Subnet size and usage string. - * @property {string} [unit] Usage units. Returns 'Count' - */ - constructor() { - } - - /** - * Defines the metadata of VirtualNetworkUsage - * - * @returns {object} metadata of VirtualNetworkUsage - * - */ - mapper() { - return { - required: false, - serializedName: 'VirtualNetworkUsage', - type: { - name: 'Composite', - className: 'VirtualNetworkUsage', - modelProperties: { - currentValue: { - required: false, - readOnly: true, - serializedName: 'currentValue', - type: { - name: 'Number' - } - }, - id: { - required: false, - readOnly: true, - serializedName: 'id', - type: { - name: 'String' - } - }, - limit: { - required: false, - readOnly: true, - serializedName: 'limit', - type: { - name: 'Number' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'Composite', - className: 'VirtualNetworkUsageName' - } - }, - unit: { - required: false, - readOnly: true, - serializedName: 'unit', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VirtualNetworkUsage; diff --git a/lib/services/networkManagement2/lib/models/virtualNetworkUsageName.js b/lib/services/networkManagement2/lib/models/virtualNetworkUsageName.js deleted file mode 100644 index c78bed08a..000000000 --- a/lib/services/networkManagement2/lib/models/virtualNetworkUsageName.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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'; - -/** - * Usage strings container. - * - */ -class VirtualNetworkUsageName { - /** - * Create a VirtualNetworkUsageName. - * @property {string} [localizedValue] Localized subnet size and usage - * string. - * @property {string} [value] Subnet size and usage string. - */ - constructor() { - } - - /** - * Defines the metadata of VirtualNetworkUsageName - * - * @returns {object} metadata of VirtualNetworkUsageName - * - */ - mapper() { - return { - required: false, - serializedName: 'VirtualNetworkUsageName', - type: { - name: 'Composite', - className: 'VirtualNetworkUsageName', - modelProperties: { - localizedValue: { - required: false, - readOnly: true, - serializedName: 'localizedValue', - type: { - name: 'String' - } - }, - value: { - required: false, - readOnly: true, - serializedName: 'value', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VirtualNetworkUsageName; diff --git a/lib/services/networkManagement2/lib/models/virtualWAN.js b/lib/services/networkManagement2/lib/models/virtualWAN.js deleted file mode 100644 index 96ce28325..000000000 --- a/lib/services/networkManagement2/lib/models/virtualWAN.js +++ /dev/null @@ -1,208 +0,0 @@ -/* - * 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'); - -/** - * VirtualWAN Resource. - * - * @extends models['Resource'] - */ -class VirtualWAN extends models['Resource'] { - /** - * Create a VirtualWAN. - * @property {boolean} [disableVpnEncryption] Vpn encryption to be disabled - * or not. - * @property {array} [virtualHubs] List of VirtualHubs in the VirtualWAN. - * @property {array} [vpnSites] - * @property {string} [securityProviderName] The Security Provider name. - * @property {boolean} [allowBranchToBranchTraffic] True if branch to branch - * traffic is allowed. - * @property {boolean} [allowVnetToVnetTraffic] True if Vnet to Vnet traffic - * is allowed. - * @property {string} [office365LocalBreakoutCategory] The office local - * breakout category. Possible values include: 'Optimize', - * 'OptimizeAndAllow', 'All', 'None' - * @property {array} [p2SVpnServerConfigurations] list of all - * P2SVpnServerConfigurations associated with the virtual wan. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of VirtualWAN - * - * @returns {object} metadata of VirtualWAN - * - */ - mapper() { - return { - required: false, - serializedName: 'VirtualWAN', - type: { - name: 'Composite', - className: 'VirtualWAN', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - disableVpnEncryption: { - required: false, - serializedName: 'properties.disableVpnEncryption', - type: { - name: 'Boolean' - } - }, - virtualHubs: { - required: false, - readOnly: true, - serializedName: 'properties.virtualHubs', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SubResourceElementType', - type: { - name: 'Composite', - className: 'SubResource' - } - } - } - }, - vpnSites: { - required: false, - readOnly: true, - serializedName: 'properties.vpnSites', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SubResourceElementType', - type: { - name: 'Composite', - className: 'SubResource' - } - } - } - }, - securityProviderName: { - required: false, - serializedName: 'properties.securityProviderName', - type: { - name: 'String' - } - }, - allowBranchToBranchTraffic: { - required: false, - serializedName: 'properties.allowBranchToBranchTraffic', - type: { - name: 'Boolean' - } - }, - allowVnetToVnetTraffic: { - required: false, - serializedName: 'properties.allowVnetToVnetTraffic', - type: { - name: 'Boolean' - } - }, - office365LocalBreakoutCategory: { - required: false, - serializedName: 'properties.office365LocalBreakoutCategory', - type: { - name: 'String' - } - }, - p2SVpnServerConfigurations: { - required: false, - serializedName: 'properties.p2SVpnServerConfigurations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'P2SVpnServerConfigurationElementType', - type: { - name: 'Composite', - className: 'P2SVpnServerConfiguration' - } - } - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - etag: { - required: false, - readOnly: true, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VirtualWAN; diff --git a/lib/services/networkManagement2/lib/models/virtualWanSecurityProvider.js b/lib/services/networkManagement2/lib/models/virtualWanSecurityProvider.js deleted file mode 100644 index d7185cbc4..000000000 --- a/lib/services/networkManagement2/lib/models/virtualWanSecurityProvider.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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'; - -/** - * Collection of SecurityProviders. - * - */ -class VirtualWanSecurityProvider { - /** - * Create a VirtualWanSecurityProvider. - * @property {string} [name] Name of the security provider. - * @property {string} [url] Url of the security provider. - * @property {string} [type] Name of the security provider. Possible values - * include: 'External', 'Native' - */ - constructor() { - } - - /** - * Defines the metadata of VirtualWanSecurityProvider - * - * @returns {object} metadata of VirtualWanSecurityProvider - * - */ - mapper() { - return { - required: false, - serializedName: 'VirtualWanSecurityProvider', - type: { - name: 'Composite', - className: 'VirtualWanSecurityProvider', - modelProperties: { - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - url: { - required: false, - serializedName: 'url', - type: { - name: 'String' - } - }, - type: { - required: false, - serializedName: 'type', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VirtualWanSecurityProvider; diff --git a/lib/services/networkManagement2/lib/models/virtualWanSecurityProviders.js b/lib/services/networkManagement2/lib/models/virtualWanSecurityProviders.js deleted file mode 100644 index c440949c2..000000000 --- a/lib/services/networkManagement2/lib/models/virtualWanSecurityProviders.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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'; - -/** - * Collection of SecurityProviders. - * - */ -class VirtualWanSecurityProviders { - /** - * Create a VirtualWanSecurityProviders. - * @property {array} [supportedProviders] - */ - constructor() { - } - - /** - * Defines the metadata of VirtualWanSecurityProviders - * - * @returns {object} metadata of VirtualWanSecurityProviders - * - */ - mapper() { - return { - required: false, - serializedName: 'VirtualWanSecurityProviders', - type: { - name: 'Composite', - className: 'VirtualWanSecurityProviders', - modelProperties: { - supportedProviders: { - required: false, - serializedName: 'supportedProviders', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'VirtualWanSecurityProviderElementType', - type: { - name: 'Composite', - className: 'VirtualWanSecurityProvider' - } - } - } - } - } - } - }; - } -} - -module.exports = VirtualWanSecurityProviders; diff --git a/lib/services/networkManagement2/lib/models/vpnClientConfiguration.js b/lib/services/networkManagement2/lib/models/vpnClientConfiguration.js deleted file mode 100644 index a90e51809..000000000 --- a/lib/services/networkManagement2/lib/models/vpnClientConfiguration.js +++ /dev/null @@ -1,141 +0,0 @@ -/* - * 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'; - -/** - * VpnClientConfiguration for P2S client. - * - */ -class VpnClientConfiguration { - /** - * Create a VpnClientConfiguration. - * @property {object} [vpnClientAddressPool] The reference of the address - * space resource which represents Address space for P2S VpnClient. - * @property {array} [vpnClientAddressPool.addressPrefixes] A list of address - * blocks reserved for this virtual network in CIDR notation. - * @property {array} [vpnClientRootCertificates] VpnClientRootCertificate for - * virtual network gateway. - * @property {array} [vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. - * @property {array} [vpnClientProtocols] VpnClientProtocols for Virtual - * network gateway. - * @property {array} [vpnClientIpsecPolicies] VpnClientIpsecPolicies for - * virtual network gateway P2S client. - * @property {string} [radiusServerAddress] The radius server address - * property of the VirtualNetworkGateway resource for vpn client connection. - * @property {string} [radiusServerSecret] The radius secret property of the - * VirtualNetworkGateway resource for vpn client connection. - */ - constructor() { - } - - /** - * Defines the metadata of VpnClientConfiguration - * - * @returns {object} metadata of VpnClientConfiguration - * - */ - mapper() { - return { - required: false, - serializedName: 'VpnClientConfiguration', - type: { - name: 'Composite', - className: 'VpnClientConfiguration', - modelProperties: { - vpnClientAddressPool: { - required: false, - serializedName: 'vpnClientAddressPool', - type: { - name: 'Composite', - className: 'AddressSpace' - } - }, - vpnClientRootCertificates: { - required: false, - serializedName: 'vpnClientRootCertificates', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'VpnClientRootCertificateElementType', - type: { - name: 'Composite', - className: 'VpnClientRootCertificate' - } - } - } - }, - vpnClientRevokedCertificates: { - required: false, - serializedName: 'vpnClientRevokedCertificates', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'VpnClientRevokedCertificateElementType', - type: { - name: 'Composite', - className: 'VpnClientRevokedCertificate' - } - } - } - }, - vpnClientProtocols: { - required: false, - serializedName: 'vpnClientProtocols', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'VpnClientProtocolElementType', - type: { - name: 'String' - } - } - } - }, - vpnClientIpsecPolicies: { - required: false, - serializedName: 'vpnClientIpsecPolicies', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'IpsecPolicyElementType', - type: { - name: 'Composite', - className: 'IpsecPolicy' - } - } - } - }, - radiusServerAddress: { - required: false, - serializedName: 'radiusServerAddress', - type: { - name: 'String' - } - }, - radiusServerSecret: { - required: false, - serializedName: 'radiusServerSecret', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VpnClientConfiguration; diff --git a/lib/services/networkManagement2/lib/models/vpnClientConnectionHealth.js b/lib/services/networkManagement2/lib/models/vpnClientConnectionHealth.js deleted file mode 100644 index b8407c21d..000000000 --- a/lib/services/networkManagement2/lib/models/vpnClientConnectionHealth.js +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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'; - -/** - * VpnClientConnectionHealth properties - * - */ -class VpnClientConnectionHealth { - /** - * Create a VpnClientConnectionHealth. - * @property {number} [totalIngressBytesTransferred] Total of the Ingress - * Bytes Transferred in this P2S Vpn connection - * @property {number} [totalEgressBytesTransferred] Total of the Egress Bytes - * Transferred in this connection - * @property {number} [vpnClientConnectionsCount] The total of p2s vpn - * clients connected at this time to this P2SVpnGateway. - * @property {array} [allocatedIpAddresses] List of allocated ip addresses to - * the connected p2s vpn clients. - */ - constructor() { - } - - /** - * Defines the metadata of VpnClientConnectionHealth - * - * @returns {object} metadata of VpnClientConnectionHealth - * - */ - mapper() { - return { - required: false, - serializedName: 'VpnClientConnectionHealth', - type: { - name: 'Composite', - className: 'VpnClientConnectionHealth', - modelProperties: { - totalIngressBytesTransferred: { - required: false, - readOnly: true, - serializedName: 'totalIngressBytesTransferred', - type: { - name: 'Number' - } - }, - totalEgressBytesTransferred: { - required: false, - readOnly: true, - serializedName: 'totalEgressBytesTransferred', - type: { - name: 'Number' - } - }, - vpnClientConnectionsCount: { - required: false, - serializedName: 'vpnClientConnectionsCount', - type: { - name: 'Number' - } - }, - allocatedIpAddresses: { - required: false, - serializedName: 'allocatedIpAddresses', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - } - } - } - }; - } -} - -module.exports = VpnClientConnectionHealth; diff --git a/lib/services/networkManagement2/lib/models/vpnClientIPsecParameters.js b/lib/services/networkManagement2/lib/models/vpnClientIPsecParameters.js deleted file mode 100644 index aa396bea3..000000000 --- a/lib/services/networkManagement2/lib/models/vpnClientIPsecParameters.js +++ /dev/null @@ -1,122 +0,0 @@ -/* - * 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'; - -/** - * An IPSec parameters for a virtual network gateway P2S connection. - * - */ -class VpnClientIPsecParameters { - /** - * Create a VpnClientIPsecParameters. - * @property {number} saLifeTimeSeconds The IPSec Security Association (also - * called Quick Mode or Phase 2 SA) lifetime in seconds for P2S client. - * @property {number} saDataSizeKilobytes The IPSec Security Association - * (also called Quick Mode or Phase 2 SA) payload size in KB for P2S client.. - * @property {string} ipsecEncryption The IPSec encryption algorithm (IKE - * phase 1). Possible values include: 'None', 'DES', 'DES3', 'AES128', - * 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' - * @property {string} ipsecIntegrity The IPSec integrity algorithm (IKE phase - * 1). Possible values include: 'MD5', 'SHA1', 'SHA256', 'GCMAES128', - * 'GCMAES192', 'GCMAES256' - * @property {string} ikeEncryption The IKE encryption algorithm (IKE phase - * 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', - * 'GCMAES256', 'GCMAES128' - * @property {string} ikeIntegrity The IKE integrity algorithm (IKE phase 2). - * Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384', 'GCMAES256', - * 'GCMAES128' - * @property {string} dhGroup The DH Groups used in IKE Phase 1 for initial - * SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', - * 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' - * @property {string} pfsGroup The Pfs Groups used in IKE Phase 2 for new - * child SA. Possible values include: 'None', 'PFS1', 'PFS2', 'PFS2048', - * 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' - */ - constructor() { - } - - /** - * Defines the metadata of VpnClientIPsecParameters - * - * @returns {object} metadata of VpnClientIPsecParameters - * - */ - mapper() { - return { - required: false, - serializedName: 'VpnClientIPsecParameters', - type: { - name: 'Composite', - className: 'VpnClientIPsecParameters', - modelProperties: { - saLifeTimeSeconds: { - required: true, - serializedName: 'saLifeTimeSeconds', - type: { - name: 'Number' - } - }, - saDataSizeKilobytes: { - required: true, - serializedName: 'saDataSizeKilobytes', - type: { - name: 'Number' - } - }, - ipsecEncryption: { - required: true, - serializedName: 'ipsecEncryption', - type: { - name: 'String' - } - }, - ipsecIntegrity: { - required: true, - serializedName: 'ipsecIntegrity', - type: { - name: 'String' - } - }, - ikeEncryption: { - required: true, - serializedName: 'ikeEncryption', - type: { - name: 'String' - } - }, - ikeIntegrity: { - required: true, - serializedName: 'ikeIntegrity', - type: { - name: 'String' - } - }, - dhGroup: { - required: true, - serializedName: 'dhGroup', - type: { - name: 'String' - } - }, - pfsGroup: { - required: true, - serializedName: 'pfsGroup', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VpnClientIPsecParameters; diff --git a/lib/services/networkManagement2/lib/models/vpnClientParameters.js b/lib/services/networkManagement2/lib/models/vpnClientParameters.js deleted file mode 100644 index 5511de202..000000000 --- a/lib/services/networkManagement2/lib/models/vpnClientParameters.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * 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'; - -/** - * Vpn Client Parameters for package generation - * - */ -class VpnClientParameters { - /** - * Create a VpnClientParameters. - * @property {string} [processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' - * @property {string} [authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * @property {string} [radiusServerAuthCertificate] The public certificate - * data for the radius server authentication certificate as a Base-64 encoded - * string. Required only if external radius authentication has been - * configured with EAPTLS authentication. - * @property {array} [clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. - */ - constructor() { - } - - /** - * Defines the metadata of VpnClientParameters - * - * @returns {object} metadata of VpnClientParameters - * - */ - mapper() { - return { - required: false, - serializedName: 'VpnClientParameters', - type: { - name: 'Composite', - className: 'VpnClientParameters', - modelProperties: { - processorArchitecture: { - required: false, - serializedName: 'processorArchitecture', - type: { - name: 'String' - } - }, - authenticationMethod: { - required: false, - serializedName: 'authenticationMethod', - type: { - name: 'String' - } - }, - radiusServerAuthCertificate: { - required: false, - serializedName: 'radiusServerAuthCertificate', - type: { - name: 'String' - } - }, - clientRootCertificates: { - required: false, - serializedName: 'clientRootCertificates', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - } - } - } - }; - } -} - -module.exports = VpnClientParameters; diff --git a/lib/services/networkManagement2/lib/models/vpnClientRevokedCertificate.js b/lib/services/networkManagement2/lib/models/vpnClientRevokedCertificate.js deleted file mode 100644 index 25974939a..000000000 --- a/lib/services/networkManagement2/lib/models/vpnClientRevokedCertificate.js +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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'); - -/** - * VPN client revoked certificate of virtual network gateway. - * - * @extends models['SubResource'] - */ -class VpnClientRevokedCertificate extends models['SubResource'] { - /** - * Create a VpnClientRevokedCertificate. - * @property {string} [thumbprint] The revoked VPN client certificate - * thumbprint. - * @property {string} [provisioningState] The provisioning state of the VPN - * client revoked certificate resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [name] The 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 VpnClientRevokedCertificate - * - * @returns {object} metadata of VpnClientRevokedCertificate - * - */ - mapper() { - return { - required: false, - serializedName: 'VpnClientRevokedCertificate', - type: { - name: 'Composite', - className: 'VpnClientRevokedCertificate', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - thumbprint: { - required: false, - serializedName: 'properties.thumbprint', - 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, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VpnClientRevokedCertificate; diff --git a/lib/services/networkManagement2/lib/models/vpnClientRootCertificate.js b/lib/services/networkManagement2/lib/models/vpnClientRootCertificate.js deleted file mode 100644 index 5e5e2c515..000000000 --- a/lib/services/networkManagement2/lib/models/vpnClientRootCertificate.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * 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'); - -/** - * VPN client root certificate of virtual network gateway - * - * @extends models['SubResource'] - */ -class VpnClientRootCertificate extends models['SubResource'] { - /** - * Create a VpnClientRootCertificate. - * @property {string} publicCertData The certificate public data. - * @property {string} [provisioningState] The provisioning state of the VPN - * client root certificate resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * @property {string} [name] The 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 VpnClientRootCertificate - * - * @returns {object} metadata of VpnClientRootCertificate - * - */ - mapper() { - return { - required: false, - serializedName: 'VpnClientRootCertificate', - type: { - name: 'Composite', - className: 'VpnClientRootCertificate', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - publicCertData: { - required: true, - serializedName: 'properties.publicCertData', - 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, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VpnClientRootCertificate; diff --git a/lib/services/networkManagement2/lib/models/vpnConnection.js b/lib/services/networkManagement2/lib/models/vpnConnection.js deleted file mode 100644 index 28a80804d..000000000 --- a/lib/services/networkManagement2/lib/models/vpnConnection.js +++ /dev/null @@ -1,195 +0,0 @@ -/* - * 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'); - -/** - * VpnConnection Resource. - * - * @extends models['SubResource'] - */ -class VpnConnection extends models['SubResource'] { - /** - * Create a VpnConnection. - * @property {object} [remoteVpnSite] Id of the connected vpn site. - * @property {string} [remoteVpnSite.id] Resource ID. - * @property {number} [routingWeight] routing weight for vpn connection. - * @property {string} [connectionStatus] The connection status. Possible - * values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' - * @property {string} [vpnConnectionProtocolType] Connection protocol used - * for this connection. Possible values include: 'IKEv2', 'IKEv1' - * @property {number} [ingressBytesTransferred] Ingress bytes transferred. - * @property {number} [egressBytesTransferred] Egress bytes transferred. - * @property {number} [connectionBandwidth] Expected bandwidth in MBPS. - * @property {string} [sharedKey] SharedKey for the vpn connection. - * @property {boolean} [enableBgp] EnableBgp flag - * @property {array} [ipsecPolicies] The IPSec Policies to be considered by - * this connection. - * @property {boolean} [enableRateLimiting] EnableBgp flag - * @property {boolean} [enableInternetSecurity] Enable internet security - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * @property {string} [name] The name of the resource that is unique within a - * resource group. This name can be used to access the resource. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of VpnConnection - * - * @returns {object} metadata of VpnConnection - * - */ - mapper() { - return { - required: false, - serializedName: 'VpnConnection', - type: { - name: 'Composite', - className: 'VpnConnection', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - remoteVpnSite: { - required: false, - serializedName: 'properties.remoteVpnSite', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - routingWeight: { - required: false, - serializedName: 'properties.routingWeight', - type: { - name: 'Number' - } - }, - connectionStatus: { - required: false, - serializedName: 'properties.connectionStatus', - type: { - name: 'String' - } - }, - vpnConnectionProtocolType: { - required: false, - serializedName: 'properties.vpnConnectionProtocolType', - type: { - name: 'String' - } - }, - ingressBytesTransferred: { - required: false, - readOnly: true, - serializedName: 'properties.ingressBytesTransferred', - type: { - name: 'Number' - } - }, - egressBytesTransferred: { - required: false, - readOnly: true, - serializedName: 'properties.egressBytesTransferred', - type: { - name: 'Number' - } - }, - connectionBandwidth: { - required: false, - serializedName: 'properties.connectionBandwidth', - type: { - name: 'Number' - } - }, - sharedKey: { - required: false, - serializedName: 'properties.sharedKey', - type: { - name: 'String' - } - }, - enableBgp: { - required: false, - serializedName: 'properties.enableBgp', - type: { - name: 'Boolean' - } - }, - ipsecPolicies: { - required: false, - serializedName: 'properties.ipsecPolicies', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'IpsecPolicyElementType', - type: { - name: 'Composite', - className: 'IpsecPolicy' - } - } - } - }, - enableRateLimiting: { - required: false, - serializedName: 'properties.enableRateLimiting', - type: { - name: 'Boolean' - } - }, - enableInternetSecurity: { - required: false, - serializedName: 'properties.enableInternetSecurity', - type: { - name: 'Boolean' - } - }, - provisioningState: { - required: false, - 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 = VpnConnection; diff --git a/lib/services/networkManagement2/lib/models/vpnDeviceScriptParameters.js b/lib/services/networkManagement2/lib/models/vpnDeviceScriptParameters.js deleted file mode 100644 index 984bdaeb1..000000000 --- a/lib/services/networkManagement2/lib/models/vpnDeviceScriptParameters.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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'; - -/** - * Vpn device configuration script generation parameters - * - */ -class VpnDeviceScriptParameters { - /** - * Create a VpnDeviceScriptParameters. - * @property {string} [vendor] The vendor for the vpn device. - * @property {string} [deviceFamily] The device family for the vpn device. - * @property {string} [firmwareVersion] The firmware version for the vpn - * device. - */ - constructor() { - } - - /** - * Defines the metadata of VpnDeviceScriptParameters - * - * @returns {object} metadata of VpnDeviceScriptParameters - * - */ - mapper() { - return { - required: false, - serializedName: 'VpnDeviceScriptParameters', - type: { - name: 'Composite', - className: 'VpnDeviceScriptParameters', - modelProperties: { - vendor: { - required: false, - serializedName: 'vendor', - type: { - name: 'String' - } - }, - deviceFamily: { - required: false, - serializedName: 'deviceFamily', - type: { - name: 'String' - } - }, - firmwareVersion: { - required: false, - serializedName: 'firmwareVersion', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VpnDeviceScriptParameters; diff --git a/lib/services/networkManagement2/lib/models/vpnGateway.js b/lib/services/networkManagement2/lib/models/vpnGateway.js deleted file mode 100644 index c19b48ab5..000000000 --- a/lib/services/networkManagement2/lib/models/vpnGateway.js +++ /dev/null @@ -1,164 +0,0 @@ -/* - * 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'); - -/** - * VpnGateway Resource. - * - * @extends models['Resource'] - */ -class VpnGateway extends models['Resource'] { - /** - * Create a VpnGateway. - * @property {object} [virtualHub] The VirtualHub to which the gateway - * belongs - * @property {string} [virtualHub.id] Resource ID. - * @property {array} [connections] list of all vpn connections to the - * gateway. - * @property {object} [bgpSettings] Local network gateway's BGP speaker - * settings. - * @property {number} [bgpSettings.asn] The BGP speaker's ASN. - * @property {string} [bgpSettings.bgpPeeringAddress] The BGP peering address - * and BGP identifier of this BGP speaker. - * @property {number} [bgpSettings.peerWeight] The weight added to routes - * learned from this BGP speaker. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * @property {number} [vpnGatewayScaleUnit] The scale unit for this vpn - * gateway. - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of VpnGateway - * - * @returns {object} metadata of VpnGateway - * - */ - mapper() { - return { - required: false, - serializedName: 'VpnGateway', - type: { - name: 'Composite', - className: 'VpnGateway', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - virtualHub: { - required: false, - serializedName: 'properties.virtualHub', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - connections: { - required: false, - serializedName: 'properties.connections', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'VpnConnectionElementType', - type: { - name: 'Composite', - className: 'VpnConnection' - } - } - } - }, - bgpSettings: { - required: false, - serializedName: 'properties.bgpSettings', - type: { - name: 'Composite', - className: 'BgpSettings' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - vpnGatewayScaleUnit: { - required: false, - serializedName: 'properties.vpnGatewayScaleUnit', - type: { - name: 'Number' - } - }, - etag: { - required: false, - readOnly: true, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VpnGateway; diff --git a/lib/services/networkManagement2/lib/models/vpnProfileResponse.js b/lib/services/networkManagement2/lib/models/vpnProfileResponse.js deleted file mode 100644 index e7d40d0ce..000000000 --- a/lib/services/networkManagement2/lib/models/vpnProfileResponse.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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'; - -/** - * Vpn Profile Response for package generation - * - */ -class VpnProfileResponse { - /** - * Create a VpnProfileResponse. - * @property {string} [profileUrl] URL to the VPN profile - */ - constructor() { - } - - /** - * Defines the metadata of VpnProfileResponse - * - * @returns {object} metadata of VpnProfileResponse - * - */ - mapper() { - return { - required: false, - serializedName: 'VpnProfileResponse', - type: { - name: 'Composite', - className: 'VpnProfileResponse', - modelProperties: { - profileUrl: { - required: false, - serializedName: 'profileUrl', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VpnProfileResponse; diff --git a/lib/services/networkManagement2/lib/models/vpnSite.js b/lib/services/networkManagement2/lib/models/vpnSite.js deleted file mode 100644 index 69ab0f59a..000000000 --- a/lib/services/networkManagement2/lib/models/vpnSite.js +++ /dev/null @@ -1,187 +0,0 @@ -/* - * 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'); - -/** - * VpnSite Resource. - * - * @extends models['Resource'] - */ -class VpnSite extends models['Resource'] { - /** - * Create a VpnSite. - * @property {object} [virtualWan] The VirtualWAN to which the vpnSite - * belongs - * @property {string} [virtualWan.id] Resource ID. - * @property {object} [deviceProperties] The device properties - * @property {string} [deviceProperties.deviceVendor] Name of the device - * Vendor. - * @property {string} [deviceProperties.deviceModel] Model of the device. - * @property {number} [deviceProperties.linkSpeedInMbps] Link speed. - * @property {string} [ipAddress] The ip-address for the vpn-site. - * @property {string} [siteKey] The key for vpn-site that can be used for - * connections. - * @property {object} [addressSpace] The AddressSpace that contains an array - * of IP address ranges. - * @property {array} [addressSpace.addressPrefixes] A list of address blocks - * reserved for this virtual network in CIDR notation. - * @property {object} [bgpProperties] The set of bgp properties. - * @property {number} [bgpProperties.asn] The BGP speaker's ASN. - * @property {string} [bgpProperties.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. - * @property {number} [bgpProperties.peerWeight] The weight added to routes - * learned from this BGP speaker. - * @property {string} [provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * @property {boolean} [isSecuritySite] IsSecuritySite flag - * @property {string} [etag] Gets a unique read-only string that changes - * whenever the resource is updated. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of VpnSite - * - * @returns {object} metadata of VpnSite - * - */ - mapper() { - return { - required: false, - serializedName: 'VpnSite', - type: { - name: 'Composite', - className: 'VpnSite', - modelProperties: { - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - virtualWan: { - required: false, - serializedName: 'properties.virtualWan', - type: { - name: 'Composite', - className: 'SubResource' - } - }, - deviceProperties: { - required: false, - serializedName: 'properties.deviceProperties', - type: { - name: 'Composite', - className: 'DeviceProperties' - } - }, - ipAddress: { - required: false, - serializedName: 'properties.ipAddress', - type: { - name: 'String' - } - }, - siteKey: { - required: false, - serializedName: 'properties.siteKey', - type: { - name: 'String' - } - }, - addressSpace: { - required: false, - serializedName: 'properties.addressSpace', - type: { - name: 'Composite', - className: 'AddressSpace' - } - }, - bgpProperties: { - required: false, - serializedName: 'properties.bgpProperties', - type: { - name: 'Composite', - className: 'BgpSettings' - } - }, - provisioningState: { - required: false, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - isSecuritySite: { - required: false, - serializedName: 'properties.isSecuritySite', - type: { - name: 'Boolean' - } - }, - etag: { - required: false, - readOnly: true, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VpnSite; diff --git a/lib/services/networkManagement2/lib/models/vpnSiteId.js b/lib/services/networkManagement2/lib/models/vpnSiteId.js deleted file mode 100644 index 0367c3232..000000000 --- a/lib/services/networkManagement2/lib/models/vpnSiteId.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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'; - -/** - * VpnSite Resource. - * - */ -class VpnSiteId { - /** - * Create a VpnSiteId. - * @property {string} [vpnSite] The resource-uri of the vpn-site for which - * config is to be fetched. - */ - constructor() { - } - - /** - * Defines the metadata of VpnSiteId - * - * @returns {object} metadata of VpnSiteId - * - */ - mapper() { - return { - required: false, - serializedName: 'VpnSiteId', - type: { - name: 'Composite', - className: 'VpnSiteId', - modelProperties: { - vpnSite: { - required: false, - readOnly: true, - serializedName: 'vpnSite', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = VpnSiteId; diff --git a/lib/services/networkManagement2/lib/networkManagementClient.d.ts b/lib/services/networkManagement2/lib/networkManagementClient.d.ts deleted file mode 100644 index 9753f42d8..000000000 --- a/lib/services/networkManagement2/lib/networkManagementClient.d.ts +++ /dev/null @@ -1,252 +0,0 @@ -/* - * 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 { ServiceClient, ServiceClientOptions, ServiceCallback, HttpOperationResponse, ServiceClientCredentials } from 'ms-rest'; -import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; -import * as models from "./models"; -import * as operations from "./operations"; - -export default class NetworkManagementClient extends AzureServiceClient { - /** - * Initializes a new instance of the NetworkManagementClient class. - * @constructor - * - * @class - * @param {credentials} credentials - Credentials needed for the client to connect to Azure. - * - * @param {string} subscriptionId - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - * - * @param {string} [baseUri] - The base URI of the service. - * - * @param {object} [options] - The parameter options - * - * @param {Array} [options.filters] - Filters to be added to the request pipeline - * - * @param {object} [options.requestOptions] - Options for the underlying request object - * {@link https://github.com/request/request#requestoptions-callback Options doc} - * - * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * - * @param {string} [options.acceptLanguage] - The preferred language for the response. - * - * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. - * - * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. - * - */ - constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); - - credentials: ServiceClientCredentials; - - subscriptionId: string; - - acceptLanguage: string; - - longRunningOperationRetryTimeout: number; - - generateClientRequestId: boolean; - - // Operation groups - applicationGateways: operations.ApplicationGateways; - applicationSecurityGroups: operations.ApplicationSecurityGroups; - availableDelegations: operations.AvailableDelegations; - availableResourceGroupDelegations: operations.AvailableResourceGroupDelegations; - azureFirewalls: operations.AzureFirewalls; - azureFirewallFqdnTags: operations.AzureFirewallFqdnTags; - ddosProtectionPlans: operations.DdosProtectionPlans; - availableEndpointServices: operations.AvailableEndpointServices; - expressRouteCircuitAuthorizations: operations.ExpressRouteCircuitAuthorizations; - expressRouteCircuitPeerings: operations.ExpressRouteCircuitPeerings; - expressRouteCircuitConnections: operations.ExpressRouteCircuitConnections; - expressRouteCircuits: operations.ExpressRouteCircuits; - expressRouteServiceProviders: operations.ExpressRouteServiceProviders; - expressRouteCrossConnections: operations.ExpressRouteCrossConnections; - expressRouteCrossConnectionPeerings: operations.ExpressRouteCrossConnectionPeerings; - expressRouteGateways: operations.ExpressRouteGateways; - expressRouteConnections: operations.ExpressRouteConnections; - expressRoutePortsLocations: operations.ExpressRoutePortsLocations; - expressRoutePorts: operations.ExpressRoutePorts; - expressRouteLinks: operations.ExpressRouteLinks; - interfaceEndpoints: operations.InterfaceEndpoints; - loadBalancers: operations.LoadBalancers; - loadBalancerBackendAddressPools: operations.LoadBalancerBackendAddressPools; - loadBalancerFrontendIPConfigurations: operations.LoadBalancerFrontendIPConfigurations; - inboundNatRules: operations.InboundNatRules; - loadBalancerLoadBalancingRules: operations.LoadBalancerLoadBalancingRules; - loadBalancerOutboundRules: operations.LoadBalancerOutboundRules; - loadBalancerNetworkInterfaces: operations.LoadBalancerNetworkInterfaces; - loadBalancerProbes: operations.LoadBalancerProbes; - networkInterfaces: operations.NetworkInterfaces; - networkInterfaceIPConfigurations: operations.NetworkInterfaceIPConfigurations; - networkInterfaceLoadBalancers: operations.NetworkInterfaceLoadBalancers; - networkInterfaceTapConfigurations: operations.NetworkInterfaceTapConfigurations; - networkProfiles: operations.NetworkProfiles; - networkSecurityGroups: operations.NetworkSecurityGroups; - securityRules: operations.SecurityRules; - defaultSecurityRules: operations.DefaultSecurityRules; - networkWatchers: operations.NetworkWatchers; - packetCaptures: operations.PacketCaptures; - connectionMonitors: operations.ConnectionMonitors; - operations: operations.Operations; - publicIPAddresses: operations.PublicIPAddresses; - publicIPPrefixes: operations.PublicIPPrefixes; - routeFilters: operations.RouteFilters; - routeFilterRules: operations.RouteFilterRules; - routeTables: operations.RouteTables; - routes: operations.Routes; - bgpServiceCommunities: operations.BgpServiceCommunities; - serviceEndpointPolicies: operations.ServiceEndpointPolicies; - serviceEndpointPolicyDefinitions: operations.ServiceEndpointPolicyDefinitions; - usages: operations.Usages; - virtualNetworks: operations.VirtualNetworks; - subnets: operations.Subnets; - virtualNetworkPeerings: operations.VirtualNetworkPeerings; - virtualNetworkGateways: operations.VirtualNetworkGateways; - virtualNetworkGatewayConnections: operations.VirtualNetworkGatewayConnections; - localNetworkGateways: operations.LocalNetworkGateways; - virtualNetworkTaps: operations.VirtualNetworkTaps; - virtualWans: operations.VirtualWans; - vpnSites: operations.VpnSites; - vpnSitesConfiguration: operations.VpnSitesConfiguration; - virtualHubs: operations.VirtualHubs; - hubVirtualNetworkConnections: operations.HubVirtualNetworkConnections; - vpnGateways: operations.VpnGateways; - vpnConnections: operations.VpnConnections; - p2sVpnServerConfigurations: operations.P2sVpnServerConfigurations; - p2sVpnGateways: operations.P2sVpnGateways; - - - /** - * Checks whether a domain name in the cloudapp.azure.com zone is available for - * use. - * - * @param {string} location The location of the domain name. - * - * @param {string} domainNameLabel The domain name to be verified. It must - * conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. - * - * @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. - */ - checkDnsNameAvailabilityWithHttpOperationResponse(location: string, domainNameLabel: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Checks whether a domain name in the cloudapp.azure.com zone is available for - * use. - * - * @param {string} location The location of the domain name. - * - * @param {string} domainNameLabel The domain name to be verified. It must - * conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. - * - * @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 {DnsNameAvailabilityResult} - 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. - * - * {DnsNameAvailabilityResult} [result] - The deserialized result object if an error did not occur. - * See {@link DnsNameAvailabilityResult} 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. - */ - checkDnsNameAvailability(location: string, domainNameLabel: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - checkDnsNameAvailability(location: string, domainNameLabel: string, callback: ServiceCallback): void; - checkDnsNameAvailability(location: string, domainNameLabel: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gives the supported security providers for the virtual wan. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} virtualWANName The name of the VirtualWAN for which - * supported security providers are needed. - * - * @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. - */ - supportedSecurityProvidersWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gives the supported security providers for the virtual wan. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} virtualWANName The name of the VirtualWAN for which - * supported security providers are needed. - * - * @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 {VirtualWanSecurityProviders} - 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. - * - * {VirtualWanSecurityProviders} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualWanSecurityProviders} 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. - */ - supportedSecurityProviders(resourceGroupName: string, virtualWANName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - supportedSecurityProviders(resourceGroupName: string, virtualWANName: string, callback: ServiceCallback): void; - supportedSecurityProviders(resourceGroupName: string, virtualWANName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -export { NetworkManagementClient, models as NetworkManagementModels }; diff --git a/lib/services/networkManagement2/lib/networkManagementClient.js b/lib/services/networkManagement2/lib/networkManagementClient.js deleted file mode 100644 index baa2b3cbc..000000000 --- a/lib/services/networkManagement2/lib/networkManagementClient.js +++ /dev/null @@ -1,625 +0,0 @@ -/* - * 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. - */ - -/* jshint latedef:false */ -/* jshint forin:false */ -/* jshint noempty:false */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const ServiceClient = msRestAzure.AzureServiceClient; -const WebResource = msRest.WebResource; - -const models = require('./models'); -const operations = require('./operations'); - - -/** - * Checks whether a domain name in the cloudapp.azure.com zone is available for - * use. - * - * @param {string} location The location of the domain name. - * - * @param {string} domainNameLabel The domain name to be verified. It must - * conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. - * - * @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 DnsNameAvailabilityResult} 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 _checkDnsNameAvailability(location, domainNameLabel, options, callback) { - /* jshint validthis: true */ - let client = this; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - let apiVersion = '2018-10-01'; - // Validate - try { - if (location === null || location === undefined || typeof location.valueOf() !== 'string') { - throw new Error('location cannot be null or undefined and it must be of type string.'); - } - if (domainNameLabel === null || domainNameLabel === undefined || typeof domainNameLabel.valueOf() !== 'string') { - throw new Error('domainNameLabel cannot be null or undefined and it must be of type string.'); - } - if (this.subscriptionId === null || this.subscriptionId === undefined || typeof this.subscriptionId.valueOf() !== 'string') { - throw new Error('this.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability'; - requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); - let queryParameters = []; - queryParameters.push('domainNameLabel=' + encodeURIComponent(domainNameLabel)); - 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.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.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['DnsNameAvailabilityResult']().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); - }); -} - -/** - * Gives the supported security providers for the virtual wan. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} virtualWANName The name of the VirtualWAN for which - * supported security providers are needed. - * - * @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 VirtualWanSecurityProviders} 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 _supportedSecurityProviders(resourceGroupName, virtualWANName, options, callback) { - /* jshint validthis: true */ - let client = this; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - let apiVersion = '2018-10-01'; - // Validate - try { - if (this.subscriptionId === null || this.subscriptionId === undefined || typeof this.subscriptionId.valueOf() !== 'string') { - throw new Error('this.subscriptionId cannot be null or undefined and it must be of type string.'); - } - 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 (virtualWANName === null || virtualWANName === undefined || typeof virtualWANName.valueOf() !== 'string') { - throw new Error('virtualWANName cannot be null or undefined and it must be of type string.'); - } - if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/supportedSecurityProviders'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualWANName}', encodeURIComponent(virtualWANName)); - 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.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['VirtualWanSecurityProviders']().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 NetworkManagementClient. */ -class NetworkManagementClient extends ServiceClient { - /** - * Create a NetworkManagementClient. - * @param {credentials} credentials - Credentials needed for the client to connect to Azure. - * @param {string} subscriptionId - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - * @param {string} [baseUri] - The base URI of the service. - * @param {object} [options] - The parameter options - * @param {Array} [options.filters] - Filters to be added to the request pipeline - * @param {object} [options.requestOptions] - Options for the underlying request object - * {@link https://github.com/request/request#requestoptions-callback Options doc} - * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * @param {string} [options.acceptLanguage] - The preferred language for the response. - * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. - * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. - */ - constructor(credentials, subscriptionId, baseUri, options) { - if (credentials === null || credentials === undefined) { - throw new Error('\'credentials\' cannot be null.'); - } - if (subscriptionId === null || subscriptionId === undefined) { - throw new Error('\'subscriptionId\' cannot be null.'); - } - - if (!options) options = {}; - - super(credentials, options); - - this.acceptLanguage = 'en-US'; - this.longRunningOperationRetryTimeout = 30; - this.generateClientRequestId = true; - this.baseUri = baseUri; - if (!this.baseUri) { - this.baseUri = 'https://management.azure.com'; - } - this.credentials = credentials; - this.subscriptionId = subscriptionId; - - let packageInfo = this.getPackageJsonInfo(__dirname); - this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`); - if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { - this.acceptLanguage = options.acceptLanguage; - } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { - this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; - } - if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { - this.generateClientRequestId = options.generateClientRequestId; - } - this.applicationGateways = new operations.ApplicationGateways(this); - this.applicationSecurityGroups = new operations.ApplicationSecurityGroups(this); - this.availableDelegations = new operations.AvailableDelegations(this); - this.availableResourceGroupDelegations = new operations.AvailableResourceGroupDelegations(this); - this.azureFirewalls = new operations.AzureFirewalls(this); - this.azureFirewallFqdnTags = new operations.AzureFirewallFqdnTags(this); - this.ddosProtectionPlans = new operations.DdosProtectionPlans(this); - this.availableEndpointServices = new operations.AvailableEndpointServices(this); - this.expressRouteCircuitAuthorizations = new operations.ExpressRouteCircuitAuthorizations(this); - this.expressRouteCircuitPeerings = new operations.ExpressRouteCircuitPeerings(this); - this.expressRouteCircuitConnections = new operations.ExpressRouteCircuitConnections(this); - this.expressRouteCircuits = new operations.ExpressRouteCircuits(this); - this.expressRouteServiceProviders = new operations.ExpressRouteServiceProviders(this); - this.expressRouteCrossConnections = new operations.ExpressRouteCrossConnections(this); - this.expressRouteCrossConnectionPeerings = new operations.ExpressRouteCrossConnectionPeerings(this); - this.expressRouteGateways = new operations.ExpressRouteGateways(this); - this.expressRouteConnections = new operations.ExpressRouteConnections(this); - this.expressRoutePortsLocations = new operations.ExpressRoutePortsLocations(this); - this.expressRoutePorts = new operations.ExpressRoutePorts(this); - this.expressRouteLinks = new operations.ExpressRouteLinks(this); - this.interfaceEndpoints = new operations.InterfaceEndpoints(this); - this.loadBalancers = new operations.LoadBalancers(this); - this.loadBalancerBackendAddressPools = new operations.LoadBalancerBackendAddressPools(this); - this.loadBalancerFrontendIPConfigurations = new operations.LoadBalancerFrontendIPConfigurations(this); - this.inboundNatRules = new operations.InboundNatRules(this); - this.loadBalancerLoadBalancingRules = new operations.LoadBalancerLoadBalancingRules(this); - this.loadBalancerOutboundRules = new operations.LoadBalancerOutboundRules(this); - this.loadBalancerNetworkInterfaces = new operations.LoadBalancerNetworkInterfaces(this); - this.loadBalancerProbes = new operations.LoadBalancerProbes(this); - this.networkInterfaces = new operations.NetworkInterfaces(this); - this.networkInterfaceIPConfigurations = new operations.NetworkInterfaceIPConfigurations(this); - this.networkInterfaceLoadBalancers = new operations.NetworkInterfaceLoadBalancers(this); - this.networkInterfaceTapConfigurations = new operations.NetworkInterfaceTapConfigurations(this); - this.networkProfiles = new operations.NetworkProfiles(this); - this.networkSecurityGroups = new operations.NetworkSecurityGroups(this); - this.securityRules = new operations.SecurityRules(this); - this.defaultSecurityRules = new operations.DefaultSecurityRules(this); - this.networkWatchers = new operations.NetworkWatchers(this); - this.packetCaptures = new operations.PacketCaptures(this); - this.connectionMonitors = new operations.ConnectionMonitors(this); - this.operations = new operations.Operations(this); - this.publicIPAddresses = new operations.PublicIPAddresses(this); - this.publicIPPrefixes = new operations.PublicIPPrefixes(this); - this.routeFilters = new operations.RouteFilters(this); - this.routeFilterRules = new operations.RouteFilterRules(this); - this.routeTables = new operations.RouteTables(this); - this.routes = new operations.Routes(this); - this.bgpServiceCommunities = new operations.BgpServiceCommunities(this); - this.serviceEndpointPolicies = new operations.ServiceEndpointPolicies(this); - this.serviceEndpointPolicyDefinitions = new operations.ServiceEndpointPolicyDefinitions(this); - this.usages = new operations.Usages(this); - this.virtualNetworks = new operations.VirtualNetworks(this); - this.subnets = new operations.Subnets(this); - this.virtualNetworkPeerings = new operations.VirtualNetworkPeerings(this); - this.virtualNetworkGateways = new operations.VirtualNetworkGateways(this); - this.virtualNetworkGatewayConnections = new operations.VirtualNetworkGatewayConnections(this); - this.localNetworkGateways = new operations.LocalNetworkGateways(this); - this.virtualNetworkTaps = new operations.VirtualNetworkTaps(this); - this.virtualWans = new operations.VirtualWans(this); - this.vpnSites = new operations.VpnSites(this); - this.vpnSitesConfiguration = new operations.VpnSitesConfiguration(this); - this.virtualHubs = new operations.VirtualHubs(this); - this.hubVirtualNetworkConnections = new operations.HubVirtualNetworkConnections(this); - this.vpnGateways = new operations.VpnGateways(this); - this.vpnConnections = new operations.VpnConnections(this); - this.p2sVpnServerConfigurations = new operations.P2sVpnServerConfigurations(this); - this.p2sVpnGateways = new operations.P2sVpnGateways(this); - this.models = models; - this._checkDnsNameAvailability = _checkDnsNameAvailability; - this._supportedSecurityProviders = _supportedSecurityProviders; - msRest.addSerializationMixin(this); - } - - /** - * Checks whether a domain name in the cloudapp.azure.com zone is available for - * use. - * - * @param {string} location The location of the domain name. - * - * @param {string} domainNameLabel The domain name to be verified. It must - * conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. - * - * @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. - */ - checkDnsNameAvailabilityWithHttpOperationResponse(location, domainNameLabel, options) { - let client = this; - let self = this; - return new Promise((resolve, reject) => { - self._checkDnsNameAvailability(location, domainNameLabel, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Checks whether a domain name in the cloudapp.azure.com zone is available for - * use. - * - * @param {string} location The location of the domain name. - * - * @param {string} domainNameLabel The domain name to be verified. It must - * conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. - * - * @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 {DnsNameAvailabilityResult} - 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 DnsNameAvailabilityResult} 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. - */ - checkDnsNameAvailability(location, domainNameLabel, options, optionalCallback) { - let client = this; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._checkDnsNameAvailability(location, domainNameLabel, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._checkDnsNameAvailability(location, domainNameLabel, options, optionalCallback); - } - } - - /** - * Gives the supported security providers for the virtual wan. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} virtualWANName The name of the VirtualWAN for which - * supported security providers are needed. - * - * @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. - */ - supportedSecurityProvidersWithHttpOperationResponse(resourceGroupName, virtualWANName, options) { - let client = this; - let self = this; - return new Promise((resolve, reject) => { - self._supportedSecurityProviders(resourceGroupName, virtualWANName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gives the supported security providers for the virtual wan. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} virtualWANName The name of the VirtualWAN for which - * supported security providers are needed. - * - * @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 {VirtualWanSecurityProviders} - 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 VirtualWanSecurityProviders} 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. - */ - supportedSecurityProviders(resourceGroupName, virtualWANName, options, optionalCallback) { - let client = this; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._supportedSecurityProviders(resourceGroupName, virtualWANName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._supportedSecurityProviders(resourceGroupName, virtualWANName, options, optionalCallback); - } - } - -} - -module.exports = NetworkManagementClient; -module.exports['default'] = NetworkManagementClient; -module.exports.NetworkManagementClient = NetworkManagementClient; -module.exports.NetworkManagementModels = models; diff --git a/lib/services/networkManagement2/lib/operations/applicationGateways.js b/lib/services/networkManagement2/lib/operations/applicationGateways.js deleted file mode 100644 index fbfc67b90..000000000 --- a/lib/services/networkManagement2/lib/operations/applicationGateways.js +++ /dev/null @@ -1,5576 +0,0 @@ -/* - * 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; - - -/** - * Deletes the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, applicationGatewayName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, applicationGatewayName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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 ApplicationGateway} 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, applicationGatewayName, 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-10-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 (applicationGatewayName === null || applicationGatewayName === undefined || typeof applicationGatewayName.valueOf() !== 'string') { - throw new Error('applicationGatewayName 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/applicationGateways/{applicationGatewayName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{applicationGatewayName}', encodeURIComponent(applicationGatewayName)); - 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['ApplicationGateway']().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); - }); -} - - -/** - * Creates or updates the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} parameters Parameters supplied to the create or update - * application gateway operation. - * - * @param {object} [parameters.sku] SKU of the application gateway resource. - * - * @param {string} [parameters.sku.name] Name of an application gateway SKU. - * Possible values include: 'Standard_Small', 'Standard_Medium', - * 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' - * - * @param {string} [parameters.sku.tier] Tier of an application gateway. - * Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' - * - * @param {number} [parameters.sku.capacity] Capacity (instance count) of an - * application gateway. - * - * @param {object} [parameters.sslPolicy] SSL policy of the application gateway - * resource. - * - * @param {array} [parameters.sslPolicy.disabledSslProtocols] Ssl protocols to - * be disabled on application gateway. - * - * @param {string} [parameters.sslPolicy.policyType] Type of Ssl Policy. - * Possible values include: 'Predefined', 'Custom' - * - * @param {string} [parameters.sslPolicy.policyName] Name of Ssl predefined - * policy. Possible values include: 'AppGwSslPolicy20150501', - * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' - * - * @param {array} [parameters.sslPolicy.cipherSuites] Ssl cipher suites to be - * enabled in the specified order to application gateway. - * - * @param {string} [parameters.sslPolicy.minProtocolVersion] Minimum version of - * Ssl protocol to be supported on application gateway. Possible values - * include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' - * - * @param {array} [parameters.gatewayIPConfigurations] Subnets of application - * the gateway resource. - * - * @param {array} [parameters.authenticationCertificates] Authentication - * certificates of the application gateway resource. - * - * @param {array} [parameters.trustedRootCertificates] Trusted Root - * certificates of the application gateway resource. - * - * @param {array} [parameters.sslCertificates] SSL certificates of the - * application gateway resource. - * - * @param {array} [parameters.frontendIPConfigurations] Frontend IP addresses - * of the application gateway resource. - * - * @param {array} [parameters.frontendPorts] Frontend ports of the application - * gateway resource. - * - * @param {array} [parameters.probes] Probes of the application gateway - * resource. - * - * @param {array} [parameters.backendAddressPools] Backend address pool of the - * application gateway resource. - * - * @param {array} [parameters.backendHttpSettingsCollection] Backend http - * settings of the application gateway resource. - * - * @param {array} [parameters.httpListeners] Http listeners of the application - * gateway resource. - * - * @param {array} [parameters.urlPathMaps] URL path map of the application - * gateway resource. - * - * @param {array} [parameters.requestRoutingRules] Request routing rules of the - * application gateway resource. - * - * @param {array} [parameters.rewriteRuleSets] Rewrite rules for the - * application gateway resource. - * - * @param {array} [parameters.redirectConfigurations] Redirect configurations - * of the application gateway resource. - * - * @param {object} [parameters.webApplicationFirewallConfiguration] Web - * application firewall configuration. - * - * @param {boolean} parameters.webApplicationFirewallConfiguration.enabled - * Whether the web application firewall is enabled or not. - * - * @param {string} parameters.webApplicationFirewallConfiguration.firewallMode - * Web application firewall mode. Possible values include: 'Detection', - * 'Prevention' - * - * @param {string} parameters.webApplicationFirewallConfiguration.ruleSetType - * The type of the web application firewall rule set. Possible values are: - * 'OWASP'. - * - * @param {string} - * parameters.webApplicationFirewallConfiguration.ruleSetVersion The version of - * the rule set type. - * - * @param {array} - * [parameters.webApplicationFirewallConfiguration.disabledRuleGroups] The - * disabled rule groups. - * - * @param {boolean} - * [parameters.webApplicationFirewallConfiguration.requestBodyCheck] Whether - * allow WAF to check request Body. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.maxRequestBodySize] Maxium - * request body size for WAF. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.maxRequestBodySizeInKb] - * Maxium request body size in Kb for WAF. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.fileUploadLimitInMb] Maxium - * file upload size in Mb for WAF. - * - * @param {array} [parameters.webApplicationFirewallConfiguration.exclusions] - * The exclusion list. - * - * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the - * application gateway resource. - * - * @param {boolean} [parameters.enableFips] Whether FIPS is enabled on the - * application gateway resource. - * - * @param {object} [parameters.autoscaleConfiguration] Autoscale Configuration. - * - * @param {number} parameters.autoscaleConfiguration.minCapacity Lower bound on - * number of Application Gateway instances - * - * @param {string} [parameters.resourceGuid] Resource GUID property of the - * application gateway resource. - * - * @param {string} [parameters.provisioningState] Provisioning state of the - * application gateway resource. Possible values are: 'Updating', 'Deleting', - * and 'Failed'. - * - * @param {array} [parameters.customErrorConfigurations] Custom error - * configurations of the application gateway resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting - * where the resource needs to come from. - * - * @param {object} [parameters.identity] The identity of the application - * gateway, if configured. - * - * @param {string} [parameters.identity.type] The type of identity used for the - * resource. The type 'SystemAssigned, UserAssigned' includes both an - * implicitly created identity and a set of user assigned identities. The type - * 'None' will remove any identities from the virtual machine. Possible values - * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', - * 'None' - * - * @param {object} [parameters.identity.userAssignedIdentities] The list of - * user identities associated with resource. The user identity dictionary key - * references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 ApplicationGateway} 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 _createOrUpdate(resourceGroupName, applicationGatewayName, parameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, applicationGatewayName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ApplicationGateway']().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); - }); - }); -} - - -/** - * Updates the specified application gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} parameters Parameters supplied to update application gateway - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 ApplicationGateway} 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 _updateTags(resourceGroupName, applicationGatewayName, parameters, 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.'); - } - - // Send request - this.beginUpdateTags(resourceGroupName, applicationGatewayName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ApplicationGateway']().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); - }); - }); -} - -/** - * Lists all application gateways in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 ApplicationGatewayListResult} 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, 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-10-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 (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/applicationGateways'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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['ApplicationGatewayListResult']().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 the application gateways in a subscription. - * - * @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 ApplicationGatewayListResult} 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 _listAll(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/applicationGateways'; - 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['ApplicationGatewayListResult']().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); - }); -} - - -/** - * Starts the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _start(resourceGroupName, applicationGatewayName, 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.'); - } - - // Send request - this.beginStart(resourceGroupName, applicationGatewayName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * Stops the specified application gateway in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _stop(resourceGroupName, applicationGatewayName, 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.'); - } - - // Send request - this.beginStop(resourceGroupName, applicationGatewayName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * Gets the backend health of the specified application gateway in a resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands BackendAddressPool and - * BackendHttpSettings referenced in backend health. - * - * @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 ApplicationGatewayBackendHealth} 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 _backendHealth(resourceGroupName, applicationGatewayName, 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.'); - } - - // Send request - this.beginBackendHealth(resourceGroupName, applicationGatewayName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ApplicationGatewayBackendHealth']().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); - }); - }); -} - -/** - * Lists all available web application firewall rule sets. - * - * @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 - * ApplicationGatewayAvailableWafRuleSetsResult} 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 _listAvailableWafRuleSets(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets'; - 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['ApplicationGatewayAvailableWafRuleSetsResult']().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); - }); -} - -/** - * Lists available Ssl options for configuring Ssl policy. - * - * @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 ApplicationGatewayAvailableSslOptions} 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 _listAvailableSslOptions(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default'; - 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['ApplicationGatewayAvailableSslOptions']().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); - }); -} - -/** - * Lists all SSL predefined policies for configuring Ssl policy. - * - * @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 - * ApplicationGatewayAvailableSslPredefinedPolicies} 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 _listAvailableSslPredefinedPolicies(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies'; - 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['ApplicationGatewayAvailableSslPredefinedPolicies']().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 Ssl predefined policy with the specified policy name. - * - * @param {string} predefinedPolicyName Name of Ssl predefined policy. - * - * @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 ApplicationGatewaySslPredefinedPolicy} 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 _getSslPredefinedPolicy(predefinedPolicyName, 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-10-01'; - // Validate - try { - 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 (predefinedPolicyName === null || predefinedPolicyName === undefined || typeof predefinedPolicyName.valueOf() !== 'string') { - throw new Error('predefinedPolicyName 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}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{predefinedPolicyName}', encodeURIComponent(predefinedPolicyName)); - 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['ApplicationGatewaySslPredefinedPolicy']().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); - }); -} - -/** - * Deletes the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, applicationGatewayName, 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-10-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 (applicationGatewayName === null || applicationGatewayName === undefined || typeof applicationGatewayName.valueOf() !== 'string') { - throw new Error('applicationGatewayName 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/applicationGateways/{applicationGatewayName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{applicationGatewayName}', encodeURIComponent(applicationGatewayName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} parameters Parameters supplied to the create or update - * application gateway operation. - * - * @param {object} [parameters.sku] SKU of the application gateway resource. - * - * @param {string} [parameters.sku.name] Name of an application gateway SKU. - * Possible values include: 'Standard_Small', 'Standard_Medium', - * 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' - * - * @param {string} [parameters.sku.tier] Tier of an application gateway. - * Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' - * - * @param {number} [parameters.sku.capacity] Capacity (instance count) of an - * application gateway. - * - * @param {object} [parameters.sslPolicy] SSL policy of the application gateway - * resource. - * - * @param {array} [parameters.sslPolicy.disabledSslProtocols] Ssl protocols to - * be disabled on application gateway. - * - * @param {string} [parameters.sslPolicy.policyType] Type of Ssl Policy. - * Possible values include: 'Predefined', 'Custom' - * - * @param {string} [parameters.sslPolicy.policyName] Name of Ssl predefined - * policy. Possible values include: 'AppGwSslPolicy20150501', - * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' - * - * @param {array} [parameters.sslPolicy.cipherSuites] Ssl cipher suites to be - * enabled in the specified order to application gateway. - * - * @param {string} [parameters.sslPolicy.minProtocolVersion] Minimum version of - * Ssl protocol to be supported on application gateway. Possible values - * include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' - * - * @param {array} [parameters.gatewayIPConfigurations] Subnets of application - * the gateway resource. - * - * @param {array} [parameters.authenticationCertificates] Authentication - * certificates of the application gateway resource. - * - * @param {array} [parameters.trustedRootCertificates] Trusted Root - * certificates of the application gateway resource. - * - * @param {array} [parameters.sslCertificates] SSL certificates of the - * application gateway resource. - * - * @param {array} [parameters.frontendIPConfigurations] Frontend IP addresses - * of the application gateway resource. - * - * @param {array} [parameters.frontendPorts] Frontend ports of the application - * gateway resource. - * - * @param {array} [parameters.probes] Probes of the application gateway - * resource. - * - * @param {array} [parameters.backendAddressPools] Backend address pool of the - * application gateway resource. - * - * @param {array} [parameters.backendHttpSettingsCollection] Backend http - * settings of the application gateway resource. - * - * @param {array} [parameters.httpListeners] Http listeners of the application - * gateway resource. - * - * @param {array} [parameters.urlPathMaps] URL path map of the application - * gateway resource. - * - * @param {array} [parameters.requestRoutingRules] Request routing rules of the - * application gateway resource. - * - * @param {array} [parameters.rewriteRuleSets] Rewrite rules for the - * application gateway resource. - * - * @param {array} [parameters.redirectConfigurations] Redirect configurations - * of the application gateway resource. - * - * @param {object} [parameters.webApplicationFirewallConfiguration] Web - * application firewall configuration. - * - * @param {boolean} parameters.webApplicationFirewallConfiguration.enabled - * Whether the web application firewall is enabled or not. - * - * @param {string} parameters.webApplicationFirewallConfiguration.firewallMode - * Web application firewall mode. Possible values include: 'Detection', - * 'Prevention' - * - * @param {string} parameters.webApplicationFirewallConfiguration.ruleSetType - * The type of the web application firewall rule set. Possible values are: - * 'OWASP'. - * - * @param {string} - * parameters.webApplicationFirewallConfiguration.ruleSetVersion The version of - * the rule set type. - * - * @param {array} - * [parameters.webApplicationFirewallConfiguration.disabledRuleGroups] The - * disabled rule groups. - * - * @param {boolean} - * [parameters.webApplicationFirewallConfiguration.requestBodyCheck] Whether - * allow WAF to check request Body. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.maxRequestBodySize] Maxium - * request body size for WAF. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.maxRequestBodySizeInKb] - * Maxium request body size in Kb for WAF. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.fileUploadLimitInMb] Maxium - * file upload size in Mb for WAF. - * - * @param {array} [parameters.webApplicationFirewallConfiguration.exclusions] - * The exclusion list. - * - * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the - * application gateway resource. - * - * @param {boolean} [parameters.enableFips] Whether FIPS is enabled on the - * application gateway resource. - * - * @param {object} [parameters.autoscaleConfiguration] Autoscale Configuration. - * - * @param {number} parameters.autoscaleConfiguration.minCapacity Lower bound on - * number of Application Gateway instances - * - * @param {string} [parameters.resourceGuid] Resource GUID property of the - * application gateway resource. - * - * @param {string} [parameters.provisioningState] Provisioning state of the - * application gateway resource. Possible values are: 'Updating', 'Deleting', - * and 'Failed'. - * - * @param {array} [parameters.customErrorConfigurations] Custom error - * configurations of the application gateway resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting - * where the resource needs to come from. - * - * @param {object} [parameters.identity] The identity of the application - * gateway, if configured. - * - * @param {string} [parameters.identity.type] The type of identity used for the - * resource. The type 'SystemAssigned, UserAssigned' includes both an - * implicitly created identity and a set of user assigned identities. The type - * 'None' will remove any identities from the virtual machine. Possible values - * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', - * 'None' - * - * @param {object} [parameters.identity.userAssignedIdentities] The list of - * user identities associated with resource. The user identity dictionary key - * references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 ApplicationGateway} 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 _beginCreateOrUpdate(resourceGroupName, applicationGatewayName, parameters, 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-10-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 (applicationGatewayName === null || applicationGatewayName === undefined || typeof applicationGatewayName.valueOf() !== 'string') { - throw new Error('applicationGatewayName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/applicationGateways/{applicationGatewayName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{applicationGatewayName}', encodeURIComponent(applicationGatewayName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['ApplicationGateway']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['ApplicationGateway']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ApplicationGateway']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Updates the specified application gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} parameters Parameters supplied to update application gateway - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 ApplicationGateway} 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 _beginUpdateTags(resourceGroupName, applicationGatewayName, parameters, 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-10-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 (applicationGatewayName === null || applicationGatewayName === undefined || typeof applicationGatewayName.valueOf() !== 'string') { - throw new Error('applicationGatewayName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/applicationGateways/{applicationGatewayName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{applicationGatewayName}', encodeURIComponent(applicationGatewayName)); - 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 = 'PATCH'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['TagsObject']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // 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['ApplicationGateway']().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); - }); -} - -/** - * Starts the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginStart(resourceGroupName, applicationGatewayName, 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-10-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 (applicationGatewayName === null || applicationGatewayName === undefined || typeof applicationGatewayName.valueOf() !== 'string') { - throw new Error('applicationGatewayName 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/applicationGateways/{applicationGatewayName}/start'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{applicationGatewayName}', encodeURIComponent(applicationGatewayName)); - 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 = 'POST'; - 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 && statusCode !== 202) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Stops the specified application gateway in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginStop(resourceGroupName, applicationGatewayName, 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-10-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 (applicationGatewayName === null || applicationGatewayName === undefined || typeof applicationGatewayName.valueOf() !== 'string') { - throw new Error('applicationGatewayName 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/applicationGateways/{applicationGatewayName}/stop'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{applicationGatewayName}', encodeURIComponent(applicationGatewayName)); - 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 = 'POST'; - 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 && statusCode !== 202) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Gets the backend health of the specified application gateway in a resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands BackendAddressPool and - * BackendHttpSettings referenced in backend health. - * - * @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 ApplicationGatewayBackendHealth} 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 _beginBackendHealth(resourceGroupName, applicationGatewayName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2018-10-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 (applicationGatewayName === null || applicationGatewayName === undefined || typeof applicationGatewayName.valueOf() !== 'string') { - throw new Error('applicationGatewayName 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 (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand 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/applicationGateways/{applicationGatewayName}/backendhealth'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{applicationGatewayName}', encodeURIComponent(applicationGatewayName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'POST'; - 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 && statusCode !== 202) { - 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['ApplicationGatewayBackendHealth']().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); - }); -} - -/** - * Lists all application gateways in a resource group. - * - * @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 ApplicationGatewayListResult} 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['ApplicationGatewayListResult']().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 the application gateways in a subscription. - * - * @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 ApplicationGatewayListResult} 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 _listAllNext(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['ApplicationGatewayListResult']().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); - }); -} - -/** - * Lists all SSL predefined policies for configuring Ssl policy. - * - * @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 - * ApplicationGatewayAvailableSslPredefinedPolicies} 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 _listAvailableSslPredefinedPoliciesNext(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['ApplicationGatewayAvailableSslPredefinedPolicies']().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 ApplicationGateways. */ -class ApplicationGateways { - /** - * Create a ApplicationGateways. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._updateTags = _updateTags; - this._list = _list; - this._listAll = _listAll; - this._start = _start; - this._stop = _stop; - this._backendHealth = _backendHealth; - this._listAvailableWafRuleSets = _listAvailableWafRuleSets; - this._listAvailableSslOptions = _listAvailableSslOptions; - this._listAvailableSslPredefinedPolicies = _listAvailableSslPredefinedPolicies; - this._getSslPredefinedPolicy = _getSslPredefinedPolicy; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdateTags = _beginUpdateTags; - this._beginStart = _beginStart; - this._beginStop = _beginStop; - this._beginBackendHealth = _beginBackendHealth; - this._listNext = _listNext; - this._listAllNext = _listAllNext; - this._listAvailableSslPredefinedPoliciesNext = _listAvailableSslPredefinedPoliciesNext; - } - - /** - * Deletes the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, applicationGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, applicationGatewayName, 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._deleteMethod(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, applicationGatewayName, options, optionalCallback); - } - } - - /** - * Gets the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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, applicationGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, applicationGatewayName, 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 application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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 {ApplicationGateway} - 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 ApplicationGateway} 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, applicationGatewayName, 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, applicationGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, applicationGatewayName, options, optionalCallback); - } - } - - /** - * Creates or updates the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} parameters Parameters supplied to the create or update - * application gateway operation. - * - * @param {object} [parameters.sku] SKU of the application gateway resource. - * - * @param {string} [parameters.sku.name] Name of an application gateway SKU. - * Possible values include: 'Standard_Small', 'Standard_Medium', - * 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' - * - * @param {string} [parameters.sku.tier] Tier of an application gateway. - * Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' - * - * @param {number} [parameters.sku.capacity] Capacity (instance count) of an - * application gateway. - * - * @param {object} [parameters.sslPolicy] SSL policy of the application gateway - * resource. - * - * @param {array} [parameters.sslPolicy.disabledSslProtocols] Ssl protocols to - * be disabled on application gateway. - * - * @param {string} [parameters.sslPolicy.policyType] Type of Ssl Policy. - * Possible values include: 'Predefined', 'Custom' - * - * @param {string} [parameters.sslPolicy.policyName] Name of Ssl predefined - * policy. Possible values include: 'AppGwSslPolicy20150501', - * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' - * - * @param {array} [parameters.sslPolicy.cipherSuites] Ssl cipher suites to be - * enabled in the specified order to application gateway. - * - * @param {string} [parameters.sslPolicy.minProtocolVersion] Minimum version of - * Ssl protocol to be supported on application gateway. Possible values - * include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' - * - * @param {array} [parameters.gatewayIPConfigurations] Subnets of application - * the gateway resource. - * - * @param {array} [parameters.authenticationCertificates] Authentication - * certificates of the application gateway resource. - * - * @param {array} [parameters.trustedRootCertificates] Trusted Root - * certificates of the application gateway resource. - * - * @param {array} [parameters.sslCertificates] SSL certificates of the - * application gateway resource. - * - * @param {array} [parameters.frontendIPConfigurations] Frontend IP addresses - * of the application gateway resource. - * - * @param {array} [parameters.frontendPorts] Frontend ports of the application - * gateway resource. - * - * @param {array} [parameters.probes] Probes of the application gateway - * resource. - * - * @param {array} [parameters.backendAddressPools] Backend address pool of the - * application gateway resource. - * - * @param {array} [parameters.backendHttpSettingsCollection] Backend http - * settings of the application gateway resource. - * - * @param {array} [parameters.httpListeners] Http listeners of the application - * gateway resource. - * - * @param {array} [parameters.urlPathMaps] URL path map of the application - * gateway resource. - * - * @param {array} [parameters.requestRoutingRules] Request routing rules of the - * application gateway resource. - * - * @param {array} [parameters.rewriteRuleSets] Rewrite rules for the - * application gateway resource. - * - * @param {array} [parameters.redirectConfigurations] Redirect configurations - * of the application gateway resource. - * - * @param {object} [parameters.webApplicationFirewallConfiguration] Web - * application firewall configuration. - * - * @param {boolean} parameters.webApplicationFirewallConfiguration.enabled - * Whether the web application firewall is enabled or not. - * - * @param {string} parameters.webApplicationFirewallConfiguration.firewallMode - * Web application firewall mode. Possible values include: 'Detection', - * 'Prevention' - * - * @param {string} parameters.webApplicationFirewallConfiguration.ruleSetType - * The type of the web application firewall rule set. Possible values are: - * 'OWASP'. - * - * @param {string} - * parameters.webApplicationFirewallConfiguration.ruleSetVersion The version of - * the rule set type. - * - * @param {array} - * [parameters.webApplicationFirewallConfiguration.disabledRuleGroups] The - * disabled rule groups. - * - * @param {boolean} - * [parameters.webApplicationFirewallConfiguration.requestBodyCheck] Whether - * allow WAF to check request Body. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.maxRequestBodySize] Maxium - * request body size for WAF. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.maxRequestBodySizeInKb] - * Maxium request body size in Kb for WAF. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.fileUploadLimitInMb] Maxium - * file upload size in Mb for WAF. - * - * @param {array} [parameters.webApplicationFirewallConfiguration.exclusions] - * The exclusion list. - * - * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the - * application gateway resource. - * - * @param {boolean} [parameters.enableFips] Whether FIPS is enabled on the - * application gateway resource. - * - * @param {object} [parameters.autoscaleConfiguration] Autoscale Configuration. - * - * @param {number} parameters.autoscaleConfiguration.minCapacity Lower bound on - * number of Application Gateway instances - * - * @param {string} [parameters.resourceGuid] Resource GUID property of the - * application gateway resource. - * - * @param {string} [parameters.provisioningState] Provisioning state of the - * application gateway resource. Possible values are: 'Updating', 'Deleting', - * and 'Failed'. - * - * @param {array} [parameters.customErrorConfigurations] Custom error - * configurations of the application gateway resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting - * where the resource needs to come from. - * - * @param {object} [parameters.identity] The identity of the application - * gateway, if configured. - * - * @param {string} [parameters.identity.type] The type of identity used for the - * resource. The type 'SystemAssigned, UserAssigned' includes both an - * implicitly created identity and a set of user assigned identities. The type - * 'None' will remove any identities from the virtual machine. Possible values - * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', - * 'None' - * - * @param {object} [parameters.identity.userAssignedIdentities] The list of - * user identities associated with resource. The user identity dictionary key - * references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, applicationGatewayName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, applicationGatewayName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} parameters Parameters supplied to the create or update - * application gateway operation. - * - * @param {object} [parameters.sku] SKU of the application gateway resource. - * - * @param {string} [parameters.sku.name] Name of an application gateway SKU. - * Possible values include: 'Standard_Small', 'Standard_Medium', - * 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' - * - * @param {string} [parameters.sku.tier] Tier of an application gateway. - * Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' - * - * @param {number} [parameters.sku.capacity] Capacity (instance count) of an - * application gateway. - * - * @param {object} [parameters.sslPolicy] SSL policy of the application gateway - * resource. - * - * @param {array} [parameters.sslPolicy.disabledSslProtocols] Ssl protocols to - * be disabled on application gateway. - * - * @param {string} [parameters.sslPolicy.policyType] Type of Ssl Policy. - * Possible values include: 'Predefined', 'Custom' - * - * @param {string} [parameters.sslPolicy.policyName] Name of Ssl predefined - * policy. Possible values include: 'AppGwSslPolicy20150501', - * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' - * - * @param {array} [parameters.sslPolicy.cipherSuites] Ssl cipher suites to be - * enabled in the specified order to application gateway. - * - * @param {string} [parameters.sslPolicy.minProtocolVersion] Minimum version of - * Ssl protocol to be supported on application gateway. Possible values - * include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' - * - * @param {array} [parameters.gatewayIPConfigurations] Subnets of application - * the gateway resource. - * - * @param {array} [parameters.authenticationCertificates] Authentication - * certificates of the application gateway resource. - * - * @param {array} [parameters.trustedRootCertificates] Trusted Root - * certificates of the application gateway resource. - * - * @param {array} [parameters.sslCertificates] SSL certificates of the - * application gateway resource. - * - * @param {array} [parameters.frontendIPConfigurations] Frontend IP addresses - * of the application gateway resource. - * - * @param {array} [parameters.frontendPorts] Frontend ports of the application - * gateway resource. - * - * @param {array} [parameters.probes] Probes of the application gateway - * resource. - * - * @param {array} [parameters.backendAddressPools] Backend address pool of the - * application gateway resource. - * - * @param {array} [parameters.backendHttpSettingsCollection] Backend http - * settings of the application gateway resource. - * - * @param {array} [parameters.httpListeners] Http listeners of the application - * gateway resource. - * - * @param {array} [parameters.urlPathMaps] URL path map of the application - * gateway resource. - * - * @param {array} [parameters.requestRoutingRules] Request routing rules of the - * application gateway resource. - * - * @param {array} [parameters.rewriteRuleSets] Rewrite rules for the - * application gateway resource. - * - * @param {array} [parameters.redirectConfigurations] Redirect configurations - * of the application gateway resource. - * - * @param {object} [parameters.webApplicationFirewallConfiguration] Web - * application firewall configuration. - * - * @param {boolean} parameters.webApplicationFirewallConfiguration.enabled - * Whether the web application firewall is enabled or not. - * - * @param {string} parameters.webApplicationFirewallConfiguration.firewallMode - * Web application firewall mode. Possible values include: 'Detection', - * 'Prevention' - * - * @param {string} parameters.webApplicationFirewallConfiguration.ruleSetType - * The type of the web application firewall rule set. Possible values are: - * 'OWASP'. - * - * @param {string} - * parameters.webApplicationFirewallConfiguration.ruleSetVersion The version of - * the rule set type. - * - * @param {array} - * [parameters.webApplicationFirewallConfiguration.disabledRuleGroups] The - * disabled rule groups. - * - * @param {boolean} - * [parameters.webApplicationFirewallConfiguration.requestBodyCheck] Whether - * allow WAF to check request Body. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.maxRequestBodySize] Maxium - * request body size for WAF. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.maxRequestBodySizeInKb] - * Maxium request body size in Kb for WAF. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.fileUploadLimitInMb] Maxium - * file upload size in Mb for WAF. - * - * @param {array} [parameters.webApplicationFirewallConfiguration.exclusions] - * The exclusion list. - * - * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the - * application gateway resource. - * - * @param {boolean} [parameters.enableFips] Whether FIPS is enabled on the - * application gateway resource. - * - * @param {object} [parameters.autoscaleConfiguration] Autoscale Configuration. - * - * @param {number} parameters.autoscaleConfiguration.minCapacity Lower bound on - * number of Application Gateway instances - * - * @param {string} [parameters.resourceGuid] Resource GUID property of the - * application gateway resource. - * - * @param {string} [parameters.provisioningState] Provisioning state of the - * application gateway resource. Possible values are: 'Updating', 'Deleting', - * and 'Failed'. - * - * @param {array} [parameters.customErrorConfigurations] Custom error - * configurations of the application gateway resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting - * where the resource needs to come from. - * - * @param {object} [parameters.identity] The identity of the application - * gateway, if configured. - * - * @param {string} [parameters.identity.type] The type of identity used for the - * resource. The type 'SystemAssigned, UserAssigned' includes both an - * implicitly created identity and a set of user assigned identities. The type - * 'None' will remove any identities from the virtual machine. Possible values - * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', - * 'None' - * - * @param {object} [parameters.identity.userAssignedIdentities] The list of - * user identities associated with resource. The user identity dictionary key - * references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ApplicationGateway} - 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 ApplicationGateway} 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. - */ - createOrUpdate(resourceGroupName, applicationGatewayName, parameters, 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._createOrUpdate(resourceGroupName, applicationGatewayName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, applicationGatewayName, parameters, options, optionalCallback); - } - } - - /** - * Updates the specified application gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} parameters Parameters supplied to update application gateway - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName, applicationGatewayName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateTags(resourceGroupName, applicationGatewayName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates the specified application gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} parameters Parameters supplied to update application gateway - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ApplicationGateway} - 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 ApplicationGateway} 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. - */ - updateTags(resourceGroupName, applicationGatewayName, parameters, 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._updateTags(resourceGroupName, applicationGatewayName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateTags(resourceGroupName, applicationGatewayName, parameters, options, optionalCallback); - } - } - - /** - * Lists all application gateways in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all application gateways in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {ApplicationGatewayListResult} - 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 ApplicationGatewayListResult} 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, 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, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, options, optionalCallback); - } - } - - /** - * Gets all the application gateways in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAll(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 the application gateways in a subscription. - * - * @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 {ApplicationGatewayListResult} - 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 ApplicationGatewayListResult} 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. - */ - listAll(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._listAll(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAll(options, optionalCallback); - } - } - - /** - * Starts the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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. - */ - startWithHttpOperationResponse(resourceGroupName, applicationGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._start(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Starts the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - start(resourceGroupName, applicationGatewayName, 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._start(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._start(resourceGroupName, applicationGatewayName, options, optionalCallback); - } - } - - /** - * Stops the specified application gateway in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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. - */ - stopWithHttpOperationResponse(resourceGroupName, applicationGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._stop(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Stops the specified application gateway in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - stop(resourceGroupName, applicationGatewayName, 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._stop(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._stop(resourceGroupName, applicationGatewayName, options, optionalCallback); - } - } - - /** - * Gets the backend health of the specified application gateway in a resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands BackendAddressPool and - * BackendHttpSettings referenced in backend health. - * - * @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. - */ - backendHealthWithHttpOperationResponse(resourceGroupName, applicationGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._backendHealth(resourceGroupName, applicationGatewayName, 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 backend health of the specified application gateway in a resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands BackendAddressPool and - * BackendHttpSettings referenced in backend health. - * - * @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 {ApplicationGatewayBackendHealth} - 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 ApplicationGatewayBackendHealth} 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. - */ - backendHealth(resourceGroupName, applicationGatewayName, 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._backendHealth(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._backendHealth(resourceGroupName, applicationGatewayName, options, optionalCallback); - } - } - - /** - * Lists all available web application firewall rule sets. - * - * @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. - */ - listAvailableWafRuleSetsWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAvailableWafRuleSets(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all available web application firewall rule sets. - * - * @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 {ApplicationGatewayAvailableWafRuleSetsResult} - 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 - * ApplicationGatewayAvailableWafRuleSetsResult} 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. - */ - listAvailableWafRuleSets(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._listAvailableWafRuleSets(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAvailableWafRuleSets(options, optionalCallback); - } - } - - /** - * Lists available Ssl options for configuring Ssl policy. - * - * @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. - */ - listAvailableSslOptionsWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAvailableSslOptions(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists available Ssl options for configuring Ssl policy. - * - * @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 {ApplicationGatewayAvailableSslOptions} - 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 ApplicationGatewayAvailableSslOptions} 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. - */ - listAvailableSslOptions(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._listAvailableSslOptions(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAvailableSslOptions(options, optionalCallback); - } - } - - /** - * Lists all SSL predefined policies for configuring Ssl policy. - * - * @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. - */ - listAvailableSslPredefinedPoliciesWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAvailableSslPredefinedPolicies(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all SSL predefined policies for configuring Ssl policy. - * - * @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 {ApplicationGatewayAvailableSslPredefinedPolicies} - 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 - * ApplicationGatewayAvailableSslPredefinedPolicies} 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. - */ - listAvailableSslPredefinedPolicies(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._listAvailableSslPredefinedPolicies(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAvailableSslPredefinedPolicies(options, optionalCallback); - } - } - - /** - * Gets Ssl predefined policy with the specified policy name. - * - * @param {string} predefinedPolicyName Name of Ssl predefined policy. - * - * @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. - */ - getSslPredefinedPolicyWithHttpOperationResponse(predefinedPolicyName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getSslPredefinedPolicy(predefinedPolicyName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets Ssl predefined policy with the specified policy name. - * - * @param {string} predefinedPolicyName Name of Ssl predefined policy. - * - * @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 {ApplicationGatewaySslPredefinedPolicy} - 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 ApplicationGatewaySslPredefinedPolicy} 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. - */ - getSslPredefinedPolicy(predefinedPolicyName, 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._getSslPredefinedPolicy(predefinedPolicyName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getSslPredefinedPolicy(predefinedPolicyName, options, optionalCallback); - } - } - - /** - * Deletes the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, applicationGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, applicationGatewayName, 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._beginDeleteMethod(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, applicationGatewayName, options, optionalCallback); - } - } - - /** - * Creates or updates the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} parameters Parameters supplied to the create or update - * application gateway operation. - * - * @param {object} [parameters.sku] SKU of the application gateway resource. - * - * @param {string} [parameters.sku.name] Name of an application gateway SKU. - * Possible values include: 'Standard_Small', 'Standard_Medium', - * 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' - * - * @param {string} [parameters.sku.tier] Tier of an application gateway. - * Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' - * - * @param {number} [parameters.sku.capacity] Capacity (instance count) of an - * application gateway. - * - * @param {object} [parameters.sslPolicy] SSL policy of the application gateway - * resource. - * - * @param {array} [parameters.sslPolicy.disabledSslProtocols] Ssl protocols to - * be disabled on application gateway. - * - * @param {string} [parameters.sslPolicy.policyType] Type of Ssl Policy. - * Possible values include: 'Predefined', 'Custom' - * - * @param {string} [parameters.sslPolicy.policyName] Name of Ssl predefined - * policy. Possible values include: 'AppGwSslPolicy20150501', - * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' - * - * @param {array} [parameters.sslPolicy.cipherSuites] Ssl cipher suites to be - * enabled in the specified order to application gateway. - * - * @param {string} [parameters.sslPolicy.minProtocolVersion] Minimum version of - * Ssl protocol to be supported on application gateway. Possible values - * include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' - * - * @param {array} [parameters.gatewayIPConfigurations] Subnets of application - * the gateway resource. - * - * @param {array} [parameters.authenticationCertificates] Authentication - * certificates of the application gateway resource. - * - * @param {array} [parameters.trustedRootCertificates] Trusted Root - * certificates of the application gateway resource. - * - * @param {array} [parameters.sslCertificates] SSL certificates of the - * application gateway resource. - * - * @param {array} [parameters.frontendIPConfigurations] Frontend IP addresses - * of the application gateway resource. - * - * @param {array} [parameters.frontendPorts] Frontend ports of the application - * gateway resource. - * - * @param {array} [parameters.probes] Probes of the application gateway - * resource. - * - * @param {array} [parameters.backendAddressPools] Backend address pool of the - * application gateway resource. - * - * @param {array} [parameters.backendHttpSettingsCollection] Backend http - * settings of the application gateway resource. - * - * @param {array} [parameters.httpListeners] Http listeners of the application - * gateway resource. - * - * @param {array} [parameters.urlPathMaps] URL path map of the application - * gateway resource. - * - * @param {array} [parameters.requestRoutingRules] Request routing rules of the - * application gateway resource. - * - * @param {array} [parameters.rewriteRuleSets] Rewrite rules for the - * application gateway resource. - * - * @param {array} [parameters.redirectConfigurations] Redirect configurations - * of the application gateway resource. - * - * @param {object} [parameters.webApplicationFirewallConfiguration] Web - * application firewall configuration. - * - * @param {boolean} parameters.webApplicationFirewallConfiguration.enabled - * Whether the web application firewall is enabled or not. - * - * @param {string} parameters.webApplicationFirewallConfiguration.firewallMode - * Web application firewall mode. Possible values include: 'Detection', - * 'Prevention' - * - * @param {string} parameters.webApplicationFirewallConfiguration.ruleSetType - * The type of the web application firewall rule set. Possible values are: - * 'OWASP'. - * - * @param {string} - * parameters.webApplicationFirewallConfiguration.ruleSetVersion The version of - * the rule set type. - * - * @param {array} - * [parameters.webApplicationFirewallConfiguration.disabledRuleGroups] The - * disabled rule groups. - * - * @param {boolean} - * [parameters.webApplicationFirewallConfiguration.requestBodyCheck] Whether - * allow WAF to check request Body. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.maxRequestBodySize] Maxium - * request body size for WAF. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.maxRequestBodySizeInKb] - * Maxium request body size in Kb for WAF. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.fileUploadLimitInMb] Maxium - * file upload size in Mb for WAF. - * - * @param {array} [parameters.webApplicationFirewallConfiguration.exclusions] - * The exclusion list. - * - * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the - * application gateway resource. - * - * @param {boolean} [parameters.enableFips] Whether FIPS is enabled on the - * application gateway resource. - * - * @param {object} [parameters.autoscaleConfiguration] Autoscale Configuration. - * - * @param {number} parameters.autoscaleConfiguration.minCapacity Lower bound on - * number of Application Gateway instances - * - * @param {string} [parameters.resourceGuid] Resource GUID property of the - * application gateway resource. - * - * @param {string} [parameters.provisioningState] Provisioning state of the - * application gateway resource. Possible values are: 'Updating', 'Deleting', - * and 'Failed'. - * - * @param {array} [parameters.customErrorConfigurations] Custom error - * configurations of the application gateway resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting - * where the resource needs to come from. - * - * @param {object} [parameters.identity] The identity of the application - * gateway, if configured. - * - * @param {string} [parameters.identity.type] The type of identity used for the - * resource. The type 'SystemAssigned, UserAssigned' includes both an - * implicitly created identity and a set of user assigned identities. The type - * 'None' will remove any identities from the virtual machine. Possible values - * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', - * 'None' - * - * @param {object} [parameters.identity.userAssignedIdentities] The list of - * user identities associated with resource. The user identity dictionary key - * references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, applicationGatewayName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, applicationGatewayName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} parameters Parameters supplied to the create or update - * application gateway operation. - * - * @param {object} [parameters.sku] SKU of the application gateway resource. - * - * @param {string} [parameters.sku.name] Name of an application gateway SKU. - * Possible values include: 'Standard_Small', 'Standard_Medium', - * 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' - * - * @param {string} [parameters.sku.tier] Tier of an application gateway. - * Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' - * - * @param {number} [parameters.sku.capacity] Capacity (instance count) of an - * application gateway. - * - * @param {object} [parameters.sslPolicy] SSL policy of the application gateway - * resource. - * - * @param {array} [parameters.sslPolicy.disabledSslProtocols] Ssl protocols to - * be disabled on application gateway. - * - * @param {string} [parameters.sslPolicy.policyType] Type of Ssl Policy. - * Possible values include: 'Predefined', 'Custom' - * - * @param {string} [parameters.sslPolicy.policyName] Name of Ssl predefined - * policy. Possible values include: 'AppGwSslPolicy20150501', - * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' - * - * @param {array} [parameters.sslPolicy.cipherSuites] Ssl cipher suites to be - * enabled in the specified order to application gateway. - * - * @param {string} [parameters.sslPolicy.minProtocolVersion] Minimum version of - * Ssl protocol to be supported on application gateway. Possible values - * include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' - * - * @param {array} [parameters.gatewayIPConfigurations] Subnets of application - * the gateway resource. - * - * @param {array} [parameters.authenticationCertificates] Authentication - * certificates of the application gateway resource. - * - * @param {array} [parameters.trustedRootCertificates] Trusted Root - * certificates of the application gateway resource. - * - * @param {array} [parameters.sslCertificates] SSL certificates of the - * application gateway resource. - * - * @param {array} [parameters.frontendIPConfigurations] Frontend IP addresses - * of the application gateway resource. - * - * @param {array} [parameters.frontendPorts] Frontend ports of the application - * gateway resource. - * - * @param {array} [parameters.probes] Probes of the application gateway - * resource. - * - * @param {array} [parameters.backendAddressPools] Backend address pool of the - * application gateway resource. - * - * @param {array} [parameters.backendHttpSettingsCollection] Backend http - * settings of the application gateway resource. - * - * @param {array} [parameters.httpListeners] Http listeners of the application - * gateway resource. - * - * @param {array} [parameters.urlPathMaps] URL path map of the application - * gateway resource. - * - * @param {array} [parameters.requestRoutingRules] Request routing rules of the - * application gateway resource. - * - * @param {array} [parameters.rewriteRuleSets] Rewrite rules for the - * application gateway resource. - * - * @param {array} [parameters.redirectConfigurations] Redirect configurations - * of the application gateway resource. - * - * @param {object} [parameters.webApplicationFirewallConfiguration] Web - * application firewall configuration. - * - * @param {boolean} parameters.webApplicationFirewallConfiguration.enabled - * Whether the web application firewall is enabled or not. - * - * @param {string} parameters.webApplicationFirewallConfiguration.firewallMode - * Web application firewall mode. Possible values include: 'Detection', - * 'Prevention' - * - * @param {string} parameters.webApplicationFirewallConfiguration.ruleSetType - * The type of the web application firewall rule set. Possible values are: - * 'OWASP'. - * - * @param {string} - * parameters.webApplicationFirewallConfiguration.ruleSetVersion The version of - * the rule set type. - * - * @param {array} - * [parameters.webApplicationFirewallConfiguration.disabledRuleGroups] The - * disabled rule groups. - * - * @param {boolean} - * [parameters.webApplicationFirewallConfiguration.requestBodyCheck] Whether - * allow WAF to check request Body. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.maxRequestBodySize] Maxium - * request body size for WAF. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.maxRequestBodySizeInKb] - * Maxium request body size in Kb for WAF. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.fileUploadLimitInMb] Maxium - * file upload size in Mb for WAF. - * - * @param {array} [parameters.webApplicationFirewallConfiguration.exclusions] - * The exclusion list. - * - * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the - * application gateway resource. - * - * @param {boolean} [parameters.enableFips] Whether FIPS is enabled on the - * application gateway resource. - * - * @param {object} [parameters.autoscaleConfiguration] Autoscale Configuration. - * - * @param {number} parameters.autoscaleConfiguration.minCapacity Lower bound on - * number of Application Gateway instances - * - * @param {string} [parameters.resourceGuid] Resource GUID property of the - * application gateway resource. - * - * @param {string} [parameters.provisioningState] Provisioning state of the - * application gateway resource. Possible values are: 'Updating', 'Deleting', - * and 'Failed'. - * - * @param {array} [parameters.customErrorConfigurations] Custom error - * configurations of the application gateway resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting - * where the resource needs to come from. - * - * @param {object} [parameters.identity] The identity of the application - * gateway, if configured. - * - * @param {string} [parameters.identity.type] The type of identity used for the - * resource. The type 'SystemAssigned, UserAssigned' includes both an - * implicitly created identity and a set of user assigned identities. The type - * 'None' will remove any identities from the virtual machine. Possible values - * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', - * 'None' - * - * @param {object} [parameters.identity.userAssignedIdentities] The list of - * user identities associated with resource. The user identity dictionary key - * references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ApplicationGateway} - 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 ApplicationGateway} 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. - */ - beginCreateOrUpdate(resourceGroupName, applicationGatewayName, parameters, 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._beginCreateOrUpdate(resourceGroupName, applicationGatewayName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, applicationGatewayName, parameters, options, optionalCallback); - } - } - - /** - * Updates the specified application gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} parameters Parameters supplied to update application gateway - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName, applicationGatewayName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginUpdateTags(resourceGroupName, applicationGatewayName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates the specified application gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} parameters Parameters supplied to update application gateway - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ApplicationGateway} - 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 ApplicationGateway} 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. - */ - beginUpdateTags(resourceGroupName, applicationGatewayName, parameters, 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._beginUpdateTags(resourceGroupName, applicationGatewayName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginUpdateTags(resourceGroupName, applicationGatewayName, parameters, options, optionalCallback); - } - } - - /** - * Starts the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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. - */ - beginStartWithHttpOperationResponse(resourceGroupName, applicationGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginStart(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Starts the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginStart(resourceGroupName, applicationGatewayName, 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._beginStart(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginStart(resourceGroupName, applicationGatewayName, options, optionalCallback); - } - } - - /** - * Stops the specified application gateway in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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. - */ - beginStopWithHttpOperationResponse(resourceGroupName, applicationGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginStop(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Stops the specified application gateway in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginStop(resourceGroupName, applicationGatewayName, 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._beginStop(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginStop(resourceGroupName, applicationGatewayName, options, optionalCallback); - } - } - - /** - * Gets the backend health of the specified application gateway in a resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands BackendAddressPool and - * BackendHttpSettings referenced in backend health. - * - * @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. - */ - beginBackendHealthWithHttpOperationResponse(resourceGroupName, applicationGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginBackendHealth(resourceGroupName, applicationGatewayName, 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 backend health of the specified application gateway in a resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands BackendAddressPool and - * BackendHttpSettings referenced in backend health. - * - * @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 {ApplicationGatewayBackendHealth} - 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 ApplicationGatewayBackendHealth} 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. - */ - beginBackendHealth(resourceGroupName, applicationGatewayName, 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._beginBackendHealth(resourceGroupName, applicationGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginBackendHealth(resourceGroupName, applicationGatewayName, options, optionalCallback); - } - } - - /** - * Lists all application gateways in a resource group. - * - * @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; - }); - }); - } - - /** - * Lists all application gateways in a resource group. - * - * @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 {ApplicationGatewayListResult} - 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 ApplicationGatewayListResult} 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); - } - } - - /** - * Gets all the application gateways in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAllNext(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 the application gateways in a subscription. - * - * @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 {ApplicationGatewayListResult} - 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 ApplicationGatewayListResult} 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. - */ - listAllNext(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._listAllNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAllNext(nextPageLink, options, optionalCallback); - } - } - - /** - * Lists all SSL predefined policies for configuring Ssl policy. - * - * @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. - */ - listAvailableSslPredefinedPoliciesNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAvailableSslPredefinedPoliciesNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all SSL predefined policies for configuring Ssl policy. - * - * @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 {ApplicationGatewayAvailableSslPredefinedPolicies} - 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 - * ApplicationGatewayAvailableSslPredefinedPolicies} 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. - */ - listAvailableSslPredefinedPoliciesNext(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._listAvailableSslPredefinedPoliciesNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAvailableSslPredefinedPoliciesNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = ApplicationGateways; diff --git a/lib/services/networkManagement2/lib/operations/applicationSecurityGroups.js b/lib/services/networkManagement2/lib/operations/applicationSecurityGroups.js deleted file mode 100644 index cbd49b44d..000000000 --- a/lib/services/networkManagement2/lib/operations/applicationSecurityGroups.js +++ /dev/null @@ -1,1985 +0,0 @@ -/* - * 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; - - -/** - * Deletes the specified application security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationSecurityGroupName The name of the application - * security group. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, applicationSecurityGroupName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, applicationSecurityGroupName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets information about the specified application security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationSecurityGroupName The name of the application - * security group. - * - * @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 ApplicationSecurityGroup} 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, applicationSecurityGroupName, 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-10-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 (applicationSecurityGroupName === null || applicationSecurityGroupName === undefined || typeof applicationSecurityGroupName.valueOf() !== 'string') { - throw new Error('applicationSecurityGroupName 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/applicationSecurityGroups/{applicationSecurityGroupName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{applicationSecurityGroupName}', encodeURIComponent(applicationSecurityGroupName)); - 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['ApplicationSecurityGroup']().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); - }); -} - - -/** - * Creates or updates an application security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationSecurityGroupName The name of the application - * security group. - * - * @param {object} parameters Parameters supplied to the create or update - * ApplicationSecurityGroup operation. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 ApplicationSecurityGroup} 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 _createOrUpdate(resourceGroupName, applicationSecurityGroupName, parameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, applicationSecurityGroupName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ApplicationSecurityGroup']().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 application security groups in a subscription. - * - * @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 ApplicationSecurityGroupListResult} 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 _listAll(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/applicationSecurityGroups'; - 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['ApplicationSecurityGroupListResult']().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 the application security groups in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 ApplicationSecurityGroupListResult} 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, 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-10-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 (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/applicationSecurityGroups'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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['ApplicationSecurityGroupListResult']().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); - }); -} - -/** - * Deletes the specified application security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationSecurityGroupName The name of the application - * security group. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, applicationSecurityGroupName, 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-10-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 (applicationSecurityGroupName === null || applicationSecurityGroupName === undefined || typeof applicationSecurityGroupName.valueOf() !== 'string') { - throw new Error('applicationSecurityGroupName 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/applicationSecurityGroups/{applicationSecurityGroupName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{applicationSecurityGroupName}', encodeURIComponent(applicationSecurityGroupName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates an application security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationSecurityGroupName The name of the application - * security group. - * - * @param {object} parameters Parameters supplied to the create or update - * ApplicationSecurityGroup operation. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 ApplicationSecurityGroup} 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 _beginCreateOrUpdate(resourceGroupName, applicationSecurityGroupName, parameters, 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-10-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 (applicationSecurityGroupName === null || applicationSecurityGroupName === undefined || typeof applicationSecurityGroupName.valueOf() !== 'string') { - throw new Error('applicationSecurityGroupName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/applicationSecurityGroups/{applicationSecurityGroupName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{applicationSecurityGroupName}', encodeURIComponent(applicationSecurityGroupName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['ApplicationSecurityGroup']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['ApplicationSecurityGroup']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ApplicationSecurityGroup']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Gets all application security groups in a subscription. - * - * @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 ApplicationSecurityGroupListResult} 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 _listAllNext(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['ApplicationSecurityGroupListResult']().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 the application security groups in a resource group. - * - * @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 ApplicationSecurityGroupListResult} 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['ApplicationSecurityGroupListResult']().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 ApplicationSecurityGroups. */ -class ApplicationSecurityGroups { - /** - * Create a ApplicationSecurityGroups. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._listAll = _listAll; - this._list = _list; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._listAllNext = _listAllNext; - this._listNext = _listNext; - } - - /** - * Deletes the specified application security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationSecurityGroupName The name of the application - * security group. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, applicationSecurityGroupName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, applicationSecurityGroupName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified application security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationSecurityGroupName The name of the application - * security group. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, applicationSecurityGroupName, 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._deleteMethod(resourceGroupName, applicationSecurityGroupName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, applicationSecurityGroupName, options, optionalCallback); - } - } - - /** - * Gets information about the specified application security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationSecurityGroupName The name of the application - * security group. - * - * @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, applicationSecurityGroupName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, applicationSecurityGroupName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets information about the specified application security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationSecurityGroupName The name of the application - * security group. - * - * @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 {ApplicationSecurityGroup} - 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 ApplicationSecurityGroup} 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, applicationSecurityGroupName, 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, applicationSecurityGroupName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, applicationSecurityGroupName, options, optionalCallback); - } - } - - /** - * Creates or updates an application security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationSecurityGroupName The name of the application - * security group. - * - * @param {object} parameters Parameters supplied to the create or update - * ApplicationSecurityGroup operation. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, applicationSecurityGroupName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, applicationSecurityGroupName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates an application security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationSecurityGroupName The name of the application - * security group. - * - * @param {object} parameters Parameters supplied to the create or update - * ApplicationSecurityGroup operation. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ApplicationSecurityGroup} - 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 ApplicationSecurityGroup} 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. - */ - createOrUpdate(resourceGroupName, applicationSecurityGroupName, parameters, 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._createOrUpdate(resourceGroupName, applicationSecurityGroupName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, applicationSecurityGroupName, parameters, options, optionalCallback); - } - } - - /** - * Gets all application security groups in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAll(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 application security groups in a subscription. - * - * @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 {ApplicationSecurityGroupListResult} - 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 ApplicationSecurityGroupListResult} 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. - */ - listAll(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._listAll(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAll(options, optionalCallback); - } - } - - /** - * Gets all the application security groups in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, 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 the application security groups in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {ApplicationSecurityGroupListResult} - 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 ApplicationSecurityGroupListResult} 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, 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, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, options, optionalCallback); - } - } - - /** - * Deletes the specified application security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationSecurityGroupName The name of the application - * security group. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, applicationSecurityGroupName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, applicationSecurityGroupName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified application security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationSecurityGroupName The name of the application - * security group. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, applicationSecurityGroupName, 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._beginDeleteMethod(resourceGroupName, applicationSecurityGroupName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, applicationSecurityGroupName, options, optionalCallback); - } - } - - /** - * Creates or updates an application security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationSecurityGroupName The name of the application - * security group. - * - * @param {object} parameters Parameters supplied to the create or update - * ApplicationSecurityGroup operation. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, applicationSecurityGroupName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, applicationSecurityGroupName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates an application security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationSecurityGroupName The name of the application - * security group. - * - * @param {object} parameters Parameters supplied to the create or update - * ApplicationSecurityGroup operation. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ApplicationSecurityGroup} - 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 ApplicationSecurityGroup} 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. - */ - beginCreateOrUpdate(resourceGroupName, applicationSecurityGroupName, parameters, 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._beginCreateOrUpdate(resourceGroupName, applicationSecurityGroupName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, applicationSecurityGroupName, parameters, options, optionalCallback); - } - } - - /** - * Gets all application security groups in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAllNext(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 application security groups in a subscription. - * - * @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 {ApplicationSecurityGroupListResult} - 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 ApplicationSecurityGroupListResult} 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. - */ - listAllNext(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._listAllNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAllNext(nextPageLink, options, optionalCallback); - } - } - - /** - * Gets all the application security groups in a resource group. - * - * @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 the application security groups in a resource group. - * - * @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 {ApplicationSecurityGroupListResult} - 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 ApplicationSecurityGroupListResult} 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 = ApplicationSecurityGroups; diff --git a/lib/services/networkManagement2/lib/operations/availableDelegations.js b/lib/services/networkManagement2/lib/operations/availableDelegations.js deleted file mode 100644 index c9135d952..000000000 --- a/lib/services/networkManagement2/lib/operations/availableDelegations.js +++ /dev/null @@ -1,471 +0,0 @@ -/* - * 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 all of the available subnet delegations for this subscription in this - * region. - * - * @param {string} location The location of the subnet. - * - * @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 AvailableDelegationsResult} 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(location, 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-10-01'; - // Validate - try { - if (location === null || location === undefined || typeof location.valueOf() !== 'string') { - throw new Error('location 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}/providers/Microsoft.Network/locations/{location}/availableDelegations'; - requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); - 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['AvailableDelegationsResult']().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 of the available subnet delegations for this subscription in this - * region. - * - * @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 AvailableDelegationsResult} 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['AvailableDelegationsResult']().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 AvailableDelegations. */ -class AvailableDelegations { - /** - * Create a AvailableDelegations. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._list = _list; - this._listNext = _listNext; - } - - /** - * Gets all of the available subnet delegations for this subscription in this - * region. - * - * @param {string} location The location of the subnet. - * - * @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(location, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(location, 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 of the available subnet delegations for this subscription in this - * region. - * - * @param {string} location The location of the subnet. - * - * @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 {AvailableDelegationsResult} - 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 AvailableDelegationsResult} 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(location, 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(location, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(location, options, optionalCallback); - } - } - - /** - * Gets all of the available subnet delegations for this subscription in this - * region. - * - * @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 of the available subnet delegations for this subscription in this - * region. - * - * @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 {AvailableDelegationsResult} - 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 AvailableDelegationsResult} 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 = AvailableDelegations; diff --git a/lib/services/networkManagement2/lib/operations/availableEndpointServices.js b/lib/services/networkManagement2/lib/operations/availableEndpointServices.js deleted file mode 100644 index ceb1cd2fa..000000000 --- a/lib/services/networkManagement2/lib/operations/availableEndpointServices.js +++ /dev/null @@ -1,465 +0,0 @@ -/* - * 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; - -/** - * List what values of endpoint services are available for use. - * - * @param {string} location The location to check available endpoint services. - * - * @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 EndpointServicesListResult} 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(location, 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-10-01'; - // Validate - try { - if (location === null || location === undefined || typeof location.valueOf() !== 'string') { - throw new Error('location 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}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices'; - requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); - 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['EndpointServicesListResult']().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); - }); -} - -/** - * List what values of endpoint services are available for use. - * - * @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 EndpointServicesListResult} 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['EndpointServicesListResult']().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 AvailableEndpointServices. */ -class AvailableEndpointServices { - /** - * Create a AvailableEndpointServices. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._list = _list; - this._listNext = _listNext; - } - - /** - * List what values of endpoint services are available for use. - * - * @param {string} location The location to check available endpoint services. - * - * @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(location, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(location, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * List what values of endpoint services are available for use. - * - * @param {string} location The location to check available endpoint services. - * - * @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 {EndpointServicesListResult} - 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 EndpointServicesListResult} 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(location, 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(location, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(location, options, optionalCallback); - } - } - - /** - * List what values of endpoint services are available for use. - * - * @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; - }); - }); - } - - /** - * List what values of endpoint services are available for use. - * - * @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 {EndpointServicesListResult} - 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 EndpointServicesListResult} 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 = AvailableEndpointServices; diff --git a/lib/services/networkManagement2/lib/operations/availableResourceGroupDelegations.js b/lib/services/networkManagement2/lib/operations/availableResourceGroupDelegations.js deleted file mode 100644 index 3c242eaf4..000000000 --- a/lib/services/networkManagement2/lib/operations/availableResourceGroupDelegations.js +++ /dev/null @@ -1,481 +0,0 @@ -/* - * 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 all of the available subnet delegations for this resource group in this - * region. - * - * @param {string} location The location of the domain name. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 AvailableDelegationsResult} 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(location, resourceGroupName, 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-10-01'; - // Validate - try { - if (location === null || location === undefined || typeof location.valueOf() !== 'string') { - throw new Error('location cannot be null or undefined and it must be of type string.'); - } - 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 (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/locations/{location}/availableDelegations'; - requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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['AvailableDelegationsResult']().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 of the available subnet delegations for this resource group in this - * region. - * - * @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 AvailableDelegationsResult} 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['AvailableDelegationsResult']().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 AvailableResourceGroupDelegations. */ -class AvailableResourceGroupDelegations { - /** - * Create a AvailableResourceGroupDelegations. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._list = _list; - this._listNext = _listNext; - } - - /** - * Gets all of the available subnet delegations for this resource group in this - * region. - * - * @param {string} location The location of the domain name. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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(location, resourceGroupName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(location, resourceGroupName, 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 of the available subnet delegations for this resource group in this - * region. - * - * @param {string} location The location of the domain name. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {AvailableDelegationsResult} - 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 AvailableDelegationsResult} 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(location, resourceGroupName, 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(location, resourceGroupName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(location, resourceGroupName, options, optionalCallback); - } - } - - /** - * Gets all of the available subnet delegations for this resource group in this - * region. - * - * @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 of the available subnet delegations for this resource group in this - * region. - * - * @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 {AvailableDelegationsResult} - 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 AvailableDelegationsResult} 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 = AvailableResourceGroupDelegations; diff --git a/lib/services/networkManagement2/lib/operations/azureFirewallFqdnTags.js b/lib/services/networkManagement2/lib/operations/azureFirewallFqdnTags.js deleted file mode 100644 index 1239e0ba2..000000000 --- a/lib/services/networkManagement2/lib/operations/azureFirewallFqdnTags.js +++ /dev/null @@ -1,455 +0,0 @@ -/* - * 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 all the Azure Firewall FQDN Tags in a subscription. - * - * @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 AzureFirewallFqdnTagListResult} 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 _listAll(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/azureFirewallFqdnTags'; - 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['AzureFirewallFqdnTagListResult']().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 the Azure Firewall FQDN Tags in a subscription. - * - * @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 AzureFirewallFqdnTagListResult} 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 _listAllNext(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['AzureFirewallFqdnTagListResult']().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 AzureFirewallFqdnTags. */ -class AzureFirewallFqdnTags { - /** - * Create a AzureFirewallFqdnTags. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._listAll = _listAll; - this._listAllNext = _listAllNext; - } - - /** - * Gets all the Azure Firewall FQDN Tags in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAll(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 the Azure Firewall FQDN Tags in a subscription. - * - * @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 {AzureFirewallFqdnTagListResult} - 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 AzureFirewallFqdnTagListResult} 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. - */ - listAll(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._listAll(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAll(options, optionalCallback); - } - } - - /** - * Gets all the Azure Firewall FQDN Tags in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAllNext(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 the Azure Firewall FQDN Tags in a subscription. - * - * @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 {AzureFirewallFqdnTagListResult} - 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 AzureFirewallFqdnTagListResult} 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. - */ - listAllNext(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._listAllNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAllNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = AzureFirewallFqdnTags; diff --git a/lib/services/networkManagement2/lib/operations/azureFirewalls.js b/lib/services/networkManagement2/lib/operations/azureFirewalls.js deleted file mode 100644 index ef1dc648b..000000000 --- a/lib/services/networkManagement2/lib/operations/azureFirewalls.js +++ /dev/null @@ -1,2060 +0,0 @@ -/* - * 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; - - -/** - * Deletes the specified Azure Firewall. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} azureFirewallName The name of the Azure Firewall. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, azureFirewallName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, azureFirewallName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets the specified Azure Firewall. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} azureFirewallName The name of the Azure Firewall. - * - * @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 AzureFirewall} 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, azureFirewallName, 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-10-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 (azureFirewallName === null || azureFirewallName === undefined || typeof azureFirewallName.valueOf() !== 'string') { - throw new Error('azureFirewallName 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/azureFirewalls/{azureFirewallName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{azureFirewallName}', encodeURIComponent(azureFirewallName)); - 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['AzureFirewall']().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); - }); -} - - -/** - * Creates or updates the specified Azure Firewall. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} azureFirewallName The name of the Azure Firewall. - * - * @param {object} parameters Parameters supplied to the create or update Azure - * Firewall operation. - * - * @param {array} [parameters.applicationRuleCollections] Collection of - * application rule collections used by Azure Firewall. - * - * @param {array} [parameters.natRuleCollections] Collection of NAT rule - * collections used by Azure Firewall. - * - * @param {array} [parameters.networkRuleCollections] Collection of network - * rule collections used by Azure Firewall. - * - * @param {array} [parameters.ipConfigurations] IP configuration of the Azure - * Firewall resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 AzureFirewall} 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 _createOrUpdate(resourceGroupName, azureFirewallName, parameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, azureFirewallName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['AzureFirewall']().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); - }); - }); -} - -/** - * Lists all Azure Firewalls in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 AzureFirewallListResult} 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, 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-10-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 (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/azureFirewalls'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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['AzureFirewallListResult']().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 the Azure Firewalls in a subscription. - * - * @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 AzureFirewallListResult} 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 _listAll(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/azureFirewalls'; - 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['AzureFirewallListResult']().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); - }); -} - -/** - * Deletes the specified Azure Firewall. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} azureFirewallName The name of the Azure Firewall. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, azureFirewallName, 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-10-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 (azureFirewallName === null || azureFirewallName === undefined || typeof azureFirewallName.valueOf() !== 'string') { - throw new Error('azureFirewallName 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/azureFirewalls/{azureFirewallName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{azureFirewallName}', encodeURIComponent(azureFirewallName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates the specified Azure Firewall. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} azureFirewallName The name of the Azure Firewall. - * - * @param {object} parameters Parameters supplied to the create or update Azure - * Firewall operation. - * - * @param {array} [parameters.applicationRuleCollections] Collection of - * application rule collections used by Azure Firewall. - * - * @param {array} [parameters.natRuleCollections] Collection of NAT rule - * collections used by Azure Firewall. - * - * @param {array} [parameters.networkRuleCollections] Collection of network - * rule collections used by Azure Firewall. - * - * @param {array} [parameters.ipConfigurations] IP configuration of the Azure - * Firewall resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 AzureFirewall} 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 _beginCreateOrUpdate(resourceGroupName, azureFirewallName, parameters, 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-10-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 (azureFirewallName === null || azureFirewallName === undefined || typeof azureFirewallName.valueOf() !== 'string') { - throw new Error('azureFirewallName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/azureFirewalls/{azureFirewallName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{azureFirewallName}', encodeURIComponent(azureFirewallName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['AzureFirewall']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['AzureFirewall']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['AzureFirewall']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Lists all Azure Firewalls in a resource group. - * - * @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 AzureFirewallListResult} 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['AzureFirewallListResult']().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 the Azure Firewalls in a subscription. - * - * @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 AzureFirewallListResult} 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 _listAllNext(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['AzureFirewallListResult']().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 AzureFirewalls. */ -class AzureFirewalls { - /** - * Create a AzureFirewalls. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._list = _list; - this._listAll = _listAll; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._listNext = _listNext; - this._listAllNext = _listAllNext; - } - - /** - * Deletes the specified Azure Firewall. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} azureFirewallName The name of the Azure Firewall. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, azureFirewallName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, azureFirewallName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified Azure Firewall. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} azureFirewallName The name of the Azure Firewall. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, azureFirewallName, 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._deleteMethod(resourceGroupName, azureFirewallName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, azureFirewallName, options, optionalCallback); - } - } - - /** - * Gets the specified Azure Firewall. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} azureFirewallName The name of the Azure Firewall. - * - * @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, azureFirewallName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, azureFirewallName, 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 Azure Firewall. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} azureFirewallName The name of the Azure Firewall. - * - * @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 {AzureFirewall} - 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 AzureFirewall} 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, azureFirewallName, 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, azureFirewallName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, azureFirewallName, options, optionalCallback); - } - } - - /** - * Creates or updates the specified Azure Firewall. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} azureFirewallName The name of the Azure Firewall. - * - * @param {object} parameters Parameters supplied to the create or update Azure - * Firewall operation. - * - * @param {array} [parameters.applicationRuleCollections] Collection of - * application rule collections used by Azure Firewall. - * - * @param {array} [parameters.natRuleCollections] Collection of NAT rule - * collections used by Azure Firewall. - * - * @param {array} [parameters.networkRuleCollections] Collection of network - * rule collections used by Azure Firewall. - * - * @param {array} [parameters.ipConfigurations] IP configuration of the Azure - * Firewall resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, azureFirewallName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, azureFirewallName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the specified Azure Firewall. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} azureFirewallName The name of the Azure Firewall. - * - * @param {object} parameters Parameters supplied to the create or update Azure - * Firewall operation. - * - * @param {array} [parameters.applicationRuleCollections] Collection of - * application rule collections used by Azure Firewall. - * - * @param {array} [parameters.natRuleCollections] Collection of NAT rule - * collections used by Azure Firewall. - * - * @param {array} [parameters.networkRuleCollections] Collection of network - * rule collections used by Azure Firewall. - * - * @param {array} [parameters.ipConfigurations] IP configuration of the Azure - * Firewall resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {AzureFirewall} - 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 AzureFirewall} 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. - */ - createOrUpdate(resourceGroupName, azureFirewallName, parameters, 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._createOrUpdate(resourceGroupName, azureFirewallName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, azureFirewallName, parameters, options, optionalCallback); - } - } - - /** - * Lists all Azure Firewalls in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all Azure Firewalls in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {AzureFirewallListResult} - 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 AzureFirewallListResult} 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, 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, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, options, optionalCallback); - } - } - - /** - * Gets all the Azure Firewalls in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAll(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 the Azure Firewalls in a subscription. - * - * @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 {AzureFirewallListResult} - 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 AzureFirewallListResult} 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. - */ - listAll(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._listAll(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAll(options, optionalCallback); - } - } - - /** - * Deletes the specified Azure Firewall. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} azureFirewallName The name of the Azure Firewall. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, azureFirewallName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, azureFirewallName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified Azure Firewall. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} azureFirewallName The name of the Azure Firewall. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, azureFirewallName, 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._beginDeleteMethod(resourceGroupName, azureFirewallName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, azureFirewallName, options, optionalCallback); - } - } - - /** - * Creates or updates the specified Azure Firewall. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} azureFirewallName The name of the Azure Firewall. - * - * @param {object} parameters Parameters supplied to the create or update Azure - * Firewall operation. - * - * @param {array} [parameters.applicationRuleCollections] Collection of - * application rule collections used by Azure Firewall. - * - * @param {array} [parameters.natRuleCollections] Collection of NAT rule - * collections used by Azure Firewall. - * - * @param {array} [parameters.networkRuleCollections] Collection of network - * rule collections used by Azure Firewall. - * - * @param {array} [parameters.ipConfigurations] IP configuration of the Azure - * Firewall resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, azureFirewallName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, azureFirewallName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the specified Azure Firewall. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} azureFirewallName The name of the Azure Firewall. - * - * @param {object} parameters Parameters supplied to the create or update Azure - * Firewall operation. - * - * @param {array} [parameters.applicationRuleCollections] Collection of - * application rule collections used by Azure Firewall. - * - * @param {array} [parameters.natRuleCollections] Collection of NAT rule - * collections used by Azure Firewall. - * - * @param {array} [parameters.networkRuleCollections] Collection of network - * rule collections used by Azure Firewall. - * - * @param {array} [parameters.ipConfigurations] IP configuration of the Azure - * Firewall resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {AzureFirewall} - 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 AzureFirewall} 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. - */ - beginCreateOrUpdate(resourceGroupName, azureFirewallName, parameters, 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._beginCreateOrUpdate(resourceGroupName, azureFirewallName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, azureFirewallName, parameters, options, optionalCallback); - } - } - - /** - * Lists all Azure Firewalls in a resource group. - * - * @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; - }); - }); - } - - /** - * Lists all Azure Firewalls in a resource group. - * - * @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 {AzureFirewallListResult} - 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 AzureFirewallListResult} 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); - } - } - - /** - * Gets all the Azure Firewalls in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAllNext(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 the Azure Firewalls in a subscription. - * - * @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 {AzureFirewallListResult} - 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 AzureFirewallListResult} 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. - */ - listAllNext(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._listAllNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAllNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = AzureFirewalls; diff --git a/lib/services/networkManagement2/lib/operations/bgpServiceCommunities.js b/lib/services/networkManagement2/lib/operations/bgpServiceCommunities.js deleted file mode 100644 index 9e942bbc5..000000000 --- a/lib/services/networkManagement2/lib/operations/bgpServiceCommunities.js +++ /dev/null @@ -1,455 +0,0 @@ -/* - * 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 all the available bgp service communities. - * - * @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 BgpServiceCommunityListResult} 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(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/bgpServiceCommunities'; - 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['BgpServiceCommunityListResult']().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 the available bgp service communities. - * - * @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 BgpServiceCommunityListResult} 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['BgpServiceCommunityListResult']().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 BgpServiceCommunities. */ -class BgpServiceCommunities { - /** - * Create a BgpServiceCommunities. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._list = _list; - this._listNext = _listNext; - } - - /** - * Gets all the available bgp service communities. - * - * @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(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(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 the available bgp service communities. - * - * @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 {BgpServiceCommunityListResult} - 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 BgpServiceCommunityListResult} 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(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(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(options, optionalCallback); - } - } - - /** - * Gets all the available bgp service communities. - * - * @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 the available bgp service communities. - * - * @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 {BgpServiceCommunityListResult} - 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 BgpServiceCommunityListResult} 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 = BgpServiceCommunities; diff --git a/lib/services/networkManagement2/lib/operations/connectionMonitors.js b/lib/services/networkManagement2/lib/operations/connectionMonitors.js deleted file mode 100644 index ed2c2ebe3..000000000 --- a/lib/services/networkManagement2/lib/operations/connectionMonitors.js +++ /dev/null @@ -1,2753 +0,0 @@ -/* - * 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; - - -/** - * Create or update a connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @param {object} parameters Parameters that define the operation to create a - * connection monitor. - * - * @param {string} [parameters.location] Connection monitor location. - * - * @param {object} [parameters.tags] Connection monitor tags. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource used as - * the source by connection monitor. - * - * @param {number} [parameters.source.port] The source port used by connection - * monitor. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * used as the destination by connection monitor. - * - * @param {string} [parameters.destination.address] Address of the connection - * monitor destination (IP or domain name). - * - * @param {number} [parameters.destination.port] The destination port used by - * connection monitor. - * - * @param {boolean} [parameters.autoStart] Determines if the connection monitor - * will start automatically once created. - * - * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval - * in seconds. - * - * @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 ConnectionMonitorResult} 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 _createOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ConnectionMonitorResult']().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 a connection monitor by name. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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 ConnectionMonitorResult} 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, networkWatcherName, connectionMonitorName, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); - } - if (connectionMonitorName === null || connectionMonitorName === undefined || typeof connectionMonitorName.valueOf() !== 'string') { - throw new Error('connectionMonitorName 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/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - requestUrl = requestUrl.replace('{connectionMonitorName}', encodeURIComponent(connectionMonitorName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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['ConnectionMonitorResult']().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); - }); -} - - -/** - * Deletes the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, networkWatcherName, connectionMonitorName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * Stops the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _stop(resourceGroupName, networkWatcherName, connectionMonitorName, 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.'); - } - - // Send request - this.beginStop(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * Starts the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _start(resourceGroupName, networkWatcherName, connectionMonitorName, 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.'); - } - - // Send request - this.beginStart(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * Query a snapshot of the most recent connection states. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name given to the connection - * monitor. - * - * @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 ConnectionMonitorQueryResult} 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 _query(resourceGroupName, networkWatcherName, connectionMonitorName, 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.'); - } - - // Send request - this.beginQuery(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ConnectionMonitorQueryResult']().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); - }); - }); -} - -/** - * Lists all connection monitors for the specified Network Watcher. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @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 ConnectionMonitorListResult} 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, networkWatcherName, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName 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/networkWatchers/{networkWatcherName}/connectionMonitors'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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['ConnectionMonitorListResult']().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); - }); -} - -/** - * Create or update a connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @param {object} parameters Parameters that define the operation to create a - * connection monitor. - * - * @param {string} [parameters.location] Connection monitor location. - * - * @param {object} [parameters.tags] Connection monitor tags. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource used as - * the source by connection monitor. - * - * @param {number} [parameters.source.port] The source port used by connection - * monitor. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * used as the destination by connection monitor. - * - * @param {string} [parameters.destination.address] Address of the connection - * monitor destination (IP or domain name). - * - * @param {number} [parameters.destination.port] The destination port used by - * connection monitor. - * - * @param {boolean} [parameters.autoStart] Determines if the connection monitor - * will start automatically once created. - * - * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval - * in seconds. - * - * @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 ConnectionMonitorResult} 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 _beginCreateOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); - } - if (connectionMonitorName === null || connectionMonitorName === undefined || typeof connectionMonitorName.valueOf() !== 'string') { - throw new Error('connectionMonitorName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - requestUrl = requestUrl.replace('{connectionMonitorName}', encodeURIComponent(connectionMonitorName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['ConnectionMonitor']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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['ConnectionMonitorResult']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ConnectionMonitorResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Deletes the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, networkWatcherName, connectionMonitorName, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); - } - if (connectionMonitorName === null || connectionMonitorName === undefined || typeof connectionMonitorName.valueOf() !== 'string') { - throw new Error('connectionMonitorName 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/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - requestUrl = requestUrl.replace('{connectionMonitorName}', encodeURIComponent(connectionMonitorName)); - 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 = 'DELETE'; - 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 !== 202 && statusCode !== 204) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Stops the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginStop(resourceGroupName, networkWatcherName, connectionMonitorName, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); - } - if (connectionMonitorName === null || connectionMonitorName === undefined || typeof connectionMonitorName.valueOf() !== 'string') { - throw new Error('connectionMonitorName 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/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - requestUrl = requestUrl.replace('{connectionMonitorName}', encodeURIComponent(connectionMonitorName)); - 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 = 'POST'; - 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 && statusCode !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Starts the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginStart(resourceGroupName, networkWatcherName, connectionMonitorName, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); - } - if (connectionMonitorName === null || connectionMonitorName === undefined || typeof connectionMonitorName.valueOf() !== 'string') { - throw new Error('connectionMonitorName 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/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - requestUrl = requestUrl.replace('{connectionMonitorName}', encodeURIComponent(connectionMonitorName)); - 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 = 'POST'; - 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 && statusCode !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Query a snapshot of the most recent connection states. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name given to the connection - * monitor. - * - * @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 ConnectionMonitorQueryResult} 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 _beginQuery(resourceGroupName, networkWatcherName, connectionMonitorName, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); - } - if (connectionMonitorName === null || connectionMonitorName === undefined || typeof connectionMonitorName.valueOf() !== 'string') { - throw new Error('connectionMonitorName 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/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - requestUrl = requestUrl.replace('{connectionMonitorName}', encodeURIComponent(connectionMonitorName)); - 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 = 'POST'; - 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 && statusCode !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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['ConnectionMonitorQueryResult']().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); - } - } - // Deserialize Response - if (statusCode === 202) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ConnectionMonitorQueryResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** Class representing a ConnectionMonitors. */ -class ConnectionMonitors { - /** - * Create a ConnectionMonitors. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._createOrUpdate = _createOrUpdate; - this._get = _get; - this._deleteMethod = _deleteMethod; - this._stop = _stop; - this._start = _start; - this._query = _query; - this._list = _list; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginStop = _beginStop; - this._beginStart = _beginStart; - this._beginQuery = _beginQuery; - } - - /** - * Create or update a connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @param {object} parameters Parameters that define the operation to create a - * connection monitor. - * - * @param {string} [parameters.location] Connection monitor location. - * - * @param {object} [parameters.tags] Connection monitor tags. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource used as - * the source by connection monitor. - * - * @param {number} [parameters.source.port] The source port used by connection - * monitor. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * used as the destination by connection monitor. - * - * @param {string} [parameters.destination.address] Address of the connection - * monitor destination (IP or domain name). - * - * @param {number} [parameters.destination.port] The destination port used by - * connection monitor. - * - * @param {boolean} [parameters.autoStart] Determines if the connection monitor - * will start automatically once created. - * - * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval - * in seconds. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Create or update a connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @param {object} parameters Parameters that define the operation to create a - * connection monitor. - * - * @param {string} [parameters.location] Connection monitor location. - * - * @param {object} [parameters.tags] Connection monitor tags. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource used as - * the source by connection monitor. - * - * @param {number} [parameters.source.port] The source port used by connection - * monitor. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * used as the destination by connection monitor. - * - * @param {string} [parameters.destination.address] Address of the connection - * monitor destination (IP or domain name). - * - * @param {number} [parameters.destination.port] The destination port used by - * connection monitor. - * - * @param {boolean} [parameters.autoStart] Determines if the connection monitor - * will start automatically once created. - * - * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval - * in seconds. - * - * @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 {ConnectionMonitorResult} - 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 ConnectionMonitorResult} 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. - */ - createOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, 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._createOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, options, optionalCallback); - } - } - - /** - * Gets a connection monitor by name. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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, networkWatcherName, connectionMonitorName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets a connection monitor by name. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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 {ConnectionMonitorResult} - 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 ConnectionMonitorResult} 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, networkWatcherName, connectionMonitorName, 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, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, networkWatcherName, connectionMonitorName, options, optionalCallback); - } - } - - /** - * Deletes the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, networkWatcherName, connectionMonitorName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, networkWatcherName, connectionMonitorName, 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._deleteMethod(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, networkWatcherName, connectionMonitorName, options, optionalCallback); - } - } - - /** - * Stops the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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. - */ - stopWithHttpOperationResponse(resourceGroupName, networkWatcherName, connectionMonitorName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._stop(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Stops the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - stop(resourceGroupName, networkWatcherName, connectionMonitorName, 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._stop(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._stop(resourceGroupName, networkWatcherName, connectionMonitorName, options, optionalCallback); - } - } - - /** - * Starts the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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. - */ - startWithHttpOperationResponse(resourceGroupName, networkWatcherName, connectionMonitorName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._start(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Starts the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - start(resourceGroupName, networkWatcherName, connectionMonitorName, 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._start(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._start(resourceGroupName, networkWatcherName, connectionMonitorName, options, optionalCallback); - } - } - - /** - * Query a snapshot of the most recent connection states. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name given to the connection - * monitor. - * - * @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. - */ - queryWithHttpOperationResponse(resourceGroupName, networkWatcherName, connectionMonitorName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._query(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Query a snapshot of the most recent connection states. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name given to the connection - * monitor. - * - * @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 {ConnectionMonitorQueryResult} - 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 ConnectionMonitorQueryResult} 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. - */ - query(resourceGroupName, networkWatcherName, connectionMonitorName, 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._query(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._query(resourceGroupName, networkWatcherName, connectionMonitorName, options, optionalCallback); - } - } - - /** - * Lists all connection monitors for the specified Network Watcher. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @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, networkWatcherName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all connection monitors for the specified Network Watcher. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @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 {ConnectionMonitorListResult} - 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 ConnectionMonitorListResult} 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, networkWatcherName, 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, networkWatcherName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, networkWatcherName, options, optionalCallback); - } - } - - /** - * Create or update a connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @param {object} parameters Parameters that define the operation to create a - * connection monitor. - * - * @param {string} [parameters.location] Connection monitor location. - * - * @param {object} [parameters.tags] Connection monitor tags. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource used as - * the source by connection monitor. - * - * @param {number} [parameters.source.port] The source port used by connection - * monitor. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * used as the destination by connection monitor. - * - * @param {string} [parameters.destination.address] Address of the connection - * monitor destination (IP or domain name). - * - * @param {number} [parameters.destination.port] The destination port used by - * connection monitor. - * - * @param {boolean} [parameters.autoStart] Determines if the connection monitor - * will start automatically once created. - * - * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval - * in seconds. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Create or update a connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @param {object} parameters Parameters that define the operation to create a - * connection monitor. - * - * @param {string} [parameters.location] Connection monitor location. - * - * @param {object} [parameters.tags] Connection monitor tags. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource used as - * the source by connection monitor. - * - * @param {number} [parameters.source.port] The source port used by connection - * monitor. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * used as the destination by connection monitor. - * - * @param {string} [parameters.destination.address] Address of the connection - * monitor destination (IP or domain name). - * - * @param {number} [parameters.destination.port] The destination port used by - * connection monitor. - * - * @param {boolean} [parameters.autoStart] Determines if the connection monitor - * will start automatically once created. - * - * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval - * in seconds. - * - * @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 {ConnectionMonitorResult} - 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 ConnectionMonitorResult} 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. - */ - beginCreateOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, 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._beginCreateOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, options, optionalCallback); - } - } - - /** - * Deletes the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, networkWatcherName, connectionMonitorName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, networkWatcherName, connectionMonitorName, 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._beginDeleteMethod(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, networkWatcherName, connectionMonitorName, options, optionalCallback); - } - } - - /** - * Stops the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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. - */ - beginStopWithHttpOperationResponse(resourceGroupName, networkWatcherName, connectionMonitorName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginStop(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Stops the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginStop(resourceGroupName, networkWatcherName, connectionMonitorName, 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._beginStop(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginStop(resourceGroupName, networkWatcherName, connectionMonitorName, options, optionalCallback); - } - } - - /** - * Starts the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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. - */ - beginStartWithHttpOperationResponse(resourceGroupName, networkWatcherName, connectionMonitorName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginStart(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Starts the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginStart(resourceGroupName, networkWatcherName, connectionMonitorName, 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._beginStart(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginStart(resourceGroupName, networkWatcherName, connectionMonitorName, options, optionalCallback); - } - } - - /** - * Query a snapshot of the most recent connection states. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name given to the connection - * monitor. - * - * @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. - */ - beginQueryWithHttpOperationResponse(resourceGroupName, networkWatcherName, connectionMonitorName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginQuery(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Query a snapshot of the most recent connection states. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name given to the connection - * monitor. - * - * @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 {ConnectionMonitorQueryResult} - 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 ConnectionMonitorQueryResult} 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. - */ - beginQuery(resourceGroupName, networkWatcherName, connectionMonitorName, 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._beginQuery(resourceGroupName, networkWatcherName, connectionMonitorName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginQuery(resourceGroupName, networkWatcherName, connectionMonitorName, options, optionalCallback); - } - } - -} - -module.exports = ConnectionMonitors; diff --git a/lib/services/networkManagement2/lib/operations/ddosProtectionPlans.js b/lib/services/networkManagement2/lib/operations/ddosProtectionPlans.js deleted file mode 100644 index b042b7dd1..000000000 --- a/lib/services/networkManagement2/lib/operations/ddosProtectionPlans.js +++ /dev/null @@ -1,1952 +0,0 @@ -/* - * 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; - - -/** - * Deletes the specified DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, ddosProtectionPlanName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, ddosProtectionPlanName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets information about the specified DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. - * - * @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 DdosProtectionPlan} 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, ddosProtectionPlanName, 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-10-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 (ddosProtectionPlanName === null || ddosProtectionPlanName === undefined || typeof ddosProtectionPlanName.valueOf() !== 'string') { - throw new Error('ddosProtectionPlanName 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/ddosProtectionPlans/{ddosProtectionPlanName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{ddosProtectionPlanName}', encodeURIComponent(ddosProtectionPlanName)); - 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['DdosProtectionPlan']().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); - }); -} - - -/** - * Creates or updates a DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. - * - * @param {object} parameters Parameters supplied to the create or update - * operation. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 DdosProtectionPlan} 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 _createOrUpdate(resourceGroupName, ddosProtectionPlanName, parameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, ddosProtectionPlanName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DdosProtectionPlan']().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 DDoS protection plans in a subscription. - * - * @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 DdosProtectionPlanListResult} 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(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/ddosProtectionPlans'; - 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['DdosProtectionPlanListResult']().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 the DDoS protection plans in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 DdosProtectionPlanListResult} 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 _listByResourceGroup(resourceGroupName, 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-10-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 (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/ddosProtectionPlans'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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['DdosProtectionPlanListResult']().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); - }); -} - -/** - * Deletes the specified DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, ddosProtectionPlanName, 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-10-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 (ddosProtectionPlanName === null || ddosProtectionPlanName === undefined || typeof ddosProtectionPlanName.valueOf() !== 'string') { - throw new Error('ddosProtectionPlanName 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/ddosProtectionPlans/{ddosProtectionPlanName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{ddosProtectionPlanName}', encodeURIComponent(ddosProtectionPlanName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates a DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. - * - * @param {object} parameters Parameters supplied to the create or update - * operation. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 DdosProtectionPlan} 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 _beginCreateOrUpdate(resourceGroupName, ddosProtectionPlanName, parameters, 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-10-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 (ddosProtectionPlanName === null || ddosProtectionPlanName === undefined || typeof ddosProtectionPlanName.valueOf() !== 'string') { - throw new Error('ddosProtectionPlanName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/ddosProtectionPlans/{ddosProtectionPlanName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{ddosProtectionPlanName}', encodeURIComponent(ddosProtectionPlanName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['DdosProtectionPlan']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['DdosProtectionPlan']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DdosProtectionPlan']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Gets all DDoS protection plans in a subscription. - * - * @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 DdosProtectionPlanListResult} 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['DdosProtectionPlanListResult']().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 the DDoS protection plans in a resource group. - * - * @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 DdosProtectionPlanListResult} 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 _listByResourceGroupNext(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['DdosProtectionPlanListResult']().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 DdosProtectionPlans. */ -class DdosProtectionPlans { - /** - * Create a DdosProtectionPlans. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._list = _list; - this._listByResourceGroup = _listByResourceGroup; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._listNext = _listNext; - this._listByResourceGroupNext = _listByResourceGroupNext; - } - - /** - * Deletes the specified DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, ddosProtectionPlanName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, ddosProtectionPlanName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, ddosProtectionPlanName, 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._deleteMethod(resourceGroupName, ddosProtectionPlanName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, ddosProtectionPlanName, options, optionalCallback); - } - } - - /** - * Gets information about the specified DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. - * - * @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, ddosProtectionPlanName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, ddosProtectionPlanName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets information about the specified DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. - * - * @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 {DdosProtectionPlan} - 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 DdosProtectionPlan} 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, ddosProtectionPlanName, 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, ddosProtectionPlanName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, ddosProtectionPlanName, options, optionalCallback); - } - } - - /** - * Creates or updates a DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. - * - * @param {object} parameters Parameters supplied to the create or update - * operation. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, ddosProtectionPlanName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, ddosProtectionPlanName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. - * - * @param {object} parameters Parameters supplied to the create or update - * operation. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {DdosProtectionPlan} - 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 DdosProtectionPlan} 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. - */ - createOrUpdate(resourceGroupName, ddosProtectionPlanName, parameters, 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._createOrUpdate(resourceGroupName, ddosProtectionPlanName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, ddosProtectionPlanName, parameters, options, optionalCallback); - } - } - - /** - * Gets all DDoS protection plans in a subscription. - * - * @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(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(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 DDoS protection plans in a subscription. - * - * @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 {DdosProtectionPlanListResult} - 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 DdosProtectionPlanListResult} 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(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(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(options, optionalCallback); - } - } - - /** - * Gets all the DDoS protection plans in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, 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 the DDoS protection plans in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {DdosProtectionPlanListResult} - 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 DdosProtectionPlanListResult} 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. - */ - listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroup(resourceGroupName, options, optionalCallback); - } - } - - /** - * Deletes the specified DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, ddosProtectionPlanName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, ddosProtectionPlanName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, ddosProtectionPlanName, 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._beginDeleteMethod(resourceGroupName, ddosProtectionPlanName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, ddosProtectionPlanName, options, optionalCallback); - } - } - - /** - * Creates or updates a DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. - * - * @param {object} parameters Parameters supplied to the create or update - * operation. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, ddosProtectionPlanName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, ddosProtectionPlanName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. - * - * @param {object} parameters Parameters supplied to the create or update - * operation. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {DdosProtectionPlan} - 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 DdosProtectionPlan} 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. - */ - beginCreateOrUpdate(resourceGroupName, ddosProtectionPlanName, parameters, 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._beginCreateOrUpdate(resourceGroupName, ddosProtectionPlanName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, ddosProtectionPlanName, parameters, options, optionalCallback); - } - } - - /** - * Gets all DDoS protection plans in a subscription. - * - * @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 DDoS protection plans in a subscription. - * - * @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 {DdosProtectionPlanListResult} - 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 DdosProtectionPlanListResult} 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); - } - } - - /** - * Gets all the DDoS protection plans in a resource group. - * - * @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. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroupNext(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 the DDoS protection plans in a resource group. - * - * @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 {DdosProtectionPlanListResult} - 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 DdosProtectionPlanListResult} 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. - */ - listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = DdosProtectionPlans; diff --git a/lib/services/networkManagement2/lib/operations/defaultSecurityRules.js b/lib/services/networkManagement2/lib/operations/defaultSecurityRules.js deleted file mode 100644 index bdde507af..000000000 --- a/lib/services/networkManagement2/lib/operations/defaultSecurityRules.js +++ /dev/null @@ -1,724 +0,0 @@ -/* - * 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 all default security rules in a network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @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 SecurityRuleListResult} 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, networkSecurityGroupName, 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-10-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 (networkSecurityGroupName === null || networkSecurityGroupName === undefined || typeof networkSecurityGroupName.valueOf() !== 'string') { - throw new Error('networkSecurityGroupName 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/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkSecurityGroupName}', encodeURIComponent(networkSecurityGroupName)); - 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['SecurityRuleListResult']().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); - }); -} - -/** - * Get the specified default network security rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} defaultSecurityRuleName The name of the default security - * rule. - * - * @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 SecurityRule} 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, networkSecurityGroupName, defaultSecurityRuleName, 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-10-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 (networkSecurityGroupName === null || networkSecurityGroupName === undefined || typeof networkSecurityGroupName.valueOf() !== 'string') { - throw new Error('networkSecurityGroupName cannot be null or undefined and it must be of type string.'); - } - if (defaultSecurityRuleName === null || defaultSecurityRuleName === undefined || typeof defaultSecurityRuleName.valueOf() !== 'string') { - throw new Error('defaultSecurityRuleName 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/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkSecurityGroupName}', encodeURIComponent(networkSecurityGroupName)); - requestUrl = requestUrl.replace('{defaultSecurityRuleName}', encodeURIComponent(defaultSecurityRuleName)); - 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['SecurityRule']().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 default security rules in a network security group. - * - * @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 SecurityRuleListResult} 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['SecurityRuleListResult']().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 DefaultSecurityRules. */ -class DefaultSecurityRules { - /** - * Create a DefaultSecurityRules. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._list = _list; - this._get = _get; - this._listNext = _listNext; - } - - /** - * Gets all default security rules in a network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @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, networkSecurityGroupName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, networkSecurityGroupName, 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 default security rules in a network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @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 {SecurityRuleListResult} - 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 SecurityRuleListResult} 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, networkSecurityGroupName, 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, networkSecurityGroupName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, networkSecurityGroupName, options, optionalCallback); - } - } - - /** - * Get the specified default network security rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} defaultSecurityRuleName The name of the default security - * rule. - * - * @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, networkSecurityGroupName, defaultSecurityRuleName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Get the specified default network security rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} defaultSecurityRuleName The name of the default security - * rule. - * - * @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 {SecurityRule} - 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 SecurityRule} 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, networkSecurityGroupName, defaultSecurityRuleName, 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, networkSecurityGroupName, defaultSecurityRuleName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName, options, optionalCallback); - } - } - - /** - * Gets all default security rules in a network security group. - * - * @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 default security rules in a network security group. - * - * @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 {SecurityRuleListResult} - 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 SecurityRuleListResult} 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 = DefaultSecurityRules; diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCircuitAuthorizations.js b/lib/services/networkManagement2/lib/operations/expressRouteCircuitAuthorizations.js deleted file mode 100644 index 183d5b846..000000000 --- a/lib/services/networkManagement2/lib/operations/expressRouteCircuitAuthorizations.js +++ /dev/null @@ -1,1668 +0,0 @@ -/* - * 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; - - -/** - * Deletes the specified authorization 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} authorizationName The name of the authorization. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, circuitName, authorizationName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, circuitName, authorizationName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets the specified authorization 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} authorizationName The name of the authorization. - * - * @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 ExpressRouteCircuitAuthorization} 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, authorizationName, 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-10-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 (authorizationName === null || authorizationName === undefined || typeof authorizationName.valueOf() !== 'string') { - throw new Error('authorizationName 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}/authorizations/{authorizationName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); - requestUrl = requestUrl.replace('{authorizationName}', encodeURIComponent(authorizationName)); - 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['ExpressRouteCircuitAuthorization']().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); - }); -} - - -/** - * Creates or updates an authorization in 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} authorizationName The name of the authorization. - * - * @param {object} authorizationParameters Parameters supplied to the create or - * update express route circuit authorization operation. - * - * @param {string} [authorizationParameters.authorizationKey] The authorization - * key. - * - * @param {string} [authorizationParameters.authorizationUseStatus] - * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. - * Possible values include: 'Available', 'InUse' - * - * @param {string} [authorizationParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [authorizationParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [authorizationParameters.id] Resource ID. - * - * @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 ExpressRouteCircuitAuthorization} 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 _createOrUpdate(resourceGroupName, circuitName, authorizationName, authorizationParameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, circuitName, authorizationName, authorizationParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ExpressRouteCircuitAuthorization']().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 authorizations in an express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the circuit. - * - * @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 AuthorizationListResult} 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, 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-10-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 (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}/authorizations'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); - 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['AuthorizationListResult']().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); - }); -} - -/** - * Deletes the specified authorization 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} authorizationName The name of the authorization. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, circuitName, authorizationName, 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-10-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 (authorizationName === null || authorizationName === undefined || typeof authorizationName.valueOf() !== 'string') { - throw new Error('authorizationName 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}/authorizations/{authorizationName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); - requestUrl = requestUrl.replace('{authorizationName}', encodeURIComponent(authorizationName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates an authorization in 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} authorizationName The name of the authorization. - * - * @param {object} authorizationParameters Parameters supplied to the create or - * update express route circuit authorization operation. - * - * @param {string} [authorizationParameters.authorizationKey] The authorization - * key. - * - * @param {string} [authorizationParameters.authorizationUseStatus] - * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. - * Possible values include: 'Available', 'InUse' - * - * @param {string} [authorizationParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [authorizationParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [authorizationParameters.id] Resource ID. - * - * @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 ExpressRouteCircuitAuthorization} 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 _beginCreateOrUpdate(resourceGroupName, circuitName, authorizationName, authorizationParameters, 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-10-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 (authorizationName === null || authorizationName === undefined || typeof authorizationName.valueOf() !== 'string') { - throw new Error('authorizationName cannot be null or undefined and it must be of type string.'); - } - if (authorizationParameters === null || authorizationParameters === undefined) { - throw new Error('authorizationParameters cannot be null or undefined.'); - } - 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}/authorizations/{authorizationName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); - requestUrl = requestUrl.replace('{authorizationName}', encodeURIComponent(authorizationName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (authorizationParameters !== null && authorizationParameters !== undefined) { - let requestModelMapper = new client.models['ExpressRouteCircuitAuthorization']().mapper(); - requestModel = client.serialize(requestModelMapper, authorizationParameters, 'authorizationParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(authorizationParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['ExpressRouteCircuitAuthorization']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ExpressRouteCircuitAuthorization']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Gets all authorizations 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 AuthorizationListResult} 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['AuthorizationListResult']().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 ExpressRouteCircuitAuthorizations. */ -class ExpressRouteCircuitAuthorizations { - /** - * Create a ExpressRouteCircuitAuthorizations. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._list = _list; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._listNext = _listNext; - } - - /** - * Deletes the specified authorization 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} authorizationName The name of the authorization. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, circuitName, authorizationName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, circuitName, authorizationName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified authorization 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} authorizationName The name of the authorization. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, circuitName, authorizationName, 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._deleteMethod(resourceGroupName, circuitName, authorizationName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, circuitName, authorizationName, options, optionalCallback); - } - } - - /** - * Gets the specified authorization 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} authorizationName The name of the authorization. - * - * @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, authorizationName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, circuitName, authorizationName, 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 authorization 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} authorizationName The name of the authorization. - * - * @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 {ExpressRouteCircuitAuthorization} - 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 ExpressRouteCircuitAuthorization} 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, authorizationName, 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, authorizationName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, circuitName, authorizationName, options, optionalCallback); - } - } - - /** - * Creates or updates an authorization in 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} authorizationName The name of the authorization. - * - * @param {object} authorizationParameters Parameters supplied to the create or - * update express route circuit authorization operation. - * - * @param {string} [authorizationParameters.authorizationKey] The authorization - * key. - * - * @param {string} [authorizationParameters.authorizationUseStatus] - * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. - * Possible values include: 'Available', 'InUse' - * - * @param {string} [authorizationParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [authorizationParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [authorizationParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, circuitName, authorizationName, authorizationParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, circuitName, authorizationName, authorizationParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates an authorization in 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} authorizationName The name of the authorization. - * - * @param {object} authorizationParameters Parameters supplied to the create or - * update express route circuit authorization operation. - * - * @param {string} [authorizationParameters.authorizationKey] The authorization - * key. - * - * @param {string} [authorizationParameters.authorizationUseStatus] - * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. - * Possible values include: 'Available', 'InUse' - * - * @param {string} [authorizationParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [authorizationParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [authorizationParameters.id] Resource ID. - * - * @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 {ExpressRouteCircuitAuthorization} - 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 ExpressRouteCircuitAuthorization} 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. - */ - createOrUpdate(resourceGroupName, circuitName, authorizationName, authorizationParameters, 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._createOrUpdate(resourceGroupName, circuitName, authorizationName, authorizationParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, circuitName, authorizationName, authorizationParameters, options, optionalCallback); - } - } - - /** - * Gets all authorizations in an express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the circuit. - * - * @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, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, circuitName, 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 authorizations in an express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the circuit. - * - * @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 {AuthorizationListResult} - 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 AuthorizationListResult} 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, 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, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, circuitName, options, optionalCallback); - } - } - - /** - * Deletes the specified authorization 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} authorizationName The name of the authorization. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, circuitName, authorizationName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, circuitName, authorizationName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified authorization 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} authorizationName The name of the authorization. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, circuitName, authorizationName, 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._beginDeleteMethod(resourceGroupName, circuitName, authorizationName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, circuitName, authorizationName, options, optionalCallback); - } - } - - /** - * Creates or updates an authorization in 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} authorizationName The name of the authorization. - * - * @param {object} authorizationParameters Parameters supplied to the create or - * update express route circuit authorization operation. - * - * @param {string} [authorizationParameters.authorizationKey] The authorization - * key. - * - * @param {string} [authorizationParameters.authorizationUseStatus] - * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. - * Possible values include: 'Available', 'InUse' - * - * @param {string} [authorizationParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [authorizationParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [authorizationParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, circuitName, authorizationName, authorizationParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, circuitName, authorizationName, authorizationParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates an authorization in 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} authorizationName The name of the authorization. - * - * @param {object} authorizationParameters Parameters supplied to the create or - * update express route circuit authorization operation. - * - * @param {string} [authorizationParameters.authorizationKey] The authorization - * key. - * - * @param {string} [authorizationParameters.authorizationUseStatus] - * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. - * Possible values include: 'Available', 'InUse' - * - * @param {string} [authorizationParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [authorizationParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [authorizationParameters.id] Resource ID. - * - * @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 {ExpressRouteCircuitAuthorization} - 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 ExpressRouteCircuitAuthorization} 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. - */ - beginCreateOrUpdate(resourceGroupName, circuitName, authorizationName, authorizationParameters, 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._beginCreateOrUpdate(resourceGroupName, circuitName, authorizationName, authorizationParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, circuitName, authorizationName, authorizationParameters, options, optionalCallback); - } - } - - /** - * Gets all authorizations 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 authorizations 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 {AuthorizationListResult} - 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 AuthorizationListResult} 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 = ExpressRouteCircuitAuthorizations; diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCircuitConnections.js b/lib/services/networkManagement2/lib/operations/expressRouteCircuitConnections.js deleted file mode 100644 index b11d32d6d..000000000 --- a/lib/services/networkManagement2/lib/operations/expressRouteCircuitConnections.js +++ /dev/null @@ -1,1804 +0,0 @@ -/* - * 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; - - -/** - * Deletes the specified 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 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, circuitName, peeringName, connectionName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets the specified 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 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 ExpressRouteCircuitConnection} 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-10-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}/connections/{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['ExpressRouteCircuitConnection']().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); - }); -} - - -/** - * Creates or updates a Express Route Circuit Connection in the specified - * express route circuits. - * - * @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 express route circuit - * connection. - * - * @param {object} expressRouteCircuitConnectionParameters Parameters supplied - * to the create or update express route circuit circuit connection operation. - * - * @param {object} - * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the circuit - * initiating connection. - * - * @param {object} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the peered - * circuit. - * - * @param {string} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] - * Resource ID. - * - * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 - * IP address space to carve out Customer addresses for tunnels. - * - * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] - * The authorization key. - * - * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. - * - * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. - * - * @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 ExpressRouteCircuitConnection} 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 _createOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ExpressRouteCircuitConnection']().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 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 ExpressRouteCircuitConnectionListResult} 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-10-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}/connections'; - 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['ExpressRouteCircuitConnectionListResult']().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); - }); -} - -/** - * Deletes the specified 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 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(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-10-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}/connections/{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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates a Express Route Circuit Connection in the specified - * express route circuits. - * - * @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 express route circuit - * connection. - * - * @param {object} expressRouteCircuitConnectionParameters Parameters supplied - * to the create or update express route circuit circuit connection operation. - * - * @param {object} - * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the circuit - * initiating connection. - * - * @param {object} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the peered - * circuit. - * - * @param {string} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] - * Resource ID. - * - * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 - * IP address space to carve out Customer addresses for tunnels. - * - * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] - * The authorization key. - * - * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. - * - * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. - * - * @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 ExpressRouteCircuitConnection} 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 _beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, 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-10-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 (expressRouteCircuitConnectionParameters === null || expressRouteCircuitConnectionParameters === undefined) { - throw new Error('expressRouteCircuitConnectionParameters cannot be null or undefined.'); - } - 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}/connections/{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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (expressRouteCircuitConnectionParameters !== null && expressRouteCircuitConnectionParameters !== undefined) { - let requestModelMapper = new client.models['ExpressRouteCircuitConnection']().mapper(); - requestModel = client.serialize(requestModelMapper, expressRouteCircuitConnectionParameters, 'expressRouteCircuitConnectionParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(expressRouteCircuitConnectionParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['ExpressRouteCircuitConnection']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ExpressRouteCircuitConnection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Gets all global reach 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 ExpressRouteCircuitConnectionListResult} 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['ExpressRouteCircuitConnectionListResult']().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 ExpressRouteCircuitConnections. */ -class ExpressRouteCircuitConnections { - /** - * Create a ExpressRouteCircuitConnections. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._list = _list; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._listNext = _listNext; - } - - /** - * Deletes the specified 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 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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, connectionName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(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; - }); - }); - } - - /** - * Deletes the specified 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 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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(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._deleteMethod(resourceGroupName, circuitName, peeringName, connectionName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, circuitName, peeringName, connectionName, options, optionalCallback); - } - } - - /** - * Gets the specified 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 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 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 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 {ExpressRouteCircuitConnection} - 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 ExpressRouteCircuitConnection} 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); - } - } - - /** - * Creates or updates a Express Route Circuit Connection in the specified - * express route circuits. - * - * @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 express route circuit - * connection. - * - * @param {object} expressRouteCircuitConnectionParameters Parameters supplied - * to the create or update express route circuit circuit connection operation. - * - * @param {object} - * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the circuit - * initiating connection. - * - * @param {object} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the peered - * circuit. - * - * @param {string} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] - * Resource ID. - * - * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 - * IP address space to carve out Customer addresses for tunnels. - * - * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] - * The authorization key. - * - * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. - * - * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a Express Route Circuit Connection in the specified - * express route circuits. - * - * @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 express route circuit - * connection. - * - * @param {object} expressRouteCircuitConnectionParameters Parameters supplied - * to the create or update express route circuit circuit connection operation. - * - * @param {object} - * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the circuit - * initiating connection. - * - * @param {object} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the peered - * circuit. - * - * @param {string} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] - * Resource ID. - * - * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 - * IP address space to carve out Customer addresses for tunnels. - * - * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] - * The authorization key. - * - * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. - * - * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. - * - * @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 {ExpressRouteCircuitConnection} - 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 ExpressRouteCircuitConnection} 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. - */ - createOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, 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._createOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, options, optionalCallback); - } - } - - /** - * Gets all global reach 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 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 {ExpressRouteCircuitConnectionListResult} - 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 ExpressRouteCircuitConnectionListResult} 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); - } - } - - /** - * Deletes the specified 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 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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, connectionName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(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; - }); - }); - } - - /** - * Deletes the specified 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 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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(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._beginDeleteMethod(resourceGroupName, circuitName, peeringName, connectionName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, circuitName, peeringName, connectionName, options, optionalCallback); - } - } - - /** - * Creates or updates a Express Route Circuit Connection in the specified - * express route circuits. - * - * @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 express route circuit - * connection. - * - * @param {object} expressRouteCircuitConnectionParameters Parameters supplied - * to the create or update express route circuit circuit connection operation. - * - * @param {object} - * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the circuit - * initiating connection. - * - * @param {object} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the peered - * circuit. - * - * @param {string} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] - * Resource ID. - * - * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 - * IP address space to carve out Customer addresses for tunnels. - * - * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] - * The authorization key. - * - * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. - * - * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a Express Route Circuit Connection in the specified - * express route circuits. - * - * @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 express route circuit - * connection. - * - * @param {object} expressRouteCircuitConnectionParameters Parameters supplied - * to the create or update express route circuit circuit connection operation. - * - * @param {object} - * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the circuit - * initiating connection. - * - * @param {object} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the peered - * circuit. - * - * @param {string} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] - * Resource ID. - * - * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 - * IP address space to carve out Customer addresses for tunnels. - * - * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] - * The authorization key. - * - * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. - * - * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. - * - * @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 {ExpressRouteCircuitConnection} - 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 ExpressRouteCircuitConnection} 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. - */ - beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, 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._beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters, options, optionalCallback); - } - } - - /** - * Gets all global reach 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 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 {ExpressRouteCircuitConnectionListResult} - 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 ExpressRouteCircuitConnectionListResult} 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 = ExpressRouteCircuitConnections; diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCircuitPeerings.js b/lib/services/networkManagement2/lib/operations/expressRouteCircuitPeerings.js deleted file mode 100644 index 1dd8a495d..000000000 --- a/lib/services/networkManagement2/lib/operations/expressRouteCircuitPeerings.js +++ /dev/null @@ -1,2340 +0,0 @@ -/* - * 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; - - -/** - * Deletes the specified peering 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 {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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, circuitName, peeringName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets the specified peering for the 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 {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 ExpressRouteCircuitPeering} 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, 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-10-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}'; - 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['ExpressRouteCircuitPeering']().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); - }); -} - - -/** - * Creates or updates a peering in the specified express route circuits. - * - * @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 {object} peeringParameters Parameters supplied to the create or - * update express route circuit peering operation. - * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' - * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {number} [peeringParameters.azureASN] The Azure ASN. - * - * @param {number} [peeringParameters.peerASN] The peer ASN. - * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. - * - * @param {string} [peeringParameters.primaryAzurePort] The primary port. - * - * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. - * - * @param {string} [peeringParameters.sharedKey] The shared key. - * - * @param {number} [peeringParameters.vlanId] The VLAN ID. - * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. - * - * @param {object} [peeringParameters.stats] Gets peering stats. - * - * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the - * peering. - * - * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of - * the peering. - * - * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of - * the peering. - * - * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of - * the peering. - * - * @param {string} [peeringParameters.provisioningState] Gets the provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager - * Etag. - * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. - * - * @param {object} [peeringParameters.routeFilter] The reference of the - * RouteFilter resource. - * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {object} [peeringParameters.expressRouteConnection] The ExpressRoute - * connection. - * - * @param {array} [peeringParameters.connections] The list of circuit - * connections associated with Azure Private Peering for this circuit. - * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [peeringParameters.id] Resource ID. - * - * @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 ExpressRouteCircuitPeering} 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 _createOrUpdate(resourceGroupName, circuitName, peeringName, peeringParameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, peeringParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ExpressRouteCircuitPeering']().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 peerings in a specified express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the express route circuit. - * - * @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 ExpressRouteCircuitPeeringListResult} 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, 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-10-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 (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'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); - 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['ExpressRouteCircuitPeeringListResult']().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); - }); -} - -/** - * Deletes the specified peering 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 {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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(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-10-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}'; - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates a peering in the specified express route circuits. - * - * @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 {object} peeringParameters Parameters supplied to the create or - * update express route circuit peering operation. - * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' - * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {number} [peeringParameters.azureASN] The Azure ASN. - * - * @param {number} [peeringParameters.peerASN] The peer ASN. - * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. - * - * @param {string} [peeringParameters.primaryAzurePort] The primary port. - * - * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. - * - * @param {string} [peeringParameters.sharedKey] The shared key. - * - * @param {number} [peeringParameters.vlanId] The VLAN ID. - * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. - * - * @param {object} [peeringParameters.stats] Gets peering stats. - * - * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the - * peering. - * - * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of - * the peering. - * - * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of - * the peering. - * - * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of - * the peering. - * - * @param {string} [peeringParameters.provisioningState] Gets the provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager - * Etag. - * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. - * - * @param {object} [peeringParameters.routeFilter] The reference of the - * RouteFilter resource. - * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {object} [peeringParameters.expressRouteConnection] The ExpressRoute - * connection. - * - * @param {array} [peeringParameters.connections] The list of circuit - * connections associated with Azure Private Peering for this circuit. - * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [peeringParameters.id] Resource ID. - * - * @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 ExpressRouteCircuitPeering} 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 _beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, peeringParameters, 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-10-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 (peeringParameters === null || peeringParameters === undefined) { - throw new Error('peeringParameters cannot be null or undefined.'); - } - 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}'; - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (peeringParameters !== null && peeringParameters !== undefined) { - let requestModelMapper = new client.models['ExpressRouteCircuitPeering']().mapper(); - requestModel = client.serialize(requestModelMapper, peeringParameters, 'peeringParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(peeringParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['ExpressRouteCircuitPeering']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ExpressRouteCircuitPeering']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Gets all peerings in a specified 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 ExpressRouteCircuitPeeringListResult} 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['ExpressRouteCircuitPeeringListResult']().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 ExpressRouteCircuitPeerings. */ -class ExpressRouteCircuitPeerings { - /** - * Create a ExpressRouteCircuitPeerings. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._list = _list; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._listNext = _listNext; - } - - /** - * Deletes the specified peering 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 {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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(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; - }); - }); - } - - /** - * Deletes the specified peering 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 {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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(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._deleteMethod(resourceGroupName, circuitName, peeringName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, circuitName, peeringName, options, optionalCallback); - } - } - - /** - * Gets the specified peering for the 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 {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, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(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 the specified peering for the 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 {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 {ExpressRouteCircuitPeering} - 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 ExpressRouteCircuitPeering} 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, 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, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, circuitName, peeringName, options, optionalCallback); - } - } - - /** - * Creates or updates a peering in the specified express route circuits. - * - * @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 {object} peeringParameters Parameters supplied to the create or - * update express route circuit peering operation. - * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' - * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {number} [peeringParameters.azureASN] The Azure ASN. - * - * @param {number} [peeringParameters.peerASN] The peer ASN. - * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. - * - * @param {string} [peeringParameters.primaryAzurePort] The primary port. - * - * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. - * - * @param {string} [peeringParameters.sharedKey] The shared key. - * - * @param {number} [peeringParameters.vlanId] The VLAN ID. - * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. - * - * @param {object} [peeringParameters.stats] Gets peering stats. - * - * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the - * peering. - * - * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of - * the peering. - * - * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of - * the peering. - * - * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of - * the peering. - * - * @param {string} [peeringParameters.provisioningState] Gets the provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager - * Etag. - * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. - * - * @param {object} [peeringParameters.routeFilter] The reference of the - * RouteFilter resource. - * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {object} [peeringParameters.expressRouteConnection] The ExpressRoute - * connection. - * - * @param {array} [peeringParameters.connections] The list of circuit - * connections associated with Azure Private Peering for this circuit. - * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [peeringParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, peeringParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, circuitName, peeringName, peeringParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a peering in the specified express route circuits. - * - * @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 {object} peeringParameters Parameters supplied to the create or - * update express route circuit peering operation. - * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' - * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {number} [peeringParameters.azureASN] The Azure ASN. - * - * @param {number} [peeringParameters.peerASN] The peer ASN. - * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. - * - * @param {string} [peeringParameters.primaryAzurePort] The primary port. - * - * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. - * - * @param {string} [peeringParameters.sharedKey] The shared key. - * - * @param {number} [peeringParameters.vlanId] The VLAN ID. - * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. - * - * @param {object} [peeringParameters.stats] Gets peering stats. - * - * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the - * peering. - * - * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of - * the peering. - * - * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of - * the peering. - * - * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of - * the peering. - * - * @param {string} [peeringParameters.provisioningState] Gets the provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager - * Etag. - * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. - * - * @param {object} [peeringParameters.routeFilter] The reference of the - * RouteFilter resource. - * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {object} [peeringParameters.expressRouteConnection] The ExpressRoute - * connection. - * - * @param {array} [peeringParameters.connections] The list of circuit - * connections associated with Azure Private Peering for this circuit. - * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [peeringParameters.id] Resource ID. - * - * @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 {ExpressRouteCircuitPeering} - 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 ExpressRouteCircuitPeering} 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. - */ - createOrUpdate(resourceGroupName, circuitName, peeringName, peeringParameters, 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._createOrUpdate(resourceGroupName, circuitName, peeringName, peeringParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, circuitName, peeringName, peeringParameters, options, optionalCallback); - } - } - - /** - * Gets all peerings in a specified express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the express route circuit. - * - * @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, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, circuitName, 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 peerings in a specified express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the express route circuit. - * - * @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 {ExpressRouteCircuitPeeringListResult} - 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 ExpressRouteCircuitPeeringListResult} 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, 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, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, circuitName, options, optionalCallback); - } - } - - /** - * Deletes the specified peering 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 {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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(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; - }); - }); - } - - /** - * Deletes the specified peering 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 {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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(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._beginDeleteMethod(resourceGroupName, circuitName, peeringName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, circuitName, peeringName, options, optionalCallback); - } - } - - /** - * Creates or updates a peering in the specified express route circuits. - * - * @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 {object} peeringParameters Parameters supplied to the create or - * update express route circuit peering operation. - * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' - * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {number} [peeringParameters.azureASN] The Azure ASN. - * - * @param {number} [peeringParameters.peerASN] The peer ASN. - * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. - * - * @param {string} [peeringParameters.primaryAzurePort] The primary port. - * - * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. - * - * @param {string} [peeringParameters.sharedKey] The shared key. - * - * @param {number} [peeringParameters.vlanId] The VLAN ID. - * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. - * - * @param {object} [peeringParameters.stats] Gets peering stats. - * - * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the - * peering. - * - * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of - * the peering. - * - * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of - * the peering. - * - * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of - * the peering. - * - * @param {string} [peeringParameters.provisioningState] Gets the provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager - * Etag. - * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. - * - * @param {object} [peeringParameters.routeFilter] The reference of the - * RouteFilter resource. - * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {object} [peeringParameters.expressRouteConnection] The ExpressRoute - * connection. - * - * @param {array} [peeringParameters.connections] The list of circuit - * connections associated with Azure Private Peering for this circuit. - * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [peeringParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, peeringParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, peeringParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a peering in the specified express route circuits. - * - * @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 {object} peeringParameters Parameters supplied to the create or - * update express route circuit peering operation. - * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' - * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {number} [peeringParameters.azureASN] The Azure ASN. - * - * @param {number} [peeringParameters.peerASN] The peer ASN. - * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. - * - * @param {string} [peeringParameters.primaryAzurePort] The primary port. - * - * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. - * - * @param {string} [peeringParameters.sharedKey] The shared key. - * - * @param {number} [peeringParameters.vlanId] The VLAN ID. - * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. - * - * @param {object} [peeringParameters.stats] Gets peering stats. - * - * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the - * peering. - * - * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of - * the peering. - * - * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of - * the peering. - * - * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of - * the peering. - * - * @param {string} [peeringParameters.provisioningState] Gets the provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager - * Etag. - * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. - * - * @param {object} [peeringParameters.routeFilter] The reference of the - * RouteFilter resource. - * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {object} [peeringParameters.expressRouteConnection] The ExpressRoute - * connection. - * - * @param {array} [peeringParameters.connections] The list of circuit - * connections associated with Azure Private Peering for this circuit. - * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [peeringParameters.id] Resource ID. - * - * @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 {ExpressRouteCircuitPeering} - 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 ExpressRouteCircuitPeering} 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. - */ - beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, peeringParameters, 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._beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, peeringParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, circuitName, peeringName, peeringParameters, options, optionalCallback); - } - } - - /** - * Gets all peerings in a specified 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 peerings in a specified 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 {ExpressRouteCircuitPeeringListResult} - 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 ExpressRouteCircuitPeeringListResult} 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 = ExpressRouteCircuitPeerings; diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCircuits.js b/lib/services/networkManagement2/lib/operations/expressRouteCircuits.js deleted file mode 100644 index c33b5478e..000000000 --- a/lib/services/networkManagement2/lib/operations/expressRouteCircuits.js +++ /dev/null @@ -1,4567 +0,0 @@ -/* - * 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; - - -/** - * Deletes 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 {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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, circuitName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, circuitName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets information about the specified express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of express route circuit. - * - * @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 ExpressRouteCircuit} 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, 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-10-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 (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}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); - 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['ExpressRouteCircuit']().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); - }); -} - - -/** - * Creates or updates an express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the circuit. - * - * @param {object} parameters Parameters supplied to the create or update - * express route circuit operation. - * - * @param {object} [parameters.sku] The SKU. - * - * @param {string} [parameters.sku.name] The name of the SKU. - * - * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values - * are 'Standard', 'Premium' or 'Basic'. Possible values include: 'Standard', - * 'Premium', 'Basic' - * - * @param {string} [parameters.sku.family] The family of the SKU. Possible - * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: - * 'UnlimitedData', 'MeteredData' - * - * @param {boolean} [parameters.allowClassicOperations] Allow classic - * operations - * - * @param {string} [parameters.circuitProvisioningState] The - * CircuitProvisioningState state of the resource. - * - * @param {string} [parameters.serviceProviderProvisioningState] The - * ServiceProviderProvisioningState state of the resource. Possible values are - * 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' - * - * @param {array} [parameters.authorizations] The list of authorizations. - * - * @param {array} [parameters.peerings] The list of peerings. - * - * @param {string} [parameters.serviceKey] The ServiceKey. - * - * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. - * - * @param {object} [parameters.serviceProviderProperties] The - * ServiceProviderProperties. - * - * @param {string} [parameters.serviceProviderProperties.serviceProviderName] - * The serviceProviderName. - * - * @param {string} [parameters.serviceProviderProperties.peeringLocation] The - * peering location. - * - * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The - * BandwidthInMbps. - * - * @param {object} [parameters.expressRoutePort] The reference to the - * ExpressRoutePort resource when the circuit is provisioned on an - * ExpressRoutePort resource. - * - * @param {string} [parameters.expressRoutePort.id] Resource ID. - * - * @param {number} [parameters.bandwidthInGbps] The bandwidth of the circuit - * when the circuit is provisioned on an ExpressRoutePort resource. - * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. - * - * @param {boolean} [parameters.allowGlobalReach] Flag to enable Global Reach - * on the circuit. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 ExpressRouteCircuit} 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 _createOrUpdate(resourceGroupName, circuitName, parameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, circuitName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ExpressRouteCircuit']().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); - }); - }); -} - - -/** - * Updates an express route circuit tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the circuit. - * - * @param {object} parameters Parameters supplied to update express route - * circuit tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 ExpressRouteCircuit} 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 _updateTags(resourceGroupName, circuitName, parameters, 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.'); - } - - // Send request - this.beginUpdateTags(resourceGroupName, circuitName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ExpressRouteCircuit']().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 the currently advertised ARP table associated with the express route - * circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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 ExpressRouteCircuitsArpTableListResult} 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 _listArpTable(resourceGroupName, circuitName, peeringName, devicePath, 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.'); - } - - // Send request - this.beginListArpTable(resourceGroupName, circuitName, peeringName, devicePath, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ExpressRouteCircuitsArpTableListResult']().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 the currently advertised routes table associated with the express route - * circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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 ExpressRouteCircuitsRoutesTableListResult} - * 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 _listRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, 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.'); - } - - // Send request - this.beginListRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ExpressRouteCircuitsRoutesTableListResult']().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 the currently advertised routes table summary associated with the - * express route circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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 - * ExpressRouteCircuitsRoutesTableSummaryListResult} 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 _listRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, 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.'); - } - - // Send request - this.beginListRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ExpressRouteCircuitsRoutesTableSummaryListResult']().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 the stats from an express route circuit in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the express route circuit. - * - * @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 ExpressRouteCircuitStats} 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 _getStats(resourceGroupName, circuitName, 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-10-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 (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}/stats'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); - 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['ExpressRouteCircuitStats']().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 stats from an express route circuit in a resource group. - * - * @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 {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 ExpressRouteCircuitStats} 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 _getPeeringStats(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-10-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}/stats'; - 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['ExpressRouteCircuitStats']().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 the express route circuits in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 ExpressRouteCircuitListResult} 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, 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-10-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 (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'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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['ExpressRouteCircuitListResult']().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 the express route circuits in a subscription. - * - * @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 ExpressRouteCircuitListResult} 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 _listAll(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/expressRouteCircuits'; - 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['ExpressRouteCircuitListResult']().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); - }); -} - -/** - * Deletes 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 {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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, circuitName, 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-10-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 (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}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates an express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the circuit. - * - * @param {object} parameters Parameters supplied to the create or update - * express route circuit operation. - * - * @param {object} [parameters.sku] The SKU. - * - * @param {string} [parameters.sku.name] The name of the SKU. - * - * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values - * are 'Standard', 'Premium' or 'Basic'. Possible values include: 'Standard', - * 'Premium', 'Basic' - * - * @param {string} [parameters.sku.family] The family of the SKU. Possible - * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: - * 'UnlimitedData', 'MeteredData' - * - * @param {boolean} [parameters.allowClassicOperations] Allow classic - * operations - * - * @param {string} [parameters.circuitProvisioningState] The - * CircuitProvisioningState state of the resource. - * - * @param {string} [parameters.serviceProviderProvisioningState] The - * ServiceProviderProvisioningState state of the resource. Possible values are - * 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' - * - * @param {array} [parameters.authorizations] The list of authorizations. - * - * @param {array} [parameters.peerings] The list of peerings. - * - * @param {string} [parameters.serviceKey] The ServiceKey. - * - * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. - * - * @param {object} [parameters.serviceProviderProperties] The - * ServiceProviderProperties. - * - * @param {string} [parameters.serviceProviderProperties.serviceProviderName] - * The serviceProviderName. - * - * @param {string} [parameters.serviceProviderProperties.peeringLocation] The - * peering location. - * - * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The - * BandwidthInMbps. - * - * @param {object} [parameters.expressRoutePort] The reference to the - * ExpressRoutePort resource when the circuit is provisioned on an - * ExpressRoutePort resource. - * - * @param {string} [parameters.expressRoutePort.id] Resource ID. - * - * @param {number} [parameters.bandwidthInGbps] The bandwidth of the circuit - * when the circuit is provisioned on an ExpressRoutePort resource. - * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. - * - * @param {boolean} [parameters.allowGlobalReach] Flag to enable Global Reach - * on the circuit. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 ExpressRouteCircuit} 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 _beginCreateOrUpdate(resourceGroupName, circuitName, parameters, 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-10-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 (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['ExpressRouteCircuit']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['ExpressRouteCircuit']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ExpressRouteCircuit']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Updates an express route circuit tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the circuit. - * - * @param {object} parameters Parameters supplied to update express route - * circuit tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 ExpressRouteCircuit} 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 _beginUpdateTags(resourceGroupName, circuitName, parameters, 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-10-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 (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); - 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 = 'PATCH'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['TagsObject']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // 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['ExpressRouteCircuit']().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 the currently advertised ARP table associated with the express route - * circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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 ExpressRouteCircuitsArpTableListResult} 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 _beginListArpTable(resourceGroupName, circuitName, peeringName, devicePath, 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-10-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 (devicePath === null || devicePath === undefined || typeof devicePath.valueOf() !== 'string') { - throw new Error('devicePath 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}/arpTables/{devicePath}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); - requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); - requestUrl = requestUrl.replace('{devicePath}', encodeURIComponent(devicePath)); - 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 = 'POST'; - 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 && statusCode !== 202) { - 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['ExpressRouteCircuitsArpTableListResult']().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 the currently advertised routes table associated with the express route - * circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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 ExpressRouteCircuitsRoutesTableListResult} - * 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 _beginListRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, 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-10-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 (devicePath === null || devicePath === undefined || typeof devicePath.valueOf() !== 'string') { - throw new Error('devicePath 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}/routeTables/{devicePath}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); - requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); - requestUrl = requestUrl.replace('{devicePath}', encodeURIComponent(devicePath)); - 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 = 'POST'; - 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 && statusCode !== 202) { - 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['ExpressRouteCircuitsRoutesTableListResult']().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 the currently advertised routes table summary associated with the - * express route circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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 - * ExpressRouteCircuitsRoutesTableSummaryListResult} 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 _beginListRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, 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-10-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 (devicePath === null || devicePath === undefined || typeof devicePath.valueOf() !== 'string') { - throw new Error('devicePath 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}/routeTablesSummary/{devicePath}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{circuitName}', encodeURIComponent(circuitName)); - requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); - requestUrl = requestUrl.replace('{devicePath}', encodeURIComponent(devicePath)); - 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 = 'POST'; - 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 && statusCode !== 202) { - 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['ExpressRouteCircuitsRoutesTableSummaryListResult']().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 the express route circuits in a resource group. - * - * @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 ExpressRouteCircuitListResult} 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['ExpressRouteCircuitListResult']().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 the express route circuits in a subscription. - * - * @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 ExpressRouteCircuitListResult} 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 _listAllNext(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['ExpressRouteCircuitListResult']().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 ExpressRouteCircuits. */ -class ExpressRouteCircuits { - /** - * Create a ExpressRouteCircuits. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._updateTags = _updateTags; - this._listArpTable = _listArpTable; - this._listRoutesTable = _listRoutesTable; - this._listRoutesTableSummary = _listRoutesTableSummary; - this._getStats = _getStats; - this._getPeeringStats = _getPeeringStats; - this._list = _list; - this._listAll = _listAll; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdateTags = _beginUpdateTags; - this._beginListArpTable = _beginListArpTable; - this._beginListRoutesTable = _beginListRoutesTable; - this._beginListRoutesTableSummary = _beginListRoutesTableSummary; - this._listNext = _listNext; - this._listAllNext = _listAllNext; - } - - /** - * Deletes 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 {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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, circuitName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, circuitName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes 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 {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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, circuitName, 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._deleteMethod(resourceGroupName, circuitName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, circuitName, options, optionalCallback); - } - } - - /** - * Gets information about the specified express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of express route circuit. - * - * @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, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, circuitName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets information about the specified express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of express route circuit. - * - * @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 {ExpressRouteCircuit} - 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 ExpressRouteCircuit} 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, 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, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, circuitName, options, optionalCallback); - } - } - - /** - * Creates or updates an express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the circuit. - * - * @param {object} parameters Parameters supplied to the create or update - * express route circuit operation. - * - * @param {object} [parameters.sku] The SKU. - * - * @param {string} [parameters.sku.name] The name of the SKU. - * - * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values - * are 'Standard', 'Premium' or 'Basic'. Possible values include: 'Standard', - * 'Premium', 'Basic' - * - * @param {string} [parameters.sku.family] The family of the SKU. Possible - * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: - * 'UnlimitedData', 'MeteredData' - * - * @param {boolean} [parameters.allowClassicOperations] Allow classic - * operations - * - * @param {string} [parameters.circuitProvisioningState] The - * CircuitProvisioningState state of the resource. - * - * @param {string} [parameters.serviceProviderProvisioningState] The - * ServiceProviderProvisioningState state of the resource. Possible values are - * 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' - * - * @param {array} [parameters.authorizations] The list of authorizations. - * - * @param {array} [parameters.peerings] The list of peerings. - * - * @param {string} [parameters.serviceKey] The ServiceKey. - * - * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. - * - * @param {object} [parameters.serviceProviderProperties] The - * ServiceProviderProperties. - * - * @param {string} [parameters.serviceProviderProperties.serviceProviderName] - * The serviceProviderName. - * - * @param {string} [parameters.serviceProviderProperties.peeringLocation] The - * peering location. - * - * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The - * BandwidthInMbps. - * - * @param {object} [parameters.expressRoutePort] The reference to the - * ExpressRoutePort resource when the circuit is provisioned on an - * ExpressRoutePort resource. - * - * @param {string} [parameters.expressRoutePort.id] Resource ID. - * - * @param {number} [parameters.bandwidthInGbps] The bandwidth of the circuit - * when the circuit is provisioned on an ExpressRoutePort resource. - * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. - * - * @param {boolean} [parameters.allowGlobalReach] Flag to enable Global Reach - * on the circuit. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, circuitName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, circuitName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates an express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the circuit. - * - * @param {object} parameters Parameters supplied to the create or update - * express route circuit operation. - * - * @param {object} [parameters.sku] The SKU. - * - * @param {string} [parameters.sku.name] The name of the SKU. - * - * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values - * are 'Standard', 'Premium' or 'Basic'. Possible values include: 'Standard', - * 'Premium', 'Basic' - * - * @param {string} [parameters.sku.family] The family of the SKU. Possible - * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: - * 'UnlimitedData', 'MeteredData' - * - * @param {boolean} [parameters.allowClassicOperations] Allow classic - * operations - * - * @param {string} [parameters.circuitProvisioningState] The - * CircuitProvisioningState state of the resource. - * - * @param {string} [parameters.serviceProviderProvisioningState] The - * ServiceProviderProvisioningState state of the resource. Possible values are - * 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' - * - * @param {array} [parameters.authorizations] The list of authorizations. - * - * @param {array} [parameters.peerings] The list of peerings. - * - * @param {string} [parameters.serviceKey] The ServiceKey. - * - * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. - * - * @param {object} [parameters.serviceProviderProperties] The - * ServiceProviderProperties. - * - * @param {string} [parameters.serviceProviderProperties.serviceProviderName] - * The serviceProviderName. - * - * @param {string} [parameters.serviceProviderProperties.peeringLocation] The - * peering location. - * - * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The - * BandwidthInMbps. - * - * @param {object} [parameters.expressRoutePort] The reference to the - * ExpressRoutePort resource when the circuit is provisioned on an - * ExpressRoutePort resource. - * - * @param {string} [parameters.expressRoutePort.id] Resource ID. - * - * @param {number} [parameters.bandwidthInGbps] The bandwidth of the circuit - * when the circuit is provisioned on an ExpressRoutePort resource. - * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. - * - * @param {boolean} [parameters.allowGlobalReach] Flag to enable Global Reach - * on the circuit. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ExpressRouteCircuit} - 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 ExpressRouteCircuit} 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. - */ - createOrUpdate(resourceGroupName, circuitName, parameters, 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._createOrUpdate(resourceGroupName, circuitName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, circuitName, parameters, options, optionalCallback); - } - } - - /** - * Updates an express route circuit tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the circuit. - * - * @param {object} parameters Parameters supplied to update express route - * circuit tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName, circuitName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateTags(resourceGroupName, circuitName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates an express route circuit tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the circuit. - * - * @param {object} parameters Parameters supplied to update express route - * circuit tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ExpressRouteCircuit} - 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 ExpressRouteCircuit} 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. - */ - updateTags(resourceGroupName, circuitName, parameters, 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._updateTags(resourceGroupName, circuitName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateTags(resourceGroupName, circuitName, parameters, options, optionalCallback); - } - } - - /** - * Gets the currently advertised ARP table associated with the express route - * circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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. - */ - listArpTableWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, devicePath, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listArpTable(resourceGroupName, circuitName, peeringName, devicePath, 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 currently advertised ARP table associated with the express route - * circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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 {ExpressRouteCircuitsArpTableListResult} - 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 ExpressRouteCircuitsArpTableListResult} 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. - */ - listArpTable(resourceGroupName, circuitName, peeringName, devicePath, 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._listArpTable(resourceGroupName, circuitName, peeringName, devicePath, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listArpTable(resourceGroupName, circuitName, peeringName, devicePath, options, optionalCallback); - } - } - - /** - * Gets the currently advertised routes table associated with the express route - * circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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. - */ - listRoutesTableWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, devicePath, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, 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 currently advertised routes table associated with the express route - * circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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 {ExpressRouteCircuitsRoutesTableListResult} - 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 ExpressRouteCircuitsRoutesTableListResult} - * 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. - */ - listRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, 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._listRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, options, optionalCallback); - } - } - - /** - * Gets the currently advertised routes table summary associated with the - * express route circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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. - */ - listRoutesTableSummaryWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, devicePath, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, 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 currently advertised routes table summary associated with the - * express route circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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 {ExpressRouteCircuitsRoutesTableSummaryListResult} - 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 - * ExpressRouteCircuitsRoutesTableSummaryListResult} 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. - */ - listRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, 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._listRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, options, optionalCallback); - } - } - - /** - * Gets all the stats from an express route circuit in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the express route circuit. - * - * @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. - */ - getStatsWithHttpOperationResponse(resourceGroupName, circuitName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getStats(resourceGroupName, circuitName, 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 the stats from an express route circuit in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the express route circuit. - * - * @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 {ExpressRouteCircuitStats} - 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 ExpressRouteCircuitStats} 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. - */ - getStats(resourceGroupName, circuitName, 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._getStats(resourceGroupName, circuitName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getStats(resourceGroupName, circuitName, options, optionalCallback); - } - } - - /** - * Gets all stats from an express route circuit in a resource group. - * - * @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 {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. - */ - getPeeringStatsWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getPeeringStats(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 stats from an express route circuit in a resource group. - * - * @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 {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 {ExpressRouteCircuitStats} - 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 ExpressRouteCircuitStats} 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. - */ - getPeeringStats(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._getPeeringStats(resourceGroupName, circuitName, peeringName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getPeeringStats(resourceGroupName, circuitName, peeringName, options, optionalCallback); - } - } - - /** - * Gets all the express route circuits in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, 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 the express route circuits in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {ExpressRouteCircuitListResult} - 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 ExpressRouteCircuitListResult} 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, 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, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, options, optionalCallback); - } - } - - /** - * Gets all the express route circuits in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAll(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 the express route circuits in a subscription. - * - * @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 {ExpressRouteCircuitListResult} - 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 ExpressRouteCircuitListResult} 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. - */ - listAll(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._listAll(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAll(options, optionalCallback); - } - } - - /** - * Deletes 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 {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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, circuitName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, circuitName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes 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 {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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, circuitName, 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._beginDeleteMethod(resourceGroupName, circuitName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, circuitName, options, optionalCallback); - } - } - - /** - * Creates or updates an express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the circuit. - * - * @param {object} parameters Parameters supplied to the create or update - * express route circuit operation. - * - * @param {object} [parameters.sku] The SKU. - * - * @param {string} [parameters.sku.name] The name of the SKU. - * - * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values - * are 'Standard', 'Premium' or 'Basic'. Possible values include: 'Standard', - * 'Premium', 'Basic' - * - * @param {string} [parameters.sku.family] The family of the SKU. Possible - * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: - * 'UnlimitedData', 'MeteredData' - * - * @param {boolean} [parameters.allowClassicOperations] Allow classic - * operations - * - * @param {string} [parameters.circuitProvisioningState] The - * CircuitProvisioningState state of the resource. - * - * @param {string} [parameters.serviceProviderProvisioningState] The - * ServiceProviderProvisioningState state of the resource. Possible values are - * 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' - * - * @param {array} [parameters.authorizations] The list of authorizations. - * - * @param {array} [parameters.peerings] The list of peerings. - * - * @param {string} [parameters.serviceKey] The ServiceKey. - * - * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. - * - * @param {object} [parameters.serviceProviderProperties] The - * ServiceProviderProperties. - * - * @param {string} [parameters.serviceProviderProperties.serviceProviderName] - * The serviceProviderName. - * - * @param {string} [parameters.serviceProviderProperties.peeringLocation] The - * peering location. - * - * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The - * BandwidthInMbps. - * - * @param {object} [parameters.expressRoutePort] The reference to the - * ExpressRoutePort resource when the circuit is provisioned on an - * ExpressRoutePort resource. - * - * @param {string} [parameters.expressRoutePort.id] Resource ID. - * - * @param {number} [parameters.bandwidthInGbps] The bandwidth of the circuit - * when the circuit is provisioned on an ExpressRoutePort resource. - * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. - * - * @param {boolean} [parameters.allowGlobalReach] Flag to enable Global Reach - * on the circuit. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, circuitName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, circuitName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates an express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the circuit. - * - * @param {object} parameters Parameters supplied to the create or update - * express route circuit operation. - * - * @param {object} [parameters.sku] The SKU. - * - * @param {string} [parameters.sku.name] The name of the SKU. - * - * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values - * are 'Standard', 'Premium' or 'Basic'. Possible values include: 'Standard', - * 'Premium', 'Basic' - * - * @param {string} [parameters.sku.family] The family of the SKU. Possible - * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: - * 'UnlimitedData', 'MeteredData' - * - * @param {boolean} [parameters.allowClassicOperations] Allow classic - * operations - * - * @param {string} [parameters.circuitProvisioningState] The - * CircuitProvisioningState state of the resource. - * - * @param {string} [parameters.serviceProviderProvisioningState] The - * ServiceProviderProvisioningState state of the resource. Possible values are - * 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' - * - * @param {array} [parameters.authorizations] The list of authorizations. - * - * @param {array} [parameters.peerings] The list of peerings. - * - * @param {string} [parameters.serviceKey] The ServiceKey. - * - * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. - * - * @param {object} [parameters.serviceProviderProperties] The - * ServiceProviderProperties. - * - * @param {string} [parameters.serviceProviderProperties.serviceProviderName] - * The serviceProviderName. - * - * @param {string} [parameters.serviceProviderProperties.peeringLocation] The - * peering location. - * - * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The - * BandwidthInMbps. - * - * @param {object} [parameters.expressRoutePort] The reference to the - * ExpressRoutePort resource when the circuit is provisioned on an - * ExpressRoutePort resource. - * - * @param {string} [parameters.expressRoutePort.id] Resource ID. - * - * @param {number} [parameters.bandwidthInGbps] The bandwidth of the circuit - * when the circuit is provisioned on an ExpressRoutePort resource. - * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. - * - * @param {boolean} [parameters.allowGlobalReach] Flag to enable Global Reach - * on the circuit. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ExpressRouteCircuit} - 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 ExpressRouteCircuit} 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. - */ - beginCreateOrUpdate(resourceGroupName, circuitName, parameters, 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._beginCreateOrUpdate(resourceGroupName, circuitName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, circuitName, parameters, options, optionalCallback); - } - } - - /** - * Updates an express route circuit tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the circuit. - * - * @param {object} parameters Parameters supplied to update express route - * circuit tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName, circuitName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginUpdateTags(resourceGroupName, circuitName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates an express route circuit tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the circuit. - * - * @param {object} parameters Parameters supplied to update express route - * circuit tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ExpressRouteCircuit} - 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 ExpressRouteCircuit} 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. - */ - beginUpdateTags(resourceGroupName, circuitName, parameters, 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._beginUpdateTags(resourceGroupName, circuitName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginUpdateTags(resourceGroupName, circuitName, parameters, options, optionalCallback); - } - } - - /** - * Gets the currently advertised ARP table associated with the express route - * circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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. - */ - beginListArpTableWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, devicePath, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginListArpTable(resourceGroupName, circuitName, peeringName, devicePath, 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 currently advertised ARP table associated with the express route - * circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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 {ExpressRouteCircuitsArpTableListResult} - 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 ExpressRouteCircuitsArpTableListResult} 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. - */ - beginListArpTable(resourceGroupName, circuitName, peeringName, devicePath, 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._beginListArpTable(resourceGroupName, circuitName, peeringName, devicePath, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginListArpTable(resourceGroupName, circuitName, peeringName, devicePath, options, optionalCallback); - } - } - - /** - * Gets the currently advertised routes table associated with the express route - * circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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. - */ - beginListRoutesTableWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, devicePath, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginListRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, 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 currently advertised routes table associated with the express route - * circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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 {ExpressRouteCircuitsRoutesTableListResult} - 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 ExpressRouteCircuitsRoutesTableListResult} - * 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. - */ - beginListRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, 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._beginListRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginListRoutesTable(resourceGroupName, circuitName, peeringName, devicePath, options, optionalCallback); - } - } - - /** - * Gets the currently advertised routes table summary associated with the - * express route circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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. - */ - beginListRoutesTableSummaryWithHttpOperationResponse(resourceGroupName, circuitName, peeringName, devicePath, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginListRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, 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 currently advertised routes table summary associated with the - * express route circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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 {ExpressRouteCircuitsRoutesTableSummaryListResult} - 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 - * ExpressRouteCircuitsRoutesTableSummaryListResult} 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. - */ - beginListRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, 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._beginListRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginListRoutesTableSummary(resourceGroupName, circuitName, peeringName, devicePath, options, optionalCallback); - } - } - - /** - * Gets all the express route circuits in a resource group. - * - * @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 the express route circuits in a resource group. - * - * @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 {ExpressRouteCircuitListResult} - 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 ExpressRouteCircuitListResult} 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); - } - } - - /** - * Gets all the express route circuits in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAllNext(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 the express route circuits in a subscription. - * - * @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 {ExpressRouteCircuitListResult} - 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 ExpressRouteCircuitListResult} 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. - */ - listAllNext(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._listAllNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAllNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = ExpressRouteCircuits; diff --git a/lib/services/networkManagement2/lib/operations/expressRouteConnections.js b/lib/services/networkManagement2/lib/operations/expressRouteConnections.js deleted file mode 100644 index 46537277c..000000000 --- a/lib/services/networkManagement2/lib/operations/expressRouteConnections.js +++ /dev/null @@ -1,1484 +0,0 @@ -/* - * 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; - - -/** - * Creates a connection between an ExpressRoute gateway and an ExpressRoute - * circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {string} connectionName The name of the connection subresource. - * - * @param {object} putExpressRouteConnectionParameters Parameters required in - * an ExpressRouteConnection PUT operation. - * - * @param {object} - * putExpressRouteConnectionParameters.expressRouteCircuitPeering The - * ExpressRoute circuit peering. - * - * @param {string} - * [putExpressRouteConnectionParameters.expressRouteCircuitPeering.id] The ID - * of the ExpressRoute circuit peering. - * - * @param {string} [putExpressRouteConnectionParameters.authorizationKey] - * Authorization key to establish the connection. - * - * @param {number} [putExpressRouteConnectionParameters.routingWeight] The - * routing weight associated to the connection. - * - * @param {string} putExpressRouteConnectionParameters.name The name of the - * resource. - * - * @param {string} [putExpressRouteConnectionParameters.id] Resource ID. - * - * @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 ExpressRouteConnection} 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 _createOrUpdate(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ExpressRouteConnection']().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 the specified ExpressRouteConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {string} connectionName The name of the ExpressRoute 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 ExpressRouteConnection} 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, expressRouteGatewayName, 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-10-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 (expressRouteGatewayName === null || expressRouteGatewayName === undefined || typeof expressRouteGatewayName.valueOf() !== 'string') { - throw new Error('expressRouteGatewayName 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/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{expressRouteGatewayName}', encodeURIComponent(expressRouteGatewayName)); - 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['ExpressRouteConnection']().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); - }); -} - - -/** - * Deletes a connection to a ExpressRoute circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {string} connectionName The name of the connection subresource. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, expressRouteGatewayName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, expressRouteGatewayName, connectionName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Lists ExpressRouteConnections. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @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 ExpressRouteConnectionList} 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, expressRouteGatewayName, 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-10-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 (expressRouteGatewayName === null || expressRouteGatewayName === undefined || typeof expressRouteGatewayName.valueOf() !== 'string') { - throw new Error('expressRouteGatewayName 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/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{expressRouteGatewayName}', encodeURIComponent(expressRouteGatewayName)); - 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['ExpressRouteConnectionList']().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); - }); -} - -/** - * Creates a connection between an ExpressRoute gateway and an ExpressRoute - * circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {string} connectionName The name of the connection subresource. - * - * @param {object} putExpressRouteConnectionParameters Parameters required in - * an ExpressRouteConnection PUT operation. - * - * @param {object} - * putExpressRouteConnectionParameters.expressRouteCircuitPeering The - * ExpressRoute circuit peering. - * - * @param {string} - * [putExpressRouteConnectionParameters.expressRouteCircuitPeering.id] The ID - * of the ExpressRoute circuit peering. - * - * @param {string} [putExpressRouteConnectionParameters.authorizationKey] - * Authorization key to establish the connection. - * - * @param {number} [putExpressRouteConnectionParameters.routingWeight] The - * routing weight associated to the connection. - * - * @param {string} putExpressRouteConnectionParameters.name The name of the - * resource. - * - * @param {string} [putExpressRouteConnectionParameters.id] Resource ID. - * - * @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 ExpressRouteConnection} 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 _beginCreateOrUpdate(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters, 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-10-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 (expressRouteGatewayName === null || expressRouteGatewayName === undefined || typeof expressRouteGatewayName.valueOf() !== 'string') { - throw new Error('expressRouteGatewayName 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 (putExpressRouteConnectionParameters === null || putExpressRouteConnectionParameters === undefined) { - throw new Error('putExpressRouteConnectionParameters cannot be null or undefined.'); - } - 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/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{expressRouteGatewayName}', encodeURIComponent(expressRouteGatewayName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (putExpressRouteConnectionParameters !== null && putExpressRouteConnectionParameters !== undefined) { - let requestModelMapper = new client.models['ExpressRouteConnection']().mapper(); - requestModel = client.serialize(requestModelMapper, putExpressRouteConnectionParameters, 'putExpressRouteConnectionParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(putExpressRouteConnectionParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['ExpressRouteConnection']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ExpressRouteConnection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Deletes a connection to a ExpressRoute circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {string} connectionName The name of the connection subresource. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, expressRouteGatewayName, 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-10-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 (expressRouteGatewayName === null || expressRouteGatewayName === undefined || typeof expressRouteGatewayName.valueOf() !== 'string') { - throw new Error('expressRouteGatewayName 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/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{expressRouteGatewayName}', encodeURIComponent(expressRouteGatewayName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** Class representing a ExpressRouteConnections. */ -class ExpressRouteConnections { - /** - * Create a ExpressRouteConnections. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._createOrUpdate = _createOrUpdate; - this._get = _get; - this._deleteMethod = _deleteMethod; - this._list = _list; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginDeleteMethod = _beginDeleteMethod; - } - - /** - * Creates a connection between an ExpressRoute gateway and an ExpressRoute - * circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {string} connectionName The name of the connection subresource. - * - * @param {object} putExpressRouteConnectionParameters Parameters required in - * an ExpressRouteConnection PUT operation. - * - * @param {object} - * putExpressRouteConnectionParameters.expressRouteCircuitPeering The - * ExpressRoute circuit peering. - * - * @param {string} - * [putExpressRouteConnectionParameters.expressRouteCircuitPeering.id] The ID - * of the ExpressRoute circuit peering. - * - * @param {string} [putExpressRouteConnectionParameters.authorizationKey] - * Authorization key to establish the connection. - * - * @param {number} [putExpressRouteConnectionParameters.routingWeight] The - * routing weight associated to the connection. - * - * @param {string} putExpressRouteConnectionParameters.name The name of the - * resource. - * - * @param {string} [putExpressRouteConnectionParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates a connection between an ExpressRoute gateway and an ExpressRoute - * circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {string} connectionName The name of the connection subresource. - * - * @param {object} putExpressRouteConnectionParameters Parameters required in - * an ExpressRouteConnection PUT operation. - * - * @param {object} - * putExpressRouteConnectionParameters.expressRouteCircuitPeering The - * ExpressRoute circuit peering. - * - * @param {string} - * [putExpressRouteConnectionParameters.expressRouteCircuitPeering.id] The ID - * of the ExpressRoute circuit peering. - * - * @param {string} [putExpressRouteConnectionParameters.authorizationKey] - * Authorization key to establish the connection. - * - * @param {number} [putExpressRouteConnectionParameters.routingWeight] The - * routing weight associated to the connection. - * - * @param {string} putExpressRouteConnectionParameters.name The name of the - * resource. - * - * @param {string} [putExpressRouteConnectionParameters.id] Resource ID. - * - * @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 {ExpressRouteConnection} - 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 ExpressRouteConnection} 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. - */ - createOrUpdate(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters, 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._createOrUpdate(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters, options, optionalCallback); - } - } - - /** - * Gets the specified ExpressRouteConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {string} connectionName The name of the ExpressRoute 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, expressRouteGatewayName, connectionName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, expressRouteGatewayName, 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 ExpressRouteConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {string} connectionName The name of the ExpressRoute 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 {ExpressRouteConnection} - 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 ExpressRouteConnection} 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, expressRouteGatewayName, 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, expressRouteGatewayName, connectionName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, expressRouteGatewayName, connectionName, options, optionalCallback); - } - } - - /** - * Deletes a connection to a ExpressRoute circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {string} connectionName The name of the connection subresource. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, expressRouteGatewayName, connectionName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, expressRouteGatewayName, connectionName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes a connection to a ExpressRoute circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {string} connectionName The name of the connection subresource. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, expressRouteGatewayName, 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._deleteMethod(resourceGroupName, expressRouteGatewayName, connectionName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, expressRouteGatewayName, connectionName, options, optionalCallback); - } - } - - /** - * Lists ExpressRouteConnections. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @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, expressRouteGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, expressRouteGatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists ExpressRouteConnections. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @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 {ExpressRouteConnectionList} - 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 ExpressRouteConnectionList} 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, expressRouteGatewayName, 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, expressRouteGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, expressRouteGatewayName, options, optionalCallback); - } - } - - /** - * Creates a connection between an ExpressRoute gateway and an ExpressRoute - * circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {string} connectionName The name of the connection subresource. - * - * @param {object} putExpressRouteConnectionParameters Parameters required in - * an ExpressRouteConnection PUT operation. - * - * @param {object} - * putExpressRouteConnectionParameters.expressRouteCircuitPeering The - * ExpressRoute circuit peering. - * - * @param {string} - * [putExpressRouteConnectionParameters.expressRouteCircuitPeering.id] The ID - * of the ExpressRoute circuit peering. - * - * @param {string} [putExpressRouteConnectionParameters.authorizationKey] - * Authorization key to establish the connection. - * - * @param {number} [putExpressRouteConnectionParameters.routingWeight] The - * routing weight associated to the connection. - * - * @param {string} putExpressRouteConnectionParameters.name The name of the - * resource. - * - * @param {string} [putExpressRouteConnectionParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates a connection between an ExpressRoute gateway and an ExpressRoute - * circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {string} connectionName The name of the connection subresource. - * - * @param {object} putExpressRouteConnectionParameters Parameters required in - * an ExpressRouteConnection PUT operation. - * - * @param {object} - * putExpressRouteConnectionParameters.expressRouteCircuitPeering The - * ExpressRoute circuit peering. - * - * @param {string} - * [putExpressRouteConnectionParameters.expressRouteCircuitPeering.id] The ID - * of the ExpressRoute circuit peering. - * - * @param {string} [putExpressRouteConnectionParameters.authorizationKey] - * Authorization key to establish the connection. - * - * @param {number} [putExpressRouteConnectionParameters.routingWeight] The - * routing weight associated to the connection. - * - * @param {string} putExpressRouteConnectionParameters.name The name of the - * resource. - * - * @param {string} [putExpressRouteConnectionParameters.id] Resource ID. - * - * @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 {ExpressRouteConnection} - 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 ExpressRouteConnection} 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. - */ - beginCreateOrUpdate(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters, 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._beginCreateOrUpdate(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters, options, optionalCallback); - } - } - - /** - * Deletes a connection to a ExpressRoute circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {string} connectionName The name of the connection subresource. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, expressRouteGatewayName, connectionName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, expressRouteGatewayName, connectionName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes a connection to a ExpressRoute circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {string} connectionName The name of the connection subresource. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, expressRouteGatewayName, 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._beginDeleteMethod(resourceGroupName, expressRouteGatewayName, connectionName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, expressRouteGatewayName, connectionName, options, optionalCallback); - } - } - -} - -module.exports = ExpressRouteConnections; diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js b/lib/services/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js deleted file mode 100644 index 6b95dfb5c..000000000 --- a/lib/services/networkManagement2/lib/operations/expressRouteCrossConnectionPeerings.js +++ /dev/null @@ -1,2160 +0,0 @@ -/* - * 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 all peerings in a specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @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 ExpressRouteCrossConnectionPeeringList} 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, crossConnectionName, 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-10-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 (crossConnectionName === null || crossConnectionName === undefined || typeof crossConnectionName.valueOf() !== 'string') { - throw new Error('crossConnectionName 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/expressRouteCrossConnections/{crossConnectionName}/peerings'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{crossConnectionName}', encodeURIComponent(crossConnectionName)); - 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['ExpressRouteCrossConnectionPeeringList']().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); - }); -} - - -/** - * Deletes the specified peering from the ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, crossConnectionName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, crossConnectionName, peeringName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets the specified peering for the ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @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 ExpressRouteCrossConnectionPeering} 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, crossConnectionName, 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-10-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 (crossConnectionName === null || crossConnectionName === undefined || typeof crossConnectionName.valueOf() !== 'string') { - throw new Error('crossConnectionName 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/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{crossConnectionName}', encodeURIComponent(crossConnectionName)); - 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['ExpressRouteCrossConnectionPeering']().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); - }); -} - - -/** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {object} peeringParameters Parameters supplied to the create or - * update ExpressRouteCrossConnection peering operation. - * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' - * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {number} [peeringParameters.peerASN] The peer ASN. - * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. - * - * @param {string} [peeringParameters.sharedKey] The shared key. - * - * @param {number} [peeringParameters.vlanId] The VLAN ID. - * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. - * - * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager - * Etag. - * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. - * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [peeringParameters.id] Resource ID. - * - * @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 ExpressRouteCrossConnectionPeering} 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 _createOrUpdate(resourceGroupName, crossConnectionName, peeringName, peeringParameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, crossConnectionName, peeringName, peeringParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ExpressRouteCrossConnectionPeering']().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); - }); - }); -} - -/** - * Deletes the specified peering from the ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, crossConnectionName, 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-10-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 (crossConnectionName === null || crossConnectionName === undefined || typeof crossConnectionName.valueOf() !== 'string') { - throw new Error('crossConnectionName 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/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{crossConnectionName}', encodeURIComponent(crossConnectionName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {object} peeringParameters Parameters supplied to the create or - * update ExpressRouteCrossConnection peering operation. - * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' - * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {number} [peeringParameters.peerASN] The peer ASN. - * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. - * - * @param {string} [peeringParameters.sharedKey] The shared key. - * - * @param {number} [peeringParameters.vlanId] The VLAN ID. - * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. - * - * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager - * Etag. - * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. - * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [peeringParameters.id] Resource ID. - * - * @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 ExpressRouteCrossConnectionPeering} 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 _beginCreateOrUpdate(resourceGroupName, crossConnectionName, peeringName, peeringParameters, 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-10-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 (crossConnectionName === null || crossConnectionName === undefined || typeof crossConnectionName.valueOf() !== 'string') { - throw new Error('crossConnectionName 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 (peeringParameters === null || peeringParameters === undefined) { - throw new Error('peeringParameters cannot be null or undefined.'); - } - 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/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{crossConnectionName}', encodeURIComponent(crossConnectionName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (peeringParameters !== null && peeringParameters !== undefined) { - let requestModelMapper = new client.models['ExpressRouteCrossConnectionPeering']().mapper(); - requestModel = client.serialize(requestModelMapper, peeringParameters, 'peeringParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(peeringParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['ExpressRouteCrossConnectionPeering']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ExpressRouteCrossConnectionPeering']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Gets all peerings in a specified ExpressRouteCrossConnection. - * - * @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 ExpressRouteCrossConnectionPeeringList} 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['ExpressRouteCrossConnectionPeeringList']().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 ExpressRouteCrossConnectionPeerings. */ -class ExpressRouteCrossConnectionPeerings { - /** - * Create a ExpressRouteCrossConnectionPeerings. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._list = _list; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._listNext = _listNext; - } - - /** - * Gets all peerings in a specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @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, crossConnectionName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, crossConnectionName, 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 peerings in a specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @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 {ExpressRouteCrossConnectionPeeringList} - 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 ExpressRouteCrossConnectionPeeringList} 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, crossConnectionName, 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, crossConnectionName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, crossConnectionName, options, optionalCallback); - } - } - - /** - * Deletes the specified peering from the ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, crossConnectionName, peeringName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, crossConnectionName, peeringName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified peering from the ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, crossConnectionName, 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._deleteMethod(resourceGroupName, crossConnectionName, peeringName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, crossConnectionName, peeringName, options, optionalCallback); - } - } - - /** - * Gets the specified peering for the ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @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. - */ - getWithHttpOperationResponse(resourceGroupName, crossConnectionName, peeringName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, crossConnectionName, 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 the specified peering for the ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @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 {ExpressRouteCrossConnectionPeering} - 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 ExpressRouteCrossConnectionPeering} 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, crossConnectionName, 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._get(resourceGroupName, crossConnectionName, peeringName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, crossConnectionName, peeringName, options, optionalCallback); - } - } - - /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {object} peeringParameters Parameters supplied to the create or - * update ExpressRouteCrossConnection peering operation. - * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' - * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {number} [peeringParameters.peerASN] The peer ASN. - * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. - * - * @param {string} [peeringParameters.sharedKey] The shared key. - * - * @param {number} [peeringParameters.vlanId] The VLAN ID. - * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. - * - * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager - * Etag. - * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. - * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [peeringParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, crossConnectionName, peeringName, peeringParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, crossConnectionName, peeringName, peeringParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {object} peeringParameters Parameters supplied to the create or - * update ExpressRouteCrossConnection peering operation. - * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' - * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {number} [peeringParameters.peerASN] The peer ASN. - * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. - * - * @param {string} [peeringParameters.sharedKey] The shared key. - * - * @param {number} [peeringParameters.vlanId] The VLAN ID. - * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. - * - * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager - * Etag. - * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. - * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [peeringParameters.id] Resource ID. - * - * @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 {ExpressRouteCrossConnectionPeering} - 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 ExpressRouteCrossConnectionPeering} 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. - */ - createOrUpdate(resourceGroupName, crossConnectionName, peeringName, peeringParameters, 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._createOrUpdate(resourceGroupName, crossConnectionName, peeringName, peeringParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, crossConnectionName, peeringName, peeringParameters, options, optionalCallback); - } - } - - /** - * Deletes the specified peering from the ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, crossConnectionName, peeringName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, crossConnectionName, peeringName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified peering from the ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, crossConnectionName, 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._beginDeleteMethod(resourceGroupName, crossConnectionName, peeringName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, crossConnectionName, peeringName, options, optionalCallback); - } - } - - /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {object} peeringParameters Parameters supplied to the create or - * update ExpressRouteCrossConnection peering operation. - * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' - * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {number} [peeringParameters.peerASN] The peer ASN. - * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. - * - * @param {string} [peeringParameters.sharedKey] The shared key. - * - * @param {number} [peeringParameters.vlanId] The VLAN ID. - * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. - * - * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager - * Etag. - * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. - * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [peeringParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, crossConnectionName, peeringName, peeringParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, crossConnectionName, peeringName, peeringParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {object} peeringParameters Parameters supplied to the create or - * update ExpressRouteCrossConnection peering operation. - * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' - * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {number} [peeringParameters.peerASN] The peer ASN. - * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. - * - * @param {string} [peeringParameters.sharedKey] The shared key. - * - * @param {number} [peeringParameters.vlanId] The VLAN ID. - * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. - * - * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager - * Etag. - * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. - * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [peeringParameters.id] Resource ID. - * - * @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 {ExpressRouteCrossConnectionPeering} - 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 ExpressRouteCrossConnectionPeering} 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. - */ - beginCreateOrUpdate(resourceGroupName, crossConnectionName, peeringName, peeringParameters, 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._beginCreateOrUpdate(resourceGroupName, crossConnectionName, peeringName, peeringParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, crossConnectionName, peeringName, peeringParameters, options, optionalCallback); - } - } - - /** - * Gets all peerings in a specified ExpressRouteCrossConnection. - * - * @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 peerings in a specified ExpressRouteCrossConnection. - * - * @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 {ExpressRouteCrossConnectionPeeringList} - 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 ExpressRouteCrossConnectionPeeringList} 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 = ExpressRouteCrossConnectionPeerings; diff --git a/lib/services/networkManagement2/lib/operations/expressRouteCrossConnections.js b/lib/services/networkManagement2/lib/operations/expressRouteCrossConnections.js deleted file mode 100644 index 6091982c6..000000000 --- a/lib/services/networkManagement2/lib/operations/expressRouteCrossConnections.js +++ /dev/null @@ -1,3510 +0,0 @@ -/* - * 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; - -/** - * Retrieves all the ExpressRouteCrossConnections in a subscription. - * - * @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 ExpressRouteCrossConnectionListResult} 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(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/expressRouteCrossConnections'; - 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['ExpressRouteCrossConnectionListResult']().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); - }); -} - -/** - * Retrieves all the ExpressRouteCrossConnections in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 ExpressRouteCrossConnectionListResult} 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 _listByResourceGroup(resourceGroupName, 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-10-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 (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/expressRouteCrossConnections'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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['ExpressRouteCrossConnectionListResult']().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 details about the specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group (peering - * location of the circuit). - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection (service key of the circuit). - * - * @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 ExpressRouteCrossConnection} 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, crossConnectionName, 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-10-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 (crossConnectionName === null || crossConnectionName === undefined || typeof crossConnectionName.valueOf() !== 'string') { - throw new Error('crossConnectionName 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/expressRouteCrossConnections/{crossConnectionName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{crossConnectionName}', encodeURIComponent(crossConnectionName)); - 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['ExpressRouteCrossConnection']().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); - }); -} - - -/** - * Update the specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {object} parameters Parameters supplied to the update express route - * crossConnection operation. - * - * @param {string} [parameters.peeringLocation] The peering location of the - * ExpressRoute circuit. - * - * @param {number} [parameters.bandwidthInMbps] The circuit bandwidth In Mbps. - * - * @param {object} [parameters.expressRouteCircuit] The ExpressRouteCircuit - * - * @param {string} [parameters.expressRouteCircuit.id] Corresponding Express - * Route Circuit Id. - * - * @param {string} [parameters.serviceProviderProvisioningState] The - * provisioning state of the circuit in the connectivity provider system. - * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' - * - * @param {string} [parameters.serviceProviderNotes] Additional read only notes - * set by the connectivity provider. - * - * @param {array} [parameters.peerings] The list of peerings. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 ExpressRouteCrossConnection} 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 _createOrUpdate(resourceGroupName, crossConnectionName, parameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, crossConnectionName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ExpressRouteCrossConnection']().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); - }); - }); -} - - -/** - * Updates an express route cross connection tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the cross connection. - * - * @param {object} crossConnectionParameters Parameters supplied to update - * express route cross connection tags. - * - * @param {object} [crossConnectionParameters.tags] Resource tags. - * - * @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 ExpressRouteCrossConnection} 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 _updateTags(resourceGroupName, crossConnectionName, crossConnectionParameters, 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.'); - } - - // Send request - this.beginUpdateTags(resourceGroupName, crossConnectionName, crossConnectionParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ExpressRouteCrossConnection']().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 the currently advertised ARP table associated with the express route - * cross connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device - * - * @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 ExpressRouteCircuitsArpTableListResult} 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 _listArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, 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.'); - } - - // Send request - this.beginListArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ExpressRouteCircuitsArpTableListResult']().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 the route table summary associated with the express route cross - * connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device. - * - * @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 - * ExpressRouteCrossConnectionsRoutesTableSummaryListResult} - * 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 _listRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, 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.'); - } - - // Send request - this.beginListRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ExpressRouteCrossConnectionsRoutesTableSummaryListResult']().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 the currently advertised routes table associated with the express route - * cross connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device. - * - * @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 ExpressRouteCircuitsRoutesTableListResult} - * 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 _listRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, 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.'); - } - - // Send request - this.beginListRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ExpressRouteCircuitsRoutesTableListResult']().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); - }); - }); -} - -/** - * Update the specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {object} parameters Parameters supplied to the update express route - * crossConnection operation. - * - * @param {string} [parameters.peeringLocation] The peering location of the - * ExpressRoute circuit. - * - * @param {number} [parameters.bandwidthInMbps] The circuit bandwidth In Mbps. - * - * @param {object} [parameters.expressRouteCircuit] The ExpressRouteCircuit - * - * @param {string} [parameters.expressRouteCircuit.id] Corresponding Express - * Route Circuit Id. - * - * @param {string} [parameters.serviceProviderProvisioningState] The - * provisioning state of the circuit in the connectivity provider system. - * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' - * - * @param {string} [parameters.serviceProviderNotes] Additional read only notes - * set by the connectivity provider. - * - * @param {array} [parameters.peerings] The list of peerings. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 ExpressRouteCrossConnection} 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 _beginCreateOrUpdate(resourceGroupName, crossConnectionName, parameters, 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-10-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 (crossConnectionName === null || crossConnectionName === undefined || typeof crossConnectionName.valueOf() !== 'string') { - throw new Error('crossConnectionName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/expressRouteCrossConnections/{crossConnectionName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{crossConnectionName}', encodeURIComponent(crossConnectionName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['ExpressRouteCrossConnection']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // 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['ExpressRouteCrossConnection']().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); - }); -} - -/** - * Updates an express route cross connection tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the cross connection. - * - * @param {object} crossConnectionParameters Parameters supplied to update - * express route cross connection tags. - * - * @param {object} [crossConnectionParameters.tags] Resource tags. - * - * @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 ExpressRouteCrossConnection} 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 _beginUpdateTags(resourceGroupName, crossConnectionName, crossConnectionParameters, 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-10-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 (crossConnectionName === null || crossConnectionName === undefined || typeof crossConnectionName.valueOf() !== 'string') { - throw new Error('crossConnectionName cannot be null or undefined and it must be of type string.'); - } - if (crossConnectionParameters === null || crossConnectionParameters === undefined) { - throw new Error('crossConnectionParameters cannot be null or undefined.'); - } - 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/expressRouteCrossConnections/{crossConnectionName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{crossConnectionName}', encodeURIComponent(crossConnectionName)); - 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 = 'PATCH'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (crossConnectionParameters !== null && crossConnectionParameters !== undefined) { - let requestModelMapper = new client.models['TagsObject']().mapper(); - requestModel = client.serialize(requestModelMapper, crossConnectionParameters, 'crossConnectionParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(crossConnectionParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // 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['ExpressRouteCrossConnection']().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 the currently advertised ARP table associated with the express route - * cross connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device - * - * @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 ExpressRouteCircuitsArpTableListResult} 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 _beginListArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, 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-10-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 (crossConnectionName === null || crossConnectionName === undefined || typeof crossConnectionName.valueOf() !== 'string') { - throw new Error('crossConnectionName 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 (devicePath === null || devicePath === undefined || typeof devicePath.valueOf() !== 'string') { - throw new Error('devicePath 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/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{crossConnectionName}', encodeURIComponent(crossConnectionName)); - requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); - requestUrl = requestUrl.replace('{devicePath}', encodeURIComponent(devicePath)); - 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 = 'POST'; - 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 && statusCode !== 202) { - 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['ExpressRouteCircuitsArpTableListResult']().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 the route table summary associated with the express route cross - * connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device. - * - * @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 - * ExpressRouteCrossConnectionsRoutesTableSummaryListResult} - * 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 _beginListRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, 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-10-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 (crossConnectionName === null || crossConnectionName === undefined || typeof crossConnectionName.valueOf() !== 'string') { - throw new Error('crossConnectionName 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 (devicePath === null || devicePath === undefined || typeof devicePath.valueOf() !== 'string') { - throw new Error('devicePath 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/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary/{devicePath}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{crossConnectionName}', encodeURIComponent(crossConnectionName)); - requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); - requestUrl = requestUrl.replace('{devicePath}', encodeURIComponent(devicePath)); - 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 = 'POST'; - 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 && statusCode !== 202) { - 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['ExpressRouteCrossConnectionsRoutesTableSummaryListResult']().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 the currently advertised routes table associated with the express route - * cross connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device. - * - * @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 ExpressRouteCircuitsRoutesTableListResult} - * 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 _beginListRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, 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-10-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 (crossConnectionName === null || crossConnectionName === undefined || typeof crossConnectionName.valueOf() !== 'string') { - throw new Error('crossConnectionName 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 (devicePath === null || devicePath === undefined || typeof devicePath.valueOf() !== 'string') { - throw new Error('devicePath 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/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{crossConnectionName}', encodeURIComponent(crossConnectionName)); - requestUrl = requestUrl.replace('{peeringName}', encodeURIComponent(peeringName)); - requestUrl = requestUrl.replace('{devicePath}', encodeURIComponent(devicePath)); - 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 = 'POST'; - 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 && statusCode !== 202) { - 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['ExpressRouteCircuitsRoutesTableListResult']().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); - }); -} - -/** - * Retrieves all the ExpressRouteCrossConnections in a subscription. - * - * @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 ExpressRouteCrossConnectionListResult} 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['ExpressRouteCrossConnectionListResult']().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); - }); -} - -/** - * Retrieves all the ExpressRouteCrossConnections in a resource group. - * - * @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 ExpressRouteCrossConnectionListResult} 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 _listByResourceGroupNext(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['ExpressRouteCrossConnectionListResult']().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 ExpressRouteCrossConnections. */ -class ExpressRouteCrossConnections { - /** - * Create a ExpressRouteCrossConnections. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._list = _list; - this._listByResourceGroup = _listByResourceGroup; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._updateTags = _updateTags; - this._listArpTable = _listArpTable; - this._listRoutesTableSummary = _listRoutesTableSummary; - this._listRoutesTable = _listRoutesTable; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdateTags = _beginUpdateTags; - this._beginListArpTable = _beginListArpTable; - this._beginListRoutesTableSummary = _beginListRoutesTableSummary; - this._beginListRoutesTable = _beginListRoutesTable; - this._listNext = _listNext; - this._listByResourceGroupNext = _listByResourceGroupNext; - } - - /** - * Retrieves all the ExpressRouteCrossConnections in a subscription. - * - * @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(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the ExpressRouteCrossConnections in a subscription. - * - * @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 {ExpressRouteCrossConnectionListResult} - 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 ExpressRouteCrossConnectionListResult} 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(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(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(options, optionalCallback); - } - } - - /** - * Retrieves all the ExpressRouteCrossConnections in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the ExpressRouteCrossConnections in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {ExpressRouteCrossConnectionListResult} - 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 ExpressRouteCrossConnectionListResult} 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. - */ - listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroup(resourceGroupName, options, optionalCallback); - } - } - - /** - * Gets details about the specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group (peering - * location of the circuit). - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection (service key of the circuit). - * - * @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, crossConnectionName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, crossConnectionName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets details about the specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group (peering - * location of the circuit). - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection (service key of the circuit). - * - * @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 {ExpressRouteCrossConnection} - 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 ExpressRouteCrossConnection} 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, crossConnectionName, 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, crossConnectionName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, crossConnectionName, options, optionalCallback); - } - } - - /** - * Update the specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {object} parameters Parameters supplied to the update express route - * crossConnection operation. - * - * @param {string} [parameters.peeringLocation] The peering location of the - * ExpressRoute circuit. - * - * @param {number} [parameters.bandwidthInMbps] The circuit bandwidth In Mbps. - * - * @param {object} [parameters.expressRouteCircuit] The ExpressRouteCircuit - * - * @param {string} [parameters.expressRouteCircuit.id] Corresponding Express - * Route Circuit Id. - * - * @param {string} [parameters.serviceProviderProvisioningState] The - * provisioning state of the circuit in the connectivity provider system. - * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' - * - * @param {string} [parameters.serviceProviderNotes] Additional read only notes - * set by the connectivity provider. - * - * @param {array} [parameters.peerings] The list of peerings. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, crossConnectionName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, crossConnectionName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Update the specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {object} parameters Parameters supplied to the update express route - * crossConnection operation. - * - * @param {string} [parameters.peeringLocation] The peering location of the - * ExpressRoute circuit. - * - * @param {number} [parameters.bandwidthInMbps] The circuit bandwidth In Mbps. - * - * @param {object} [parameters.expressRouteCircuit] The ExpressRouteCircuit - * - * @param {string} [parameters.expressRouteCircuit.id] Corresponding Express - * Route Circuit Id. - * - * @param {string} [parameters.serviceProviderProvisioningState] The - * provisioning state of the circuit in the connectivity provider system. - * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' - * - * @param {string} [parameters.serviceProviderNotes] Additional read only notes - * set by the connectivity provider. - * - * @param {array} [parameters.peerings] The list of peerings. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ExpressRouteCrossConnection} - 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 ExpressRouteCrossConnection} 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. - */ - createOrUpdate(resourceGroupName, crossConnectionName, parameters, 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._createOrUpdate(resourceGroupName, crossConnectionName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, crossConnectionName, parameters, options, optionalCallback); - } - } - - /** - * Updates an express route cross connection tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the cross connection. - * - * @param {object} crossConnectionParameters Parameters supplied to update - * express route cross connection tags. - * - * @param {object} [crossConnectionParameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName, crossConnectionName, crossConnectionParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateTags(resourceGroupName, crossConnectionName, crossConnectionParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates an express route cross connection tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the cross connection. - * - * @param {object} crossConnectionParameters Parameters supplied to update - * express route cross connection tags. - * - * @param {object} [crossConnectionParameters.tags] Resource tags. - * - * @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 {ExpressRouteCrossConnection} - 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 ExpressRouteCrossConnection} 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. - */ - updateTags(resourceGroupName, crossConnectionName, crossConnectionParameters, 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._updateTags(resourceGroupName, crossConnectionName, crossConnectionParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateTags(resourceGroupName, crossConnectionName, crossConnectionParameters, options, optionalCallback); - } - } - - /** - * Gets the currently advertised ARP table associated with the express route - * cross connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device - * - * @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. - */ - listArpTableWithHttpOperationResponse(resourceGroupName, crossConnectionName, peeringName, devicePath, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, 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 currently advertised ARP table associated with the express route - * cross connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device - * - * @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 {ExpressRouteCircuitsArpTableListResult} - 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 ExpressRouteCircuitsArpTableListResult} 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. - */ - listArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, 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._listArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, options, optionalCallback); - } - } - - /** - * Gets the route table summary associated with the express route cross - * connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device. - * - * @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. - */ - listRoutesTableSummaryWithHttpOperationResponse(resourceGroupName, crossConnectionName, peeringName, devicePath, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, 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 route table summary associated with the express route cross - * connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device. - * - * @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 {ExpressRouteCrossConnectionsRoutesTableSummaryListResult} - 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 - * ExpressRouteCrossConnectionsRoutesTableSummaryListResult} - * 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. - */ - listRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, 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._listRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, options, optionalCallback); - } - } - - /** - * Gets the currently advertised routes table associated with the express route - * cross connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device. - * - * @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. - */ - listRoutesTableWithHttpOperationResponse(resourceGroupName, crossConnectionName, peeringName, devicePath, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, 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 currently advertised routes table associated with the express route - * cross connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device. - * - * @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 {ExpressRouteCircuitsRoutesTableListResult} - 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 ExpressRouteCircuitsRoutesTableListResult} - * 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. - */ - listRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, 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._listRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, options, optionalCallback); - } - } - - /** - * Update the specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {object} parameters Parameters supplied to the update express route - * crossConnection operation. - * - * @param {string} [parameters.peeringLocation] The peering location of the - * ExpressRoute circuit. - * - * @param {number} [parameters.bandwidthInMbps] The circuit bandwidth In Mbps. - * - * @param {object} [parameters.expressRouteCircuit] The ExpressRouteCircuit - * - * @param {string} [parameters.expressRouteCircuit.id] Corresponding Express - * Route Circuit Id. - * - * @param {string} [parameters.serviceProviderProvisioningState] The - * provisioning state of the circuit in the connectivity provider system. - * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' - * - * @param {string} [parameters.serviceProviderNotes] Additional read only notes - * set by the connectivity provider. - * - * @param {array} [parameters.peerings] The list of peerings. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, crossConnectionName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, crossConnectionName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Update the specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {object} parameters Parameters supplied to the update express route - * crossConnection operation. - * - * @param {string} [parameters.peeringLocation] The peering location of the - * ExpressRoute circuit. - * - * @param {number} [parameters.bandwidthInMbps] The circuit bandwidth In Mbps. - * - * @param {object} [parameters.expressRouteCircuit] The ExpressRouteCircuit - * - * @param {string} [parameters.expressRouteCircuit.id] Corresponding Express - * Route Circuit Id. - * - * @param {string} [parameters.serviceProviderProvisioningState] The - * provisioning state of the circuit in the connectivity provider system. - * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' - * - * @param {string} [parameters.serviceProviderNotes] Additional read only notes - * set by the connectivity provider. - * - * @param {array} [parameters.peerings] The list of peerings. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ExpressRouteCrossConnection} - 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 ExpressRouteCrossConnection} 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. - */ - beginCreateOrUpdate(resourceGroupName, crossConnectionName, parameters, 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._beginCreateOrUpdate(resourceGroupName, crossConnectionName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, crossConnectionName, parameters, options, optionalCallback); - } - } - - /** - * Updates an express route cross connection tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the cross connection. - * - * @param {object} crossConnectionParameters Parameters supplied to update - * express route cross connection tags. - * - * @param {object} [crossConnectionParameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName, crossConnectionName, crossConnectionParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginUpdateTags(resourceGroupName, crossConnectionName, crossConnectionParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates an express route cross connection tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the cross connection. - * - * @param {object} crossConnectionParameters Parameters supplied to update - * express route cross connection tags. - * - * @param {object} [crossConnectionParameters.tags] Resource tags. - * - * @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 {ExpressRouteCrossConnection} - 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 ExpressRouteCrossConnection} 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. - */ - beginUpdateTags(resourceGroupName, crossConnectionName, crossConnectionParameters, 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._beginUpdateTags(resourceGroupName, crossConnectionName, crossConnectionParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginUpdateTags(resourceGroupName, crossConnectionName, crossConnectionParameters, options, optionalCallback); - } - } - - /** - * Gets the currently advertised ARP table associated with the express route - * cross connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device - * - * @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. - */ - beginListArpTableWithHttpOperationResponse(resourceGroupName, crossConnectionName, peeringName, devicePath, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginListArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, 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 currently advertised ARP table associated with the express route - * cross connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device - * - * @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 {ExpressRouteCircuitsArpTableListResult} - 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 ExpressRouteCircuitsArpTableListResult} 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. - */ - beginListArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, 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._beginListArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginListArpTable(resourceGroupName, crossConnectionName, peeringName, devicePath, options, optionalCallback); - } - } - - /** - * Gets the route table summary associated with the express route cross - * connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device. - * - * @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. - */ - beginListRoutesTableSummaryWithHttpOperationResponse(resourceGroupName, crossConnectionName, peeringName, devicePath, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginListRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, 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 route table summary associated with the express route cross - * connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device. - * - * @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 {ExpressRouteCrossConnectionsRoutesTableSummaryListResult} - 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 - * ExpressRouteCrossConnectionsRoutesTableSummaryListResult} - * 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. - */ - beginListRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, 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._beginListRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginListRoutesTableSummary(resourceGroupName, crossConnectionName, peeringName, devicePath, options, optionalCallback); - } - } - - /** - * Gets the currently advertised routes table associated with the express route - * cross connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device. - * - * @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. - */ - beginListRoutesTableWithHttpOperationResponse(resourceGroupName, crossConnectionName, peeringName, devicePath, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginListRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, 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 currently advertised routes table associated with the express route - * cross connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device. - * - * @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 {ExpressRouteCircuitsRoutesTableListResult} - 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 ExpressRouteCircuitsRoutesTableListResult} - * 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. - */ - beginListRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, 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._beginListRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginListRoutesTable(resourceGroupName, crossConnectionName, peeringName, devicePath, options, optionalCallback); - } - } - - /** - * Retrieves all the ExpressRouteCrossConnections in a subscription. - * - * @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; - }); - }); - } - - /** - * Retrieves all the ExpressRouteCrossConnections in a subscription. - * - * @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 {ExpressRouteCrossConnectionListResult} - 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 ExpressRouteCrossConnectionListResult} 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); - } - } - - /** - * Retrieves all the ExpressRouteCrossConnections in a resource group. - * - * @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. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the ExpressRouteCrossConnections in a resource group. - * - * @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 {ExpressRouteCrossConnectionListResult} - 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 ExpressRouteCrossConnectionListResult} 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. - */ - listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = ExpressRouteCrossConnections; diff --git a/lib/services/networkManagement2/lib/operations/expressRouteGateways.js b/lib/services/networkManagement2/lib/operations/expressRouteGateways.js deleted file mode 100644 index 21a00d5b3..000000000 --- a/lib/services/networkManagement2/lib/operations/expressRouteGateways.js +++ /dev/null @@ -1,1707 +0,0 @@ -/* - * 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; - -/** - * Lists ExpressRoute gateways under a given subscription. - * - * @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 ExpressRouteGatewayList} 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 _listBySubscription(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/expressRouteGateways'; - 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['ExpressRouteGatewayList']().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); - }); -} - -/** - * Lists ExpressRoute gateways in a given resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 ExpressRouteGatewayList} 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 _listByResourceGroup(resourceGroupName, 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-10-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 (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/expressRouteGateways'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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['ExpressRouteGatewayList']().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); - }); -} - - -/** - * Creates or updates a ExpressRoute gateway in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {object} putExpressRouteGatewayParameters Parameters required in an - * ExpressRoute gateway PUT operation. - * - * @param {object} [putExpressRouteGatewayParameters.autoScaleConfiguration] - * Configuration for auto scaling. - * - * @param {object} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds] Minimum and - * maximum number of scale units to deploy. - * - * @param {number} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds.min] Minimum - * number of scale units deployed for ExpressRoute gateway. - * - * @param {number} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds.max] Maximum - * number of scale units deployed for ExpressRoute gateway. - * - * @param {object} putExpressRouteGatewayParameters.virtualHub The Virtual Hub - * where the ExpressRoute gateway is or will be deployed. - * - * @param {string} [putExpressRouteGatewayParameters.virtualHub.id] The - * resource URI for the Virtual Hub where the ExpressRoute gateway is or will - * be deployed. The Virtual Hub resource and the ExpressRoute gateway resource - * reside in the same subscription. - * - * @param {string} [putExpressRouteGatewayParameters.id] Resource ID. - * - * @param {string} [putExpressRouteGatewayParameters.location] Resource - * location. - * - * @param {object} [putExpressRouteGatewayParameters.tags] Resource tags. - * - * @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 ExpressRouteGateway} 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 _createOrUpdate(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ExpressRouteGateway']().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); - }); - }); -} - -/** - * Fetches the details of a ExpressRoute gateway in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @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 ExpressRouteGateway} 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, expressRouteGatewayName, 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-10-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 (expressRouteGatewayName === null || expressRouteGatewayName === undefined || typeof expressRouteGatewayName.valueOf() !== 'string') { - throw new Error('expressRouteGatewayName 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/expressRouteGateways/{expressRouteGatewayName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{expressRouteGatewayName}', encodeURIComponent(expressRouteGatewayName)); - 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['ExpressRouteGateway']().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); - }); -} - - -/** - * Deletes the specified ExpressRoute gateway in a resource group. An - * ExpressRoute gateway resource can only be deleted when there are no - * connection subresources. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, expressRouteGatewayName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, expressRouteGatewayName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Creates or updates a ExpressRoute gateway in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {object} putExpressRouteGatewayParameters Parameters required in an - * ExpressRoute gateway PUT operation. - * - * @param {object} [putExpressRouteGatewayParameters.autoScaleConfiguration] - * Configuration for auto scaling. - * - * @param {object} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds] Minimum and - * maximum number of scale units to deploy. - * - * @param {number} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds.min] Minimum - * number of scale units deployed for ExpressRoute gateway. - * - * @param {number} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds.max] Maximum - * number of scale units deployed for ExpressRoute gateway. - * - * @param {object} putExpressRouteGatewayParameters.virtualHub The Virtual Hub - * where the ExpressRoute gateway is or will be deployed. - * - * @param {string} [putExpressRouteGatewayParameters.virtualHub.id] The - * resource URI for the Virtual Hub where the ExpressRoute gateway is or will - * be deployed. The Virtual Hub resource and the ExpressRoute gateway resource - * reside in the same subscription. - * - * @param {string} [putExpressRouteGatewayParameters.id] Resource ID. - * - * @param {string} [putExpressRouteGatewayParameters.location] Resource - * location. - * - * @param {object} [putExpressRouteGatewayParameters.tags] Resource tags. - * - * @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 ExpressRouteGateway} 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 _beginCreateOrUpdate(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, 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-10-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 (expressRouteGatewayName === null || expressRouteGatewayName === undefined || typeof expressRouteGatewayName.valueOf() !== 'string') { - throw new Error('expressRouteGatewayName cannot be null or undefined and it must be of type string.'); - } - if (putExpressRouteGatewayParameters === null || putExpressRouteGatewayParameters === undefined) { - throw new Error('putExpressRouteGatewayParameters cannot be null or undefined.'); - } - 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/expressRouteGateways/{expressRouteGatewayName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{expressRouteGatewayName}', encodeURIComponent(expressRouteGatewayName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (putExpressRouteGatewayParameters !== null && putExpressRouteGatewayParameters !== undefined) { - let requestModelMapper = new client.models['ExpressRouteGateway']().mapper(); - requestModel = client.serialize(requestModelMapper, putExpressRouteGatewayParameters, 'putExpressRouteGatewayParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(putExpressRouteGatewayParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['ExpressRouteGateway']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ExpressRouteGateway']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Deletes the specified ExpressRoute gateway in a resource group. An - * ExpressRoute gateway resource can only be deleted when there are no - * connection subresources. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, expressRouteGatewayName, 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-10-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 (expressRouteGatewayName === null || expressRouteGatewayName === undefined || typeof expressRouteGatewayName.valueOf() !== 'string') { - throw new Error('expressRouteGatewayName 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/expressRouteGateways/{expressRouteGatewayName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{expressRouteGatewayName}', encodeURIComponent(expressRouteGatewayName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** Class representing a ExpressRouteGateways. */ -class ExpressRouteGateways { - /** - * Create a ExpressRouteGateways. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._listBySubscription = _listBySubscription; - this._listByResourceGroup = _listByResourceGroup; - this._createOrUpdate = _createOrUpdate; - this._get = _get; - this._deleteMethod = _deleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginDeleteMethod = _beginDeleteMethod; - } - - /** - * Lists ExpressRoute gateways under a given subscription. - * - * @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. - */ - listBySubscriptionWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listBySubscription(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists ExpressRoute gateways under a given subscription. - * - * @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 {ExpressRouteGatewayList} - 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 ExpressRouteGatewayList} 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. - */ - listBySubscription(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._listBySubscription(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listBySubscription(options, optionalCallback); - } - } - - /** - * Lists ExpressRoute gateways in a given resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists ExpressRoute gateways in a given resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {ExpressRouteGatewayList} - 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 ExpressRouteGatewayList} 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. - */ - listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroup(resourceGroupName, options, optionalCallback); - } - } - - /** - * Creates or updates a ExpressRoute gateway in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {object} putExpressRouteGatewayParameters Parameters required in an - * ExpressRoute gateway PUT operation. - * - * @param {object} [putExpressRouteGatewayParameters.autoScaleConfiguration] - * Configuration for auto scaling. - * - * @param {object} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds] Minimum and - * maximum number of scale units to deploy. - * - * @param {number} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds.min] Minimum - * number of scale units deployed for ExpressRoute gateway. - * - * @param {number} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds.max] Maximum - * number of scale units deployed for ExpressRoute gateway. - * - * @param {object} putExpressRouteGatewayParameters.virtualHub The Virtual Hub - * where the ExpressRoute gateway is or will be deployed. - * - * @param {string} [putExpressRouteGatewayParameters.virtualHub.id] The - * resource URI for the Virtual Hub where the ExpressRoute gateway is or will - * be deployed. The Virtual Hub resource and the ExpressRoute gateway resource - * reside in the same subscription. - * - * @param {string} [putExpressRouteGatewayParameters.id] Resource ID. - * - * @param {string} [putExpressRouteGatewayParameters.location] Resource - * location. - * - * @param {object} [putExpressRouteGatewayParameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a ExpressRoute gateway in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {object} putExpressRouteGatewayParameters Parameters required in an - * ExpressRoute gateway PUT operation. - * - * @param {object} [putExpressRouteGatewayParameters.autoScaleConfiguration] - * Configuration for auto scaling. - * - * @param {object} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds] Minimum and - * maximum number of scale units to deploy. - * - * @param {number} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds.min] Minimum - * number of scale units deployed for ExpressRoute gateway. - * - * @param {number} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds.max] Maximum - * number of scale units deployed for ExpressRoute gateway. - * - * @param {object} putExpressRouteGatewayParameters.virtualHub The Virtual Hub - * where the ExpressRoute gateway is or will be deployed. - * - * @param {string} [putExpressRouteGatewayParameters.virtualHub.id] The - * resource URI for the Virtual Hub where the ExpressRoute gateway is or will - * be deployed. The Virtual Hub resource and the ExpressRoute gateway resource - * reside in the same subscription. - * - * @param {string} [putExpressRouteGatewayParameters.id] Resource ID. - * - * @param {string} [putExpressRouteGatewayParameters.location] Resource - * location. - * - * @param {object} [putExpressRouteGatewayParameters.tags] Resource tags. - * - * @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 {ExpressRouteGateway} - 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 ExpressRouteGateway} 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. - */ - createOrUpdate(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, 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._createOrUpdate(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, options, optionalCallback); - } - } - - /** - * Fetches the details of a ExpressRoute gateway in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @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, expressRouteGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, expressRouteGatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Fetches the details of a ExpressRoute gateway in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @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 {ExpressRouteGateway} - 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 ExpressRouteGateway} 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, expressRouteGatewayName, 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, expressRouteGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, expressRouteGatewayName, options, optionalCallback); - } - } - - /** - * Deletes the specified ExpressRoute gateway in a resource group. An - * ExpressRoute gateway resource can only be deleted when there are no - * connection subresources. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, expressRouteGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, expressRouteGatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified ExpressRoute gateway in a resource group. An - * ExpressRoute gateway resource can only be deleted when there are no - * connection subresources. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, expressRouteGatewayName, 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._deleteMethod(resourceGroupName, expressRouteGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, expressRouteGatewayName, options, optionalCallback); - } - } - - /** - * Creates or updates a ExpressRoute gateway in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {object} putExpressRouteGatewayParameters Parameters required in an - * ExpressRoute gateway PUT operation. - * - * @param {object} [putExpressRouteGatewayParameters.autoScaleConfiguration] - * Configuration for auto scaling. - * - * @param {object} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds] Minimum and - * maximum number of scale units to deploy. - * - * @param {number} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds.min] Minimum - * number of scale units deployed for ExpressRoute gateway. - * - * @param {number} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds.max] Maximum - * number of scale units deployed for ExpressRoute gateway. - * - * @param {object} putExpressRouteGatewayParameters.virtualHub The Virtual Hub - * where the ExpressRoute gateway is or will be deployed. - * - * @param {string} [putExpressRouteGatewayParameters.virtualHub.id] The - * resource URI for the Virtual Hub where the ExpressRoute gateway is or will - * be deployed. The Virtual Hub resource and the ExpressRoute gateway resource - * reside in the same subscription. - * - * @param {string} [putExpressRouteGatewayParameters.id] Resource ID. - * - * @param {string} [putExpressRouteGatewayParameters.location] Resource - * location. - * - * @param {object} [putExpressRouteGatewayParameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a ExpressRoute gateway in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {object} putExpressRouteGatewayParameters Parameters required in an - * ExpressRoute gateway PUT operation. - * - * @param {object} [putExpressRouteGatewayParameters.autoScaleConfiguration] - * Configuration for auto scaling. - * - * @param {object} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds] Minimum and - * maximum number of scale units to deploy. - * - * @param {number} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds.min] Minimum - * number of scale units deployed for ExpressRoute gateway. - * - * @param {number} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds.max] Maximum - * number of scale units deployed for ExpressRoute gateway. - * - * @param {object} putExpressRouteGatewayParameters.virtualHub The Virtual Hub - * where the ExpressRoute gateway is or will be deployed. - * - * @param {string} [putExpressRouteGatewayParameters.virtualHub.id] The - * resource URI for the Virtual Hub where the ExpressRoute gateway is or will - * be deployed. The Virtual Hub resource and the ExpressRoute gateway resource - * reside in the same subscription. - * - * @param {string} [putExpressRouteGatewayParameters.id] Resource ID. - * - * @param {string} [putExpressRouteGatewayParameters.location] Resource - * location. - * - * @param {object} [putExpressRouteGatewayParameters.tags] Resource tags. - * - * @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 {ExpressRouteGateway} - 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 ExpressRouteGateway} 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. - */ - beginCreateOrUpdate(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, 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._beginCreateOrUpdate(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters, options, optionalCallback); - } - } - - /** - * Deletes the specified ExpressRoute gateway in a resource group. An - * ExpressRoute gateway resource can only be deleted when there are no - * connection subresources. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, expressRouteGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, expressRouteGatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified ExpressRoute gateway in a resource group. An - * ExpressRoute gateway resource can only be deleted when there are no - * connection subresources. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, expressRouteGatewayName, 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._beginDeleteMethod(resourceGroupName, expressRouteGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, expressRouteGatewayName, options, optionalCallback); - } - } - -} - -module.exports = ExpressRouteGateways; diff --git a/lib/services/networkManagement2/lib/operations/expressRouteLinks.js b/lib/services/networkManagement2/lib/operations/expressRouteLinks.js deleted file mode 100644 index a3e698b8e..000000000 --- a/lib/services/networkManagement2/lib/operations/expressRouteLinks.js +++ /dev/null @@ -1,727 +0,0 @@ -/* - * 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; - -/** - * Retrieves the specified ExpressRouteLink resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @param {string} linkName The name of the ExpressRouteLink resource. - * - * @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 ExpressRouteLink} 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, expressRoutePortName, linkName, 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-10-01'; - // Validate - try { - 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 (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 (expressRoutePortName === null || expressRoutePortName === undefined || typeof expressRoutePortName.valueOf() !== 'string') { - throw new Error('expressRoutePortName cannot be null or undefined and it must be of type string.'); - } - if (linkName === null || linkName === undefined || typeof linkName.valueOf() !== 'string') { - throw new Error('linkName 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/ExpressRoutePorts/{expressRoutePortName}/links/{linkName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{expressRoutePortName}', encodeURIComponent(expressRoutePortName)); - requestUrl = requestUrl.replace('{linkName}', encodeURIComponent(linkName)); - 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['ExpressRouteLink']().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); - }); -} - -/** - * Retrieve the ExpressRouteLink sub-resources of the specified - * ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @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 ExpressRouteLinkListResult} 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, expressRoutePortName, 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-10-01'; - // Validate - try { - 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 (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 (expressRoutePortName === null || expressRoutePortName === undefined || typeof expressRoutePortName.valueOf() !== 'string') { - throw new Error('expressRoutePortName 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/ExpressRoutePorts/{expressRoutePortName}/links'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{expressRoutePortName}', encodeURIComponent(expressRoutePortName)); - 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['ExpressRouteLinkListResult']().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); - }); -} - -/** - * Retrieve the ExpressRouteLink sub-resources of the specified - * ExpressRoutePort resource. - * - * @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 ExpressRouteLinkListResult} 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['ExpressRouteLinkListResult']().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 ExpressRouteLinks. */ -class ExpressRouteLinks { - /** - * Create a ExpressRouteLinks. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._get = _get; - this._list = _list; - this._listNext = _listNext; - } - - /** - * Retrieves the specified ExpressRouteLink resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @param {string} linkName The name of the ExpressRouteLink resource. - * - * @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, expressRoutePortName, linkName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, expressRoutePortName, linkName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves the specified ExpressRouteLink resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @param {string} linkName The name of the ExpressRouteLink resource. - * - * @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 {ExpressRouteLink} - 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 ExpressRouteLink} 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, expressRoutePortName, linkName, 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, expressRoutePortName, linkName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, expressRoutePortName, linkName, options, optionalCallback); - } - } - - /** - * Retrieve the ExpressRouteLink sub-resources of the specified - * ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @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, expressRoutePortName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, expressRoutePortName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieve the ExpressRouteLink sub-resources of the specified - * ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @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 {ExpressRouteLinkListResult} - 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 ExpressRouteLinkListResult} 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, expressRoutePortName, 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, expressRoutePortName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, expressRoutePortName, options, optionalCallback); - } - } - - /** - * Retrieve the ExpressRouteLink sub-resources of the specified - * ExpressRoutePort resource. - * - * @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; - }); - }); - } - - /** - * Retrieve the ExpressRouteLink sub-resources of the specified - * ExpressRoutePort resource. - * - * @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 {ExpressRouteLinkListResult} - 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 ExpressRouteLinkListResult} 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 = ExpressRouteLinks; diff --git a/lib/services/networkManagement2/lib/operations/expressRoutePorts.js b/lib/services/networkManagement2/lib/operations/expressRoutePorts.js deleted file mode 100644 index 2b78ede84..000000000 --- a/lib/services/networkManagement2/lib/operations/expressRoutePorts.js +++ /dev/null @@ -1,2514 +0,0 @@ -/* - * 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; - - -/** - * Deletes the specified ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, expressRoutePortName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, expressRoutePortName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Retrieves the requested ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of ExpressRoutePort. - * - * @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 ExpressRoutePort} 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, expressRoutePortName, 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-10-01'; - // Validate - try { - 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 (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 (expressRoutePortName === null || expressRoutePortName === undefined || typeof expressRoutePortName.valueOf() !== 'string') { - throw new Error('expressRoutePortName 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/ExpressRoutePorts/{expressRoutePortName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{expressRoutePortName}', encodeURIComponent(expressRoutePortName)); - 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['ExpressRoutePort']().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); - }); -} - - -/** - * Creates or updates the specified ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @param {object} parameters Parameters supplied to the create - * ExpressRoutePort operation. - * - * @param {string} [parameters.peeringLocation] The name of the peering - * location that the ExpressRoutePort is mapped to physically. - * - * @param {number} [parameters.bandwidthInGbps] Bandwidth of procured ports in - * Gbps - * - * @param {string} [parameters.encapsulation] Encapsulation method on physical - * ports. Possible values include: 'Dot1Q', 'QinQ' - * - * @param {array} [parameters.links] ExpressRouteLink Sub-Resources The set of - * physical links of the ExpressRoutePort resource - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * ExpressRoutePort resource. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 ExpressRoutePort} 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 _createOrUpdate(resourceGroupName, expressRoutePortName, parameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, expressRoutePortName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ExpressRoutePort']().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); - }); - }); -} - - -/** - * Update ExpressRoutePort tags - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @param {object} parameters Parameters supplied to update ExpressRoutePort - * resource tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 ExpressRoutePort} 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 _updateTags(resourceGroupName, expressRoutePortName, parameters, 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.'); - } - - // Send request - this.beginUpdateTags(resourceGroupName, expressRoutePortName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ExpressRoutePort']().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); - }); - }); -} - -/** - * List all the ExpressRoutePort resources in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 ExpressRoutePortListResult} 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 _listByResourceGroup(resourceGroupName, 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-10-01'; - // Validate - try { - 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 (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 (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/ExpressRoutePorts'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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['ExpressRoutePortListResult']().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); - }); -} - -/** - * List all the ExpressRoutePort resources in the specified subscription - * - * @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 ExpressRoutePortListResult} 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(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/ExpressRoutePorts'; - 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['ExpressRoutePortListResult']().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); - }); -} - -/** - * Deletes the specified ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, expressRoutePortName, 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-10-01'; - // Validate - try { - 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 (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 (expressRoutePortName === null || expressRoutePortName === undefined || typeof expressRoutePortName.valueOf() !== 'string') { - throw new Error('expressRoutePortName 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/ExpressRoutePorts/{expressRoutePortName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{expressRoutePortName}', encodeURIComponent(expressRoutePortName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates the specified ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @param {object} parameters Parameters supplied to the create - * ExpressRoutePort operation. - * - * @param {string} [parameters.peeringLocation] The name of the peering - * location that the ExpressRoutePort is mapped to physically. - * - * @param {number} [parameters.bandwidthInGbps] Bandwidth of procured ports in - * Gbps - * - * @param {string} [parameters.encapsulation] Encapsulation method on physical - * ports. Possible values include: 'Dot1Q', 'QinQ' - * - * @param {array} [parameters.links] ExpressRouteLink Sub-Resources The set of - * physical links of the ExpressRoutePort resource - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * ExpressRoutePort resource. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 ExpressRoutePort} 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 _beginCreateOrUpdate(resourceGroupName, expressRoutePortName, parameters, 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-10-01'; - // Validate - try { - 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 (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 (expressRoutePortName === null || expressRoutePortName === undefined || typeof expressRoutePortName.valueOf() !== 'string') { - throw new Error('expressRoutePortName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/ExpressRoutePorts/{expressRoutePortName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{expressRoutePortName}', encodeURIComponent(expressRoutePortName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['ExpressRoutePort']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['ExpressRoutePort']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ExpressRoutePort']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Update ExpressRoutePort tags - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @param {object} parameters Parameters supplied to update ExpressRoutePort - * resource tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 ExpressRoutePort} 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 _beginUpdateTags(resourceGroupName, expressRoutePortName, parameters, 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-10-01'; - // Validate - try { - 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 (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 (expressRoutePortName === null || expressRoutePortName === undefined || typeof expressRoutePortName.valueOf() !== 'string') { - throw new Error('expressRoutePortName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/ExpressRoutePorts/{expressRoutePortName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{expressRoutePortName}', encodeURIComponent(expressRoutePortName)); - 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 = 'PATCH'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['TagsObject']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // 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['ExpressRoutePort']().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); - }); -} - -/** - * List all the ExpressRoutePort resources in the specified resource group. - * - * @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 ExpressRoutePortListResult} 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 _listByResourceGroupNext(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['ExpressRoutePortListResult']().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); - }); -} - -/** - * List all the ExpressRoutePort resources in the specified subscription - * - * @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 ExpressRoutePortListResult} 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['ExpressRoutePortListResult']().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 ExpressRoutePorts. */ -class ExpressRoutePorts { - /** - * Create a ExpressRoutePorts. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._updateTags = _updateTags; - this._listByResourceGroup = _listByResourceGroup; - this._list = _list; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdateTags = _beginUpdateTags; - this._listByResourceGroupNext = _listByResourceGroupNext; - this._listNext = _listNext; - } - - /** - * Deletes the specified ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, expressRoutePortName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, expressRoutePortName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, expressRoutePortName, 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._deleteMethod(resourceGroupName, expressRoutePortName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, expressRoutePortName, options, optionalCallback); - } - } - - /** - * Retrieves the requested ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of ExpressRoutePort. - * - * @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, expressRoutePortName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, expressRoutePortName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves the requested ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of ExpressRoutePort. - * - * @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 {ExpressRoutePort} - 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 ExpressRoutePort} 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, expressRoutePortName, 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, expressRoutePortName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, expressRoutePortName, options, optionalCallback); - } - } - - /** - * Creates or updates the specified ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @param {object} parameters Parameters supplied to the create - * ExpressRoutePort operation. - * - * @param {string} [parameters.peeringLocation] The name of the peering - * location that the ExpressRoutePort is mapped to physically. - * - * @param {number} [parameters.bandwidthInGbps] Bandwidth of procured ports in - * Gbps - * - * @param {string} [parameters.encapsulation] Encapsulation method on physical - * ports. Possible values include: 'Dot1Q', 'QinQ' - * - * @param {array} [parameters.links] ExpressRouteLink Sub-Resources The set of - * physical links of the ExpressRoutePort resource - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * ExpressRoutePort resource. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, expressRoutePortName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, expressRoutePortName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the specified ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @param {object} parameters Parameters supplied to the create - * ExpressRoutePort operation. - * - * @param {string} [parameters.peeringLocation] The name of the peering - * location that the ExpressRoutePort is mapped to physically. - * - * @param {number} [parameters.bandwidthInGbps] Bandwidth of procured ports in - * Gbps - * - * @param {string} [parameters.encapsulation] Encapsulation method on physical - * ports. Possible values include: 'Dot1Q', 'QinQ' - * - * @param {array} [parameters.links] ExpressRouteLink Sub-Resources The set of - * physical links of the ExpressRoutePort resource - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * ExpressRoutePort resource. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ExpressRoutePort} - 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 ExpressRoutePort} 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. - */ - createOrUpdate(resourceGroupName, expressRoutePortName, parameters, 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._createOrUpdate(resourceGroupName, expressRoutePortName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, expressRoutePortName, parameters, options, optionalCallback); - } - } - - /** - * Update ExpressRoutePort tags - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @param {object} parameters Parameters supplied to update ExpressRoutePort - * resource tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName, expressRoutePortName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateTags(resourceGroupName, expressRoutePortName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Update ExpressRoutePort tags - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @param {object} parameters Parameters supplied to update ExpressRoutePort - * resource tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ExpressRoutePort} - 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 ExpressRoutePort} 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. - */ - updateTags(resourceGroupName, expressRoutePortName, parameters, 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._updateTags(resourceGroupName, expressRoutePortName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateTags(resourceGroupName, expressRoutePortName, parameters, options, optionalCallback); - } - } - - /** - * List all the ExpressRoutePort resources in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * List all the ExpressRoutePort resources in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {ExpressRoutePortListResult} - 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 ExpressRoutePortListResult} 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. - */ - listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroup(resourceGroupName, options, optionalCallback); - } - } - - /** - * List all the ExpressRoutePort resources in the specified subscription - * - * @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(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * List all the ExpressRoutePort resources in the specified subscription - * - * @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 {ExpressRoutePortListResult} - 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 ExpressRoutePortListResult} 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(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(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(options, optionalCallback); - } - } - - /** - * Deletes the specified ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, expressRoutePortName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, expressRoutePortName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, expressRoutePortName, 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._beginDeleteMethod(resourceGroupName, expressRoutePortName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, expressRoutePortName, options, optionalCallback); - } - } - - /** - * Creates or updates the specified ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @param {object} parameters Parameters supplied to the create - * ExpressRoutePort operation. - * - * @param {string} [parameters.peeringLocation] The name of the peering - * location that the ExpressRoutePort is mapped to physically. - * - * @param {number} [parameters.bandwidthInGbps] Bandwidth of procured ports in - * Gbps - * - * @param {string} [parameters.encapsulation] Encapsulation method on physical - * ports. Possible values include: 'Dot1Q', 'QinQ' - * - * @param {array} [parameters.links] ExpressRouteLink Sub-Resources The set of - * physical links of the ExpressRoutePort resource - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * ExpressRoutePort resource. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, expressRoutePortName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, expressRoutePortName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the specified ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @param {object} parameters Parameters supplied to the create - * ExpressRoutePort operation. - * - * @param {string} [parameters.peeringLocation] The name of the peering - * location that the ExpressRoutePort is mapped to physically. - * - * @param {number} [parameters.bandwidthInGbps] Bandwidth of procured ports in - * Gbps - * - * @param {string} [parameters.encapsulation] Encapsulation method on physical - * ports. Possible values include: 'Dot1Q', 'QinQ' - * - * @param {array} [parameters.links] ExpressRouteLink Sub-Resources The set of - * physical links of the ExpressRoutePort resource - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * ExpressRoutePort resource. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ExpressRoutePort} - 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 ExpressRoutePort} 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. - */ - beginCreateOrUpdate(resourceGroupName, expressRoutePortName, parameters, 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._beginCreateOrUpdate(resourceGroupName, expressRoutePortName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, expressRoutePortName, parameters, options, optionalCallback); - } - } - - /** - * Update ExpressRoutePort tags - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @param {object} parameters Parameters supplied to update ExpressRoutePort - * resource tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName, expressRoutePortName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginUpdateTags(resourceGroupName, expressRoutePortName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Update ExpressRoutePort tags - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @param {object} parameters Parameters supplied to update ExpressRoutePort - * resource tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ExpressRoutePort} - 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 ExpressRoutePort} 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. - */ - beginUpdateTags(resourceGroupName, expressRoutePortName, parameters, 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._beginUpdateTags(resourceGroupName, expressRoutePortName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginUpdateTags(resourceGroupName, expressRoutePortName, parameters, options, optionalCallback); - } - } - - /** - * List all the ExpressRoutePort resources in the specified resource group. - * - * @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. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * List all the ExpressRoutePort resources in the specified resource group. - * - * @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 {ExpressRoutePortListResult} - 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 ExpressRoutePortListResult} 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. - */ - listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); - } - } - - /** - * List all the ExpressRoutePort resources in the specified subscription - * - * @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; - }); - }); - } - - /** - * List all the ExpressRoutePort resources in the specified subscription - * - * @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 {ExpressRoutePortListResult} - 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 ExpressRoutePortListResult} 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 = ExpressRoutePorts; diff --git a/lib/services/networkManagement2/lib/operations/expressRoutePortsLocations.js b/lib/services/networkManagement2/lib/operations/expressRoutePortsLocations.js deleted file mode 100644 index d947f57ec..000000000 --- a/lib/services/networkManagement2/lib/operations/expressRoutePortsLocations.js +++ /dev/null @@ -1,695 +0,0 @@ -/* - * 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; - -/** - * Retrieves all ExpressRoutePort peering locations. Does not return available - * bandwidths for each location. Available bandwidths can only be obtained when - * retriving a specific peering location. - * - * @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 ExpressRoutePortsLocationListResult} 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(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/ExpressRoutePortsLocations'; - 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['ExpressRoutePortsLocationListResult']().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); - }); -} - -/** - * Retrieves a single ExpressRoutePort peering location, including the list of - * available bandwidths available at said peering location. - * - * @param {string} locationName Name of the requested ExpressRoutePort peering - * location. - * - * @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 ExpressRoutePortsLocation} 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(locationName, 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-10-01'; - // Validate - try { - 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 (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { - throw new Error('locationName 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}/providers/Microsoft.Network/ExpressRoutePortsLocations/{locationName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); - 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['ExpressRoutePortsLocation']().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); - }); -} - -/** - * Retrieves all ExpressRoutePort peering locations. Does not return available - * bandwidths for each location. Available bandwidths can only be obtained when - * retriving a specific peering location. - * - * @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 ExpressRoutePortsLocationListResult} 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['ExpressRoutePortsLocationListResult']().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 ExpressRoutePortsLocations. */ -class ExpressRoutePortsLocations { - /** - * Create a ExpressRoutePortsLocations. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._list = _list; - this._get = _get; - this._listNext = _listNext; - } - - /** - * Retrieves all ExpressRoutePort peering locations. Does not return available - * bandwidths for each location. Available bandwidths can only be obtained when - * retriving a specific peering location. - * - * @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(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all ExpressRoutePort peering locations. Does not return available - * bandwidths for each location. Available bandwidths can only be obtained when - * retriving a specific peering location. - * - * @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 {ExpressRoutePortsLocationListResult} - 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 ExpressRoutePortsLocationListResult} 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(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(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(options, optionalCallback); - } - } - - /** - * Retrieves a single ExpressRoutePort peering location, including the list of - * available bandwidths available at said peering location. - * - * @param {string} locationName Name of the requested ExpressRoutePort peering - * location. - * - * @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(locationName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(locationName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves a single ExpressRoutePort peering location, including the list of - * available bandwidths available at said peering location. - * - * @param {string} locationName Name of the requested ExpressRoutePort peering - * location. - * - * @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 {ExpressRoutePortsLocation} - 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 ExpressRoutePortsLocation} 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(locationName, 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(locationName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(locationName, options, optionalCallback); - } - } - - /** - * Retrieves all ExpressRoutePort peering locations. Does not return available - * bandwidths for each location. Available bandwidths can only be obtained when - * retriving a specific peering location. - * - * @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; - }); - }); - } - - /** - * Retrieves all ExpressRoutePort peering locations. Does not return available - * bandwidths for each location. Available bandwidths can only be obtained when - * retriving a specific peering location. - * - * @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 {ExpressRoutePortsLocationListResult} - 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 ExpressRoutePortsLocationListResult} 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 = ExpressRoutePortsLocations; diff --git a/lib/services/networkManagement2/lib/operations/expressRouteServiceProviders.js b/lib/services/networkManagement2/lib/operations/expressRouteServiceProviders.js deleted file mode 100644 index 8a848a5f7..000000000 --- a/lib/services/networkManagement2/lib/operations/expressRouteServiceProviders.js +++ /dev/null @@ -1,455 +0,0 @@ -/* - * 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 all the available express route service providers. - * - * @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 ExpressRouteServiceProviderListResult} 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(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/expressRouteServiceProviders'; - 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['ExpressRouteServiceProviderListResult']().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 the available express route service providers. - * - * @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 ExpressRouteServiceProviderListResult} 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['ExpressRouteServiceProviderListResult']().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 ExpressRouteServiceProviders. */ -class ExpressRouteServiceProviders { - /** - * Create a ExpressRouteServiceProviders. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._list = _list; - this._listNext = _listNext; - } - - /** - * Gets all the available express route service providers. - * - * @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(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(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 the available express route service providers. - * - * @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 {ExpressRouteServiceProviderListResult} - 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 ExpressRouteServiceProviderListResult} 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(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(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(options, optionalCallback); - } - } - - /** - * Gets all the available express route service providers. - * - * @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 the available express route service providers. - * - * @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 {ExpressRouteServiceProviderListResult} - 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 ExpressRouteServiceProviderListResult} 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 = ExpressRouteServiceProviders; diff --git a/lib/services/networkManagement2/lib/operations/hubVirtualNetworkConnections.js b/lib/services/networkManagement2/lib/operations/hubVirtualNetworkConnections.js deleted file mode 100644 index 5940773bc..000000000 --- a/lib/services/networkManagement2/lib/operations/hubVirtualNetworkConnections.js +++ /dev/null @@ -1,720 +0,0 @@ -/* - * 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; - -/** - * Retrieves the details of a HubVirtualNetworkConnection. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @param {string} connectionName The name of the vpn 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 HubVirtualNetworkConnection} 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, virtualHubName, 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-10-01'; - // Validate - try { - 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 (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 (virtualHubName === null || virtualHubName === undefined || typeof virtualHubName.valueOf() !== 'string') { - throw new Error('virtualHubName 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.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/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualHubName}', encodeURIComponent(virtualHubName)); - requestUrl = requestUrl.replace('{connectionName}', encodeURIComponent(connectionName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['HubVirtualNetworkConnection']().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); - }); -} - -/** - * Retrieves the details of all HubVirtualNetworkConnections. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @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 ListHubVirtualNetworkConnectionsResult} 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, virtualHubName, 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-10-01'; - // Validate - try { - 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 (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 (virtualHubName === null || virtualHubName === undefined || typeof virtualHubName.valueOf() !== 'string') { - throw new Error('virtualHubName 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/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualHubName}', encodeURIComponent(virtualHubName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListHubVirtualNetworkConnectionsResult']().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); - }); -} - -/** - * Retrieves the details of all HubVirtualNetworkConnections. - * - * @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 ListHubVirtualNetworkConnectionsResult} 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListHubVirtualNetworkConnectionsResult']().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 HubVirtualNetworkConnections. */ -class HubVirtualNetworkConnections { - /** - * Create a HubVirtualNetworkConnections. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._get = _get; - this._list = _list; - this._listNext = _listNext; - } - - /** - * Retrieves the details of a HubVirtualNetworkConnection. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @param {string} connectionName The name of the vpn 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, virtualHubName, connectionName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, virtualHubName, connectionName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves the details of a HubVirtualNetworkConnection. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @param {string} connectionName The name of the vpn 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 {HubVirtualNetworkConnection} - 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 HubVirtualNetworkConnection} 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, virtualHubName, 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, virtualHubName, connectionName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, virtualHubName, connectionName, options, optionalCallback); - } - } - - /** - * Retrieves the details of all HubVirtualNetworkConnections. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @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, virtualHubName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, virtualHubName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves the details of all HubVirtualNetworkConnections. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @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 {ListHubVirtualNetworkConnectionsResult} - 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 ListHubVirtualNetworkConnectionsResult} 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, virtualHubName, 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, virtualHubName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, virtualHubName, options, optionalCallback); - } - } - - /** - * Retrieves the details of all HubVirtualNetworkConnections. - * - * @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; - }); - }); - } - - /** - * Retrieves the details of all HubVirtualNetworkConnections. - * - * @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 {ListHubVirtualNetworkConnectionsResult} - 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 ListHubVirtualNetworkConnectionsResult} 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 = HubVirtualNetworkConnections; diff --git a/lib/services/networkManagement2/lib/operations/inboundNatRules.js b/lib/services/networkManagement2/lib/operations/inboundNatRules.js deleted file mode 100644 index e06bd3730..000000000 --- a/lib/services/networkManagement2/lib/operations/inboundNatRules.js +++ /dev/null @@ -1,1831 +0,0 @@ -/* - * 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 all the inbound nat rules in a load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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 InboundNatRuleListResult} 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, loadBalancerName, 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-10-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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { - throw new Error('loadBalancerName 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/loadBalancers/{loadBalancerName}/inboundNatRules'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); - 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['InboundNatRuleListResult']().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); - }); -} - - -/** - * Deletes the specified load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets the specified load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 InboundNatRule} 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, loadBalancerName, inboundNatRuleName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2018-10-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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { - throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); - } - if (inboundNatRuleName === null || inboundNatRuleName === undefined || typeof inboundNatRuleName.valueOf() !== 'string') { - throw new Error('inboundNatRuleName 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 (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand 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/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); - requestUrl = requestUrl.replace('{inboundNatRuleName}', encodeURIComponent(inboundNatRuleName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } - 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['InboundNatRule']().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); - }); -} - - -/** - * Creates or updates a load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @param {object} inboundNatRuleParameters Parameters supplied to the create - * or update inbound nat rule operation. - * - * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A - * reference to frontend IP addresses. - * - * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] - * Resource ID. - * - * @param {string} [inboundNatRuleParameters.protocol] Possible values include: - * 'Udp', 'Tcp', 'All' - * - * @param {number} [inboundNatRuleParameters.frontendPort] The port for the - * external endpoint. Port numbers for each rule must be unique within the Load - * Balancer. Acceptable values range from 1 to 65534. - * - * @param {number} [inboundNatRuleParameters.backendPort] The port used for the - * internal endpoint. Acceptable values range from 1 to 65535. - * - * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout - * for the TCP idle connection. The value can be set between 4 and 30 minutes. - * The default value is 4 minutes. This element is only used when the protocol - * is set to TCP. - * - * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a - * virtual machine's endpoint for the floating IP capability required to - * configure a SQL AlwaysOn Availability Group. This setting is required when - * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't - * be changed after you create the endpoint. - * - * @param {boolean} [inboundNatRuleParameters.enableTcpReset] Receive - * bidirectional TCP Reset on TCP flow idle timeout or unexpected connection - * termination. This element is only used when the protocol is set to TCP. - * - * @param {string} [inboundNatRuleParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [inboundNatRuleParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [inboundNatRuleParameters.etag] A unique read-only string - * that changes whenever the resource is updated. - * - * @param {string} [inboundNatRuleParameters.id] Resource ID. - * - * @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 InboundNatRule} 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 _createOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['InboundNatRule']().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); - }); - }); -} - -/** - * Deletes the specified load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleName, 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-10-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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { - throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); - } - if (inboundNatRuleName === null || inboundNatRuleName === undefined || typeof inboundNatRuleName.valueOf() !== 'string') { - throw new Error('inboundNatRuleName 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/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); - requestUrl = requestUrl.replace('{inboundNatRuleName}', encodeURIComponent(inboundNatRuleName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates a load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @param {object} inboundNatRuleParameters Parameters supplied to the create - * or update inbound nat rule operation. - * - * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A - * reference to frontend IP addresses. - * - * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] - * Resource ID. - * - * @param {string} [inboundNatRuleParameters.protocol] Possible values include: - * 'Udp', 'Tcp', 'All' - * - * @param {number} [inboundNatRuleParameters.frontendPort] The port for the - * external endpoint. Port numbers for each rule must be unique within the Load - * Balancer. Acceptable values range from 1 to 65534. - * - * @param {number} [inboundNatRuleParameters.backendPort] The port used for the - * internal endpoint. Acceptable values range from 1 to 65535. - * - * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout - * for the TCP idle connection. The value can be set between 4 and 30 minutes. - * The default value is 4 minutes. This element is only used when the protocol - * is set to TCP. - * - * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a - * virtual machine's endpoint for the floating IP capability required to - * configure a SQL AlwaysOn Availability Group. This setting is required when - * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't - * be changed after you create the endpoint. - * - * @param {boolean} [inboundNatRuleParameters.enableTcpReset] Receive - * bidirectional TCP Reset on TCP flow idle timeout or unexpected connection - * termination. This element is only used when the protocol is set to TCP. - * - * @param {string} [inboundNatRuleParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [inboundNatRuleParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [inboundNatRuleParameters.etag] A unique read-only string - * that changes whenever the resource is updated. - * - * @param {string} [inboundNatRuleParameters.id] Resource ID. - * - * @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 InboundNatRule} 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 _beginCreateOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, 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-10-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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { - throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); - } - if (inboundNatRuleName === null || inboundNatRuleName === undefined || typeof inboundNatRuleName.valueOf() !== 'string') { - throw new Error('inboundNatRuleName cannot be null or undefined and it must be of type string.'); - } - if (inboundNatRuleParameters === null || inboundNatRuleParameters === undefined) { - throw new Error('inboundNatRuleParameters cannot be null or undefined.'); - } - 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/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); - requestUrl = requestUrl.replace('{inboundNatRuleName}', encodeURIComponent(inboundNatRuleName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (inboundNatRuleParameters !== null && inboundNatRuleParameters !== undefined) { - let requestModelMapper = new client.models['InboundNatRule']().mapper(); - requestModel = client.serialize(requestModelMapper, inboundNatRuleParameters, 'inboundNatRuleParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(inboundNatRuleParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['InboundNatRule']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['InboundNatRule']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Gets all the inbound nat rules in a load balancer. - * - * @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 InboundNatRuleListResult} 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['InboundNatRuleListResult']().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 InboundNatRules. */ -class InboundNatRules { - /** - * Create a InboundNatRules. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._list = _list; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._listNext = _listNext; - } - - /** - * Gets all the inbound nat rules in a load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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, loadBalancerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, loadBalancerName, 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 the inbound nat rules in a load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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 {InboundNatRuleListResult} - 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 InboundNatRuleListResult} 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, loadBalancerName, 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, loadBalancerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, loadBalancerName, options, optionalCallback); - } - } - - /** - * Deletes the specified load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, loadBalancerName, inboundNatRuleName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleName, 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._deleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleName, options, optionalCallback); - } - } - - /** - * Gets the specified load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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, loadBalancerName, inboundNatRuleName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, loadBalancerName, inboundNatRuleName, 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 load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {InboundNatRule} - 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 InboundNatRule} 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, loadBalancerName, inboundNatRuleName, 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, loadBalancerName, inboundNatRuleName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, loadBalancerName, inboundNatRuleName, options, optionalCallback); - } - } - - /** - * Creates or updates a load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @param {object} inboundNatRuleParameters Parameters supplied to the create - * or update inbound nat rule operation. - * - * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A - * reference to frontend IP addresses. - * - * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] - * Resource ID. - * - * @param {string} [inboundNatRuleParameters.protocol] Possible values include: - * 'Udp', 'Tcp', 'All' - * - * @param {number} [inboundNatRuleParameters.frontendPort] The port for the - * external endpoint. Port numbers for each rule must be unique within the Load - * Balancer. Acceptable values range from 1 to 65534. - * - * @param {number} [inboundNatRuleParameters.backendPort] The port used for the - * internal endpoint. Acceptable values range from 1 to 65535. - * - * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout - * for the TCP idle connection. The value can be set between 4 and 30 minutes. - * The default value is 4 minutes. This element is only used when the protocol - * is set to TCP. - * - * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a - * virtual machine's endpoint for the floating IP capability required to - * configure a SQL AlwaysOn Availability Group. This setting is required when - * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't - * be changed after you create the endpoint. - * - * @param {boolean} [inboundNatRuleParameters.enableTcpReset] Receive - * bidirectional TCP Reset on TCP flow idle timeout or unexpected connection - * termination. This element is only used when the protocol is set to TCP. - * - * @param {string} [inboundNatRuleParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [inboundNatRuleParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [inboundNatRuleParameters.etag] A unique read-only string - * that changes whenever the resource is updated. - * - * @param {string} [inboundNatRuleParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @param {object} inboundNatRuleParameters Parameters supplied to the create - * or update inbound nat rule operation. - * - * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A - * reference to frontend IP addresses. - * - * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] - * Resource ID. - * - * @param {string} [inboundNatRuleParameters.protocol] Possible values include: - * 'Udp', 'Tcp', 'All' - * - * @param {number} [inboundNatRuleParameters.frontendPort] The port for the - * external endpoint. Port numbers for each rule must be unique within the Load - * Balancer. Acceptable values range from 1 to 65534. - * - * @param {number} [inboundNatRuleParameters.backendPort] The port used for the - * internal endpoint. Acceptable values range from 1 to 65535. - * - * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout - * for the TCP idle connection. The value can be set between 4 and 30 minutes. - * The default value is 4 minutes. This element is only used when the protocol - * is set to TCP. - * - * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a - * virtual machine's endpoint for the floating IP capability required to - * configure a SQL AlwaysOn Availability Group. This setting is required when - * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't - * be changed after you create the endpoint. - * - * @param {boolean} [inboundNatRuleParameters.enableTcpReset] Receive - * bidirectional TCP Reset on TCP flow idle timeout or unexpected connection - * termination. This element is only used when the protocol is set to TCP. - * - * @param {string} [inboundNatRuleParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [inboundNatRuleParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [inboundNatRuleParameters.etag] A unique read-only string - * that changes whenever the resource is updated. - * - * @param {string} [inboundNatRuleParameters.id] Resource ID. - * - * @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 {InboundNatRule} - 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 InboundNatRule} 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. - */ - createOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, 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._createOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, options, optionalCallback); - } - } - - /** - * Deletes the specified load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, loadBalancerName, inboundNatRuleName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleName, 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._beginDeleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, loadBalancerName, inboundNatRuleName, options, optionalCallback); - } - } - - /** - * Creates or updates a load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @param {object} inboundNatRuleParameters Parameters supplied to the create - * or update inbound nat rule operation. - * - * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A - * reference to frontend IP addresses. - * - * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] - * Resource ID. - * - * @param {string} [inboundNatRuleParameters.protocol] Possible values include: - * 'Udp', 'Tcp', 'All' - * - * @param {number} [inboundNatRuleParameters.frontendPort] The port for the - * external endpoint. Port numbers for each rule must be unique within the Load - * Balancer. Acceptable values range from 1 to 65534. - * - * @param {number} [inboundNatRuleParameters.backendPort] The port used for the - * internal endpoint. Acceptable values range from 1 to 65535. - * - * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout - * for the TCP idle connection. The value can be set between 4 and 30 minutes. - * The default value is 4 minutes. This element is only used when the protocol - * is set to TCP. - * - * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a - * virtual machine's endpoint for the floating IP capability required to - * configure a SQL AlwaysOn Availability Group. This setting is required when - * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't - * be changed after you create the endpoint. - * - * @param {boolean} [inboundNatRuleParameters.enableTcpReset] Receive - * bidirectional TCP Reset on TCP flow idle timeout or unexpected connection - * termination. This element is only used when the protocol is set to TCP. - * - * @param {string} [inboundNatRuleParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [inboundNatRuleParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [inboundNatRuleParameters.etag] A unique read-only string - * that changes whenever the resource is updated. - * - * @param {string} [inboundNatRuleParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @param {object} inboundNatRuleParameters Parameters supplied to the create - * or update inbound nat rule operation. - * - * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A - * reference to frontend IP addresses. - * - * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] - * Resource ID. - * - * @param {string} [inboundNatRuleParameters.protocol] Possible values include: - * 'Udp', 'Tcp', 'All' - * - * @param {number} [inboundNatRuleParameters.frontendPort] The port for the - * external endpoint. Port numbers for each rule must be unique within the Load - * Balancer. Acceptable values range from 1 to 65534. - * - * @param {number} [inboundNatRuleParameters.backendPort] The port used for the - * internal endpoint. Acceptable values range from 1 to 65535. - * - * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout - * for the TCP idle connection. The value can be set between 4 and 30 minutes. - * The default value is 4 minutes. This element is only used when the protocol - * is set to TCP. - * - * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a - * virtual machine's endpoint for the floating IP capability required to - * configure a SQL AlwaysOn Availability Group. This setting is required when - * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't - * be changed after you create the endpoint. - * - * @param {boolean} [inboundNatRuleParameters.enableTcpReset] Receive - * bidirectional TCP Reset on TCP flow idle timeout or unexpected connection - * termination. This element is only used when the protocol is set to TCP. - * - * @param {string} [inboundNatRuleParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [inboundNatRuleParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [inboundNatRuleParameters.etag] A unique read-only string - * that changes whenever the resource is updated. - * - * @param {string} [inboundNatRuleParameters.id] Resource ID. - * - * @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 {InboundNatRule} - 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 InboundNatRule} 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. - */ - beginCreateOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, 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._beginCreateOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, options, optionalCallback); - } - } - - /** - * Gets all the inbound nat rules in a load balancer. - * - * @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 the inbound nat rules in a load balancer. - * - * @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 {InboundNatRuleListResult} - 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 InboundNatRuleListResult} 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 = InboundNatRules; diff --git a/lib/services/networkManagement2/lib/operations/index.d.ts b/lib/services/networkManagement2/lib/operations/index.d.ts deleted file mode 100644 index d9ff0d7af..000000000 --- a/lib/services/networkManagement2/lib/operations/index.d.ts +++ /dev/null @@ -1,48529 +0,0 @@ -/* - * 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 { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationResponse } from 'ms-rest'; -import * as models from '../models'; - - -/** - * @class - * ApplicationGateways - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface ApplicationGateways { - - - /** - * Deletes the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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 {ApplicationGateway} - 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. - * - * {ApplicationGateway} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationGateway} 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, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} parameters Parameters supplied to the create or update - * application gateway operation. - * - * @param {object} [parameters.sku] SKU of the application gateway resource. - * - * @param {string} [parameters.sku.name] Name of an application gateway SKU. - * Possible values include: 'Standard_Small', 'Standard_Medium', - * 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' - * - * @param {string} [parameters.sku.tier] Tier of an application gateway. - * Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' - * - * @param {number} [parameters.sku.capacity] Capacity (instance count) of an - * application gateway. - * - * @param {object} [parameters.sslPolicy] SSL policy of the application gateway - * resource. - * - * @param {array} [parameters.sslPolicy.disabledSslProtocols] Ssl protocols to - * be disabled on application gateway. - * - * @param {string} [parameters.sslPolicy.policyType] Type of Ssl Policy. - * Possible values include: 'Predefined', 'Custom' - * - * @param {string} [parameters.sslPolicy.policyName] Name of Ssl predefined - * policy. Possible values include: 'AppGwSslPolicy20150501', - * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' - * - * @param {array} [parameters.sslPolicy.cipherSuites] Ssl cipher suites to be - * enabled in the specified order to application gateway. - * - * @param {string} [parameters.sslPolicy.minProtocolVersion] Minimum version of - * Ssl protocol to be supported on application gateway. Possible values - * include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' - * - * @param {array} [parameters.gatewayIPConfigurations] Subnets of application - * the gateway resource. - * - * @param {array} [parameters.authenticationCertificates] Authentication - * certificates of the application gateway resource. - * - * @param {array} [parameters.trustedRootCertificates] Trusted Root - * certificates of the application gateway resource. - * - * @param {array} [parameters.sslCertificates] SSL certificates of the - * application gateway resource. - * - * @param {array} [parameters.frontendIPConfigurations] Frontend IP addresses - * of the application gateway resource. - * - * @param {array} [parameters.frontendPorts] Frontend ports of the application - * gateway resource. - * - * @param {array} [parameters.probes] Probes of the application gateway - * resource. - * - * @param {array} [parameters.backendAddressPools] Backend address pool of the - * application gateway resource. - * - * @param {array} [parameters.backendHttpSettingsCollection] Backend http - * settings of the application gateway resource. - * - * @param {array} [parameters.httpListeners] Http listeners of the application - * gateway resource. - * - * @param {array} [parameters.urlPathMaps] URL path map of the application - * gateway resource. - * - * @param {array} [parameters.requestRoutingRules] Request routing rules of the - * application gateway resource. - * - * @param {array} [parameters.rewriteRuleSets] Rewrite rules for the - * application gateway resource. - * - * @param {array} [parameters.redirectConfigurations] Redirect configurations - * of the application gateway resource. - * - * @param {object} [parameters.webApplicationFirewallConfiguration] Web - * application firewall configuration. - * - * @param {boolean} parameters.webApplicationFirewallConfiguration.enabled - * Whether the web application firewall is enabled or not. - * - * @param {string} parameters.webApplicationFirewallConfiguration.firewallMode - * Web application firewall mode. Possible values include: 'Detection', - * 'Prevention' - * - * @param {string} parameters.webApplicationFirewallConfiguration.ruleSetType - * The type of the web application firewall rule set. Possible values are: - * 'OWASP'. - * - * @param {string} - * parameters.webApplicationFirewallConfiguration.ruleSetVersion The version of - * the rule set type. - * - * @param {array} - * [parameters.webApplicationFirewallConfiguration.disabledRuleGroups] The - * disabled rule groups. - * - * @param {boolean} - * [parameters.webApplicationFirewallConfiguration.requestBodyCheck] Whether - * allow WAF to check request Body. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.maxRequestBodySize] Maxium - * request body size for WAF. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.maxRequestBodySizeInKb] - * Maxium request body size in Kb for WAF. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.fileUploadLimitInMb] Maxium - * file upload size in Mb for WAF. - * - * @param {array} [parameters.webApplicationFirewallConfiguration.exclusions] - * The exclusion list. - * - * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the - * application gateway resource. - * - * @param {boolean} [parameters.enableFips] Whether FIPS is enabled on the - * application gateway resource. - * - * @param {object} [parameters.autoscaleConfiguration] Autoscale Configuration. - * - * @param {number} parameters.autoscaleConfiguration.minCapacity Lower bound on - * number of Application Gateway instances - * - * @param {string} [parameters.resourceGuid] Resource GUID property of the - * application gateway resource. - * - * @param {string} [parameters.provisioningState] Provisioning state of the - * application gateway resource. Possible values are: 'Updating', 'Deleting', - * and 'Failed'. - * - * @param {array} [parameters.customErrorConfigurations] Custom error - * configurations of the application gateway resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting - * where the resource needs to come from. - * - * @param {object} [parameters.identity] The identity of the application - * gateway, if configured. - * - * @param {string} [parameters.identity.type] The type of identity used for the - * resource. The type 'SystemAssigned, UserAssigned' includes both an - * implicitly created identity and a set of user assigned identities. The type - * 'None' will remove any identities from the virtual machine. Possible values - * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', - * 'None' - * - * @param {object} [parameters.identity.userAssignedIdentities] The list of - * user identities associated with resource. The user identity dictionary key - * references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} parameters Parameters supplied to the create or update - * application gateway operation. - * - * @param {object} [parameters.sku] SKU of the application gateway resource. - * - * @param {string} [parameters.sku.name] Name of an application gateway SKU. - * Possible values include: 'Standard_Small', 'Standard_Medium', - * 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' - * - * @param {string} [parameters.sku.tier] Tier of an application gateway. - * Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' - * - * @param {number} [parameters.sku.capacity] Capacity (instance count) of an - * application gateway. - * - * @param {object} [parameters.sslPolicy] SSL policy of the application gateway - * resource. - * - * @param {array} [parameters.sslPolicy.disabledSslProtocols] Ssl protocols to - * be disabled on application gateway. - * - * @param {string} [parameters.sslPolicy.policyType] Type of Ssl Policy. - * Possible values include: 'Predefined', 'Custom' - * - * @param {string} [parameters.sslPolicy.policyName] Name of Ssl predefined - * policy. Possible values include: 'AppGwSslPolicy20150501', - * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' - * - * @param {array} [parameters.sslPolicy.cipherSuites] Ssl cipher suites to be - * enabled in the specified order to application gateway. - * - * @param {string} [parameters.sslPolicy.minProtocolVersion] Minimum version of - * Ssl protocol to be supported on application gateway. Possible values - * include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' - * - * @param {array} [parameters.gatewayIPConfigurations] Subnets of application - * the gateway resource. - * - * @param {array} [parameters.authenticationCertificates] Authentication - * certificates of the application gateway resource. - * - * @param {array} [parameters.trustedRootCertificates] Trusted Root - * certificates of the application gateway resource. - * - * @param {array} [parameters.sslCertificates] SSL certificates of the - * application gateway resource. - * - * @param {array} [parameters.frontendIPConfigurations] Frontend IP addresses - * of the application gateway resource. - * - * @param {array} [parameters.frontendPorts] Frontend ports of the application - * gateway resource. - * - * @param {array} [parameters.probes] Probes of the application gateway - * resource. - * - * @param {array} [parameters.backendAddressPools] Backend address pool of the - * application gateway resource. - * - * @param {array} [parameters.backendHttpSettingsCollection] Backend http - * settings of the application gateway resource. - * - * @param {array} [parameters.httpListeners] Http listeners of the application - * gateway resource. - * - * @param {array} [parameters.urlPathMaps] URL path map of the application - * gateway resource. - * - * @param {array} [parameters.requestRoutingRules] Request routing rules of the - * application gateway resource. - * - * @param {array} [parameters.rewriteRuleSets] Rewrite rules for the - * application gateway resource. - * - * @param {array} [parameters.redirectConfigurations] Redirect configurations - * of the application gateway resource. - * - * @param {object} [parameters.webApplicationFirewallConfiguration] Web - * application firewall configuration. - * - * @param {boolean} parameters.webApplicationFirewallConfiguration.enabled - * Whether the web application firewall is enabled or not. - * - * @param {string} parameters.webApplicationFirewallConfiguration.firewallMode - * Web application firewall mode. Possible values include: 'Detection', - * 'Prevention' - * - * @param {string} parameters.webApplicationFirewallConfiguration.ruleSetType - * The type of the web application firewall rule set. Possible values are: - * 'OWASP'. - * - * @param {string} - * parameters.webApplicationFirewallConfiguration.ruleSetVersion The version of - * the rule set type. - * - * @param {array} - * [parameters.webApplicationFirewallConfiguration.disabledRuleGroups] The - * disabled rule groups. - * - * @param {boolean} - * [parameters.webApplicationFirewallConfiguration.requestBodyCheck] Whether - * allow WAF to check request Body. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.maxRequestBodySize] Maxium - * request body size for WAF. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.maxRequestBodySizeInKb] - * Maxium request body size in Kb for WAF. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.fileUploadLimitInMb] Maxium - * file upload size in Mb for WAF. - * - * @param {array} [parameters.webApplicationFirewallConfiguration.exclusions] - * The exclusion list. - * - * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the - * application gateway resource. - * - * @param {boolean} [parameters.enableFips] Whether FIPS is enabled on the - * application gateway resource. - * - * @param {object} [parameters.autoscaleConfiguration] Autoscale Configuration. - * - * @param {number} parameters.autoscaleConfiguration.minCapacity Lower bound on - * number of Application Gateway instances - * - * @param {string} [parameters.resourceGuid] Resource GUID property of the - * application gateway resource. - * - * @param {string} [parameters.provisioningState] Provisioning state of the - * application gateway resource. Possible values are: 'Updating', 'Deleting', - * and 'Failed'. - * - * @param {array} [parameters.customErrorConfigurations] Custom error - * configurations of the application gateway resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting - * where the resource needs to come from. - * - * @param {object} [parameters.identity] The identity of the application - * gateway, if configured. - * - * @param {string} [parameters.identity.type] The type of identity used for the - * resource. The type 'SystemAssigned, UserAssigned' includes both an - * implicitly created identity and a set of user assigned identities. The type - * 'None' will remove any identities from the virtual machine. Possible values - * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', - * 'None' - * - * @param {object} [parameters.identity.userAssignedIdentities] The list of - * user identities associated with resource. The user identity dictionary key - * references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ApplicationGateway} - 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. - * - * {ApplicationGateway} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationGateway} 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. - */ - createOrUpdate(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates the specified application gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} parameters Parameters supplied to update application gateway - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates the specified application gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} parameters Parameters supplied to update application gateway - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ApplicationGateway} - 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. - * - * {ApplicationGateway} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationGateway} 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. - */ - updateTags(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all application gateways in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all application gateways in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {ApplicationGatewayListResult} - 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. - * - * {ApplicationGatewayListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationGatewayListResult} 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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the application gateways in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the application gateways in a subscription. - * - * @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 {ApplicationGatewayListResult} - 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. - * - * {ApplicationGatewayListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationGatewayListResult} 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. - */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Starts the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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. - */ - startWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Starts the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - start(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - start(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; - start(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Stops the specified application gateway in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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. - */ - stopWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Stops the specified application gateway in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - stop(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - stop(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; - stop(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the backend health of the specified application gateway in a resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands BackendAddressPool and - * BackendHttpSettings referenced in backend health. - * - * @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. - */ - backendHealthWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the backend health of the specified application gateway in a resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands BackendAddressPool and - * BackendHttpSettings referenced in backend health. - * - * @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 {ApplicationGatewayBackendHealth} - 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. - * - * {ApplicationGatewayBackendHealth} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationGatewayBackendHealth} 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. - */ - backendHealth(resourceGroupName: string, applicationGatewayName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - backendHealth(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; - backendHealth(resourceGroupName: string, applicationGatewayName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all available web application firewall rule sets. - * - * @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. - */ - listAvailableWafRuleSetsWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all available web application firewall rule sets. - * - * @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 {ApplicationGatewayAvailableWafRuleSetsResult} - 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. - * - * {ApplicationGatewayAvailableWafRuleSetsResult} [result] - The deserialized result object if an error did not occur. - * See {@link - * ApplicationGatewayAvailableWafRuleSetsResult} 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. - */ - listAvailableWafRuleSets(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAvailableWafRuleSets(callback: ServiceCallback): void; - listAvailableWafRuleSets(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists available Ssl options for configuring Ssl policy. - * - * @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. - */ - listAvailableSslOptionsWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists available Ssl options for configuring Ssl policy. - * - * @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 {ApplicationGatewayAvailableSslOptions} - 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. - * - * {ApplicationGatewayAvailableSslOptions} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationGatewayAvailableSslOptions} 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. - */ - listAvailableSslOptions(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAvailableSslOptions(callback: ServiceCallback): void; - listAvailableSslOptions(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all SSL predefined policies for configuring Ssl policy. - * - * @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. - */ - listAvailableSslPredefinedPoliciesWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all SSL predefined policies for configuring Ssl policy. - * - * @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 {ApplicationGatewayAvailableSslPredefinedPolicies} - 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. - * - * {ApplicationGatewayAvailableSslPredefinedPolicies} [result] - The deserialized result object if an error did not occur. - * See {@link - * ApplicationGatewayAvailableSslPredefinedPolicies} 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. - */ - listAvailableSslPredefinedPolicies(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAvailableSslPredefinedPolicies(callback: ServiceCallback): void; - listAvailableSslPredefinedPolicies(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets Ssl predefined policy with the specified policy name. - * - * @param {string} predefinedPolicyName Name of Ssl predefined policy. - * - * @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. - */ - getSslPredefinedPolicyWithHttpOperationResponse(predefinedPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets Ssl predefined policy with the specified policy name. - * - * @param {string} predefinedPolicyName Name of Ssl predefined policy. - * - * @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 {ApplicationGatewaySslPredefinedPolicy} - 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. - * - * {ApplicationGatewaySslPredefinedPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationGatewaySslPredefinedPolicy} 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. - */ - getSslPredefinedPolicy(predefinedPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getSslPredefinedPolicy(predefinedPolicyName: string, callback: ServiceCallback): void; - getSslPredefinedPolicy(predefinedPolicyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} parameters Parameters supplied to the create or update - * application gateway operation. - * - * @param {object} [parameters.sku] SKU of the application gateway resource. - * - * @param {string} [parameters.sku.name] Name of an application gateway SKU. - * Possible values include: 'Standard_Small', 'Standard_Medium', - * 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' - * - * @param {string} [parameters.sku.tier] Tier of an application gateway. - * Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' - * - * @param {number} [parameters.sku.capacity] Capacity (instance count) of an - * application gateway. - * - * @param {object} [parameters.sslPolicy] SSL policy of the application gateway - * resource. - * - * @param {array} [parameters.sslPolicy.disabledSslProtocols] Ssl protocols to - * be disabled on application gateway. - * - * @param {string} [parameters.sslPolicy.policyType] Type of Ssl Policy. - * Possible values include: 'Predefined', 'Custom' - * - * @param {string} [parameters.sslPolicy.policyName] Name of Ssl predefined - * policy. Possible values include: 'AppGwSslPolicy20150501', - * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' - * - * @param {array} [parameters.sslPolicy.cipherSuites] Ssl cipher suites to be - * enabled in the specified order to application gateway. - * - * @param {string} [parameters.sslPolicy.minProtocolVersion] Minimum version of - * Ssl protocol to be supported on application gateway. Possible values - * include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' - * - * @param {array} [parameters.gatewayIPConfigurations] Subnets of application - * the gateway resource. - * - * @param {array} [parameters.authenticationCertificates] Authentication - * certificates of the application gateway resource. - * - * @param {array} [parameters.trustedRootCertificates] Trusted Root - * certificates of the application gateway resource. - * - * @param {array} [parameters.sslCertificates] SSL certificates of the - * application gateway resource. - * - * @param {array} [parameters.frontendIPConfigurations] Frontend IP addresses - * of the application gateway resource. - * - * @param {array} [parameters.frontendPorts] Frontend ports of the application - * gateway resource. - * - * @param {array} [parameters.probes] Probes of the application gateway - * resource. - * - * @param {array} [parameters.backendAddressPools] Backend address pool of the - * application gateway resource. - * - * @param {array} [parameters.backendHttpSettingsCollection] Backend http - * settings of the application gateway resource. - * - * @param {array} [parameters.httpListeners] Http listeners of the application - * gateway resource. - * - * @param {array} [parameters.urlPathMaps] URL path map of the application - * gateway resource. - * - * @param {array} [parameters.requestRoutingRules] Request routing rules of the - * application gateway resource. - * - * @param {array} [parameters.rewriteRuleSets] Rewrite rules for the - * application gateway resource. - * - * @param {array} [parameters.redirectConfigurations] Redirect configurations - * of the application gateway resource. - * - * @param {object} [parameters.webApplicationFirewallConfiguration] Web - * application firewall configuration. - * - * @param {boolean} parameters.webApplicationFirewallConfiguration.enabled - * Whether the web application firewall is enabled or not. - * - * @param {string} parameters.webApplicationFirewallConfiguration.firewallMode - * Web application firewall mode. Possible values include: 'Detection', - * 'Prevention' - * - * @param {string} parameters.webApplicationFirewallConfiguration.ruleSetType - * The type of the web application firewall rule set. Possible values are: - * 'OWASP'. - * - * @param {string} - * parameters.webApplicationFirewallConfiguration.ruleSetVersion The version of - * the rule set type. - * - * @param {array} - * [parameters.webApplicationFirewallConfiguration.disabledRuleGroups] The - * disabled rule groups. - * - * @param {boolean} - * [parameters.webApplicationFirewallConfiguration.requestBodyCheck] Whether - * allow WAF to check request Body. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.maxRequestBodySize] Maxium - * request body size for WAF. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.maxRequestBodySizeInKb] - * Maxium request body size in Kb for WAF. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.fileUploadLimitInMb] Maxium - * file upload size in Mb for WAF. - * - * @param {array} [parameters.webApplicationFirewallConfiguration.exclusions] - * The exclusion list. - * - * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the - * application gateway resource. - * - * @param {boolean} [parameters.enableFips] Whether FIPS is enabled on the - * application gateway resource. - * - * @param {object} [parameters.autoscaleConfiguration] Autoscale Configuration. - * - * @param {number} parameters.autoscaleConfiguration.minCapacity Lower bound on - * number of Application Gateway instances - * - * @param {string} [parameters.resourceGuid] Resource GUID property of the - * application gateway resource. - * - * @param {string} [parameters.provisioningState] Provisioning state of the - * application gateway resource. Possible values are: 'Updating', 'Deleting', - * and 'Failed'. - * - * @param {array} [parameters.customErrorConfigurations] Custom error - * configurations of the application gateway resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting - * where the resource needs to come from. - * - * @param {object} [parameters.identity] The identity of the application - * gateway, if configured. - * - * @param {string} [parameters.identity.type] The type of identity used for the - * resource. The type 'SystemAssigned, UserAssigned' includes both an - * implicitly created identity and a set of user assigned identities. The type - * 'None' will remove any identities from the virtual machine. Possible values - * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', - * 'None' - * - * @param {object} [parameters.identity.userAssignedIdentities] The list of - * user identities associated with resource. The user identity dictionary key - * references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} parameters Parameters supplied to the create or update - * application gateway operation. - * - * @param {object} [parameters.sku] SKU of the application gateway resource. - * - * @param {string} [parameters.sku.name] Name of an application gateway SKU. - * Possible values include: 'Standard_Small', 'Standard_Medium', - * 'Standard_Large', 'WAF_Medium', 'WAF_Large', 'Standard_v2', 'WAF_v2' - * - * @param {string} [parameters.sku.tier] Tier of an application gateway. - * Possible values include: 'Standard', 'WAF', 'Standard_v2', 'WAF_v2' - * - * @param {number} [parameters.sku.capacity] Capacity (instance count) of an - * application gateway. - * - * @param {object} [parameters.sslPolicy] SSL policy of the application gateway - * resource. - * - * @param {array} [parameters.sslPolicy.disabledSslProtocols] Ssl protocols to - * be disabled on application gateway. - * - * @param {string} [parameters.sslPolicy.policyType] Type of Ssl Policy. - * Possible values include: 'Predefined', 'Custom' - * - * @param {string} [parameters.sslPolicy.policyName] Name of Ssl predefined - * policy. Possible values include: 'AppGwSslPolicy20150501', - * 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' - * - * @param {array} [parameters.sslPolicy.cipherSuites] Ssl cipher suites to be - * enabled in the specified order to application gateway. - * - * @param {string} [parameters.sslPolicy.minProtocolVersion] Minimum version of - * Ssl protocol to be supported on application gateway. Possible values - * include: 'TLSv1_0', 'TLSv1_1', 'TLSv1_2' - * - * @param {array} [parameters.gatewayIPConfigurations] Subnets of application - * the gateway resource. - * - * @param {array} [parameters.authenticationCertificates] Authentication - * certificates of the application gateway resource. - * - * @param {array} [parameters.trustedRootCertificates] Trusted Root - * certificates of the application gateway resource. - * - * @param {array} [parameters.sslCertificates] SSL certificates of the - * application gateway resource. - * - * @param {array} [parameters.frontendIPConfigurations] Frontend IP addresses - * of the application gateway resource. - * - * @param {array} [parameters.frontendPorts] Frontend ports of the application - * gateway resource. - * - * @param {array} [parameters.probes] Probes of the application gateway - * resource. - * - * @param {array} [parameters.backendAddressPools] Backend address pool of the - * application gateway resource. - * - * @param {array} [parameters.backendHttpSettingsCollection] Backend http - * settings of the application gateway resource. - * - * @param {array} [parameters.httpListeners] Http listeners of the application - * gateway resource. - * - * @param {array} [parameters.urlPathMaps] URL path map of the application - * gateway resource. - * - * @param {array} [parameters.requestRoutingRules] Request routing rules of the - * application gateway resource. - * - * @param {array} [parameters.rewriteRuleSets] Rewrite rules for the - * application gateway resource. - * - * @param {array} [parameters.redirectConfigurations] Redirect configurations - * of the application gateway resource. - * - * @param {object} [parameters.webApplicationFirewallConfiguration] Web - * application firewall configuration. - * - * @param {boolean} parameters.webApplicationFirewallConfiguration.enabled - * Whether the web application firewall is enabled or not. - * - * @param {string} parameters.webApplicationFirewallConfiguration.firewallMode - * Web application firewall mode. Possible values include: 'Detection', - * 'Prevention' - * - * @param {string} parameters.webApplicationFirewallConfiguration.ruleSetType - * The type of the web application firewall rule set. Possible values are: - * 'OWASP'. - * - * @param {string} - * parameters.webApplicationFirewallConfiguration.ruleSetVersion The version of - * the rule set type. - * - * @param {array} - * [parameters.webApplicationFirewallConfiguration.disabledRuleGroups] The - * disabled rule groups. - * - * @param {boolean} - * [parameters.webApplicationFirewallConfiguration.requestBodyCheck] Whether - * allow WAF to check request Body. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.maxRequestBodySize] Maxium - * request body size for WAF. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.maxRequestBodySizeInKb] - * Maxium request body size in Kb for WAF. - * - * @param {number} - * [parameters.webApplicationFirewallConfiguration.fileUploadLimitInMb] Maxium - * file upload size in Mb for WAF. - * - * @param {array} [parameters.webApplicationFirewallConfiguration.exclusions] - * The exclusion list. - * - * @param {boolean} [parameters.enableHttp2] Whether HTTP2 is enabled on the - * application gateway resource. - * - * @param {boolean} [parameters.enableFips] Whether FIPS is enabled on the - * application gateway resource. - * - * @param {object} [parameters.autoscaleConfiguration] Autoscale Configuration. - * - * @param {number} parameters.autoscaleConfiguration.minCapacity Lower bound on - * number of Application Gateway instances - * - * @param {string} [parameters.resourceGuid] Resource GUID property of the - * application gateway resource. - * - * @param {string} [parameters.provisioningState] Provisioning state of the - * application gateway resource. Possible values are: 'Updating', 'Deleting', - * and 'Failed'. - * - * @param {array} [parameters.customErrorConfigurations] Custom error - * configurations of the application gateway resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting - * where the resource needs to come from. - * - * @param {object} [parameters.identity] The identity of the application - * gateway, if configured. - * - * @param {string} [parameters.identity.type] The type of identity used for the - * resource. The type 'SystemAssigned, UserAssigned' includes both an - * implicitly created identity and a set of user assigned identities. The type - * 'None' will remove any identities from the virtual machine. Possible values - * include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', - * 'None' - * - * @param {object} [parameters.identity.userAssignedIdentities] The list of - * user identities associated with resource. The user identity dictionary key - * references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ApplicationGateway} - 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. - * - * {ApplicationGateway} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationGateway} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, applicationGatewayName: string, parameters: models.ApplicationGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates the specified application gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} parameters Parameters supplied to update application gateway - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates the specified application gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} parameters Parameters supplied to update application gateway - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ApplicationGateway} - 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. - * - * {ApplicationGateway} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationGateway} 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. - */ - beginUpdateTags(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, applicationGatewayName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Starts the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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. - */ - beginStartWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Starts the specified application gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginStart(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginStart(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; - beginStart(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Stops the specified application gateway in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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. - */ - beginStopWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Stops the specified application gateway in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginStop(resourceGroupName: string, applicationGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginStop(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; - beginStop(resourceGroupName: string, applicationGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the backend health of the specified application gateway in a resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands BackendAddressPool and - * BackendHttpSettings referenced in backend health. - * - * @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. - */ - beginBackendHealthWithHttpOperationResponse(resourceGroupName: string, applicationGatewayName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the backend health of the specified application gateway in a resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationGatewayName The name of the application gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands BackendAddressPool and - * BackendHttpSettings referenced in backend health. - * - * @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 {ApplicationGatewayBackendHealth} - 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. - * - * {ApplicationGatewayBackendHealth} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationGatewayBackendHealth} 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. - */ - beginBackendHealth(resourceGroupName: string, applicationGatewayName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - beginBackendHealth(resourceGroupName: string, applicationGatewayName: string, callback: ServiceCallback): void; - beginBackendHealth(resourceGroupName: string, applicationGatewayName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all application gateways in a resource group. - * - * @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>; - - /** - * Lists all application gateways in a resource group. - * - * @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 {ApplicationGatewayListResult} - 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. - * - * {ApplicationGatewayListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationGatewayListResult} 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; - - - /** - * Gets all the application gateways in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the application gateways in a subscription. - * - * @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 {ApplicationGatewayListResult} - 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. - * - * {ApplicationGatewayListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationGatewayListResult} 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. - */ - listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAllNext(nextPageLink: string, callback: ServiceCallback): void; - listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all SSL predefined policies for configuring Ssl policy. - * - * @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. - */ - listAvailableSslPredefinedPoliciesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all SSL predefined policies for configuring Ssl policy. - * - * @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 {ApplicationGatewayAvailableSslPredefinedPolicies} - 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. - * - * {ApplicationGatewayAvailableSslPredefinedPolicies} [result] - The deserialized result object if an error did not occur. - * See {@link - * ApplicationGatewayAvailableSslPredefinedPolicies} 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. - */ - listAvailableSslPredefinedPoliciesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAvailableSslPredefinedPoliciesNext(nextPageLink: string, callback: ServiceCallback): void; - listAvailableSslPredefinedPoliciesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ApplicationSecurityGroups - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface ApplicationSecurityGroups { - - - /** - * Deletes the specified application security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationSecurityGroupName The name of the application - * security group. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, applicationSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified application security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationSecurityGroupName The name of the application - * security group. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, applicationSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, applicationSecurityGroupName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, applicationSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets information about the specified application security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationSecurityGroupName The name of the application - * security group. - * - * @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, applicationSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets information about the specified application security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationSecurityGroupName The name of the application - * security group. - * - * @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 {ApplicationSecurityGroup} - 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. - * - * {ApplicationSecurityGroup} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationSecurityGroup} 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, applicationSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, applicationSecurityGroupName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, applicationSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates an application security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationSecurityGroupName The name of the application - * security group. - * - * @param {object} parameters Parameters supplied to the create or update - * ApplicationSecurityGroup operation. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates an application security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationSecurityGroupName The name of the application - * security group. - * - * @param {object} parameters Parameters supplied to the create or update - * ApplicationSecurityGroup operation. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ApplicationSecurityGroup} - 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. - * - * {ApplicationSecurityGroup} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationSecurityGroup} 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. - */ - createOrUpdate(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all application security groups in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all application security groups in a subscription. - * - * @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 {ApplicationSecurityGroupListResult} - 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. - * - * {ApplicationSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationSecurityGroupListResult} 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. - */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the application security groups in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the application security groups in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {ApplicationSecurityGroupListResult} - 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. - * - * {ApplicationSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationSecurityGroupListResult} 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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified application security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationSecurityGroupName The name of the application - * security group. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, applicationSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified application security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationSecurityGroupName The name of the application - * security group. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, applicationSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, applicationSecurityGroupName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, applicationSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates an application security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationSecurityGroupName The name of the application - * security group. - * - * @param {object} parameters Parameters supplied to the create or update - * ApplicationSecurityGroup operation. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates an application security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} applicationSecurityGroupName The name of the application - * security group. - * - * @param {object} parameters Parameters supplied to the create or update - * ApplicationSecurityGroup operation. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ApplicationSecurityGroup} - 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. - * - * {ApplicationSecurityGroup} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationSecurityGroup} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, applicationSecurityGroupName: string, parameters: models.ApplicationSecurityGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all application security groups in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all application security groups in a subscription. - * - * @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 {ApplicationSecurityGroupListResult} - 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. - * - * {ApplicationSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationSecurityGroupListResult} 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. - */ - listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAllNext(nextPageLink: string, callback: ServiceCallback): void; - listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the application security groups in a resource group. - * - * @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 the application security groups in a resource group. - * - * @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 {ApplicationSecurityGroupListResult} - 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. - * - * {ApplicationSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationSecurityGroupListResult} 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 - * AvailableDelegations - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface AvailableDelegations { - - - /** - * Gets all of the available subnet delegations for this subscription in this - * region. - * - * @param {string} location The location of the subnet. - * - * @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(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all of the available subnet delegations for this subscription in this - * region. - * - * @param {string} location The location of the subnet. - * - * @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 {AvailableDelegationsResult} - 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. - * - * {AvailableDelegationsResult} [result] - The deserialized result object if an error did not occur. - * See {@link AvailableDelegationsResult} 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(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(location: string, callback: ServiceCallback): void; - list(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all of the available subnet delegations for this subscription in this - * region. - * - * @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 of the available subnet delegations for this subscription in this - * region. - * - * @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 {AvailableDelegationsResult} - 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. - * - * {AvailableDelegationsResult} [result] - The deserialized result object if an error did not occur. - * See {@link AvailableDelegationsResult} 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 - * AvailableResourceGroupDelegations - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface AvailableResourceGroupDelegations { - - - /** - * Gets all of the available subnet delegations for this resource group in this - * region. - * - * @param {string} location The location of the domain name. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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(location: string, resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all of the available subnet delegations for this resource group in this - * region. - * - * @param {string} location The location of the domain name. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {AvailableDelegationsResult} - 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. - * - * {AvailableDelegationsResult} [result] - The deserialized result object if an error did not occur. - * See {@link AvailableDelegationsResult} 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(location: string, resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(location: string, resourceGroupName: string, callback: ServiceCallback): void; - list(location: string, resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all of the available subnet delegations for this resource group in this - * region. - * - * @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 of the available subnet delegations for this resource group in this - * region. - * - * @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 {AvailableDelegationsResult} - 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. - * - * {AvailableDelegationsResult} [result] - The deserialized result object if an error did not occur. - * See {@link AvailableDelegationsResult} 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 - * AzureFirewalls - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface AzureFirewalls { - - - /** - * Deletes the specified Azure Firewall. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} azureFirewallName The name of the Azure Firewall. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, azureFirewallName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified Azure Firewall. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} azureFirewallName The name of the Azure Firewall. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, azureFirewallName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, azureFirewallName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, azureFirewallName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified Azure Firewall. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} azureFirewallName The name of the Azure Firewall. - * - * @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, azureFirewallName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified Azure Firewall. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} azureFirewallName The name of the Azure Firewall. - * - * @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 {AzureFirewall} - 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. - * - * {AzureFirewall} [result] - The deserialized result object if an error did not occur. - * See {@link AzureFirewall} 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, azureFirewallName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, azureFirewallName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, azureFirewallName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the specified Azure Firewall. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} azureFirewallName The name of the Azure Firewall. - * - * @param {object} parameters Parameters supplied to the create or update Azure - * Firewall operation. - * - * @param {array} [parameters.applicationRuleCollections] Collection of - * application rule collections used by Azure Firewall. - * - * @param {array} [parameters.natRuleCollections] Collection of NAT rule - * collections used by Azure Firewall. - * - * @param {array} [parameters.networkRuleCollections] Collection of network - * rule collections used by Azure Firewall. - * - * @param {array} [parameters.ipConfigurations] IP configuration of the Azure - * Firewall resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, azureFirewallName: string, parameters: models.AzureFirewall, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the specified Azure Firewall. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} azureFirewallName The name of the Azure Firewall. - * - * @param {object} parameters Parameters supplied to the create or update Azure - * Firewall operation. - * - * @param {array} [parameters.applicationRuleCollections] Collection of - * application rule collections used by Azure Firewall. - * - * @param {array} [parameters.natRuleCollections] Collection of NAT rule - * collections used by Azure Firewall. - * - * @param {array} [parameters.networkRuleCollections] Collection of network - * rule collections used by Azure Firewall. - * - * @param {array} [parameters.ipConfigurations] IP configuration of the Azure - * Firewall resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {AzureFirewall} - 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. - * - * {AzureFirewall} [result] - The deserialized result object if an error did not occur. - * See {@link AzureFirewall} 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. - */ - createOrUpdate(resourceGroupName: string, azureFirewallName: string, parameters: models.AzureFirewall, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, azureFirewallName: string, parameters: models.AzureFirewall, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, azureFirewallName: string, parameters: models.AzureFirewall, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all Azure Firewalls in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all Azure Firewalls in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {AzureFirewallListResult} - 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. - * - * {AzureFirewallListResult} [result] - The deserialized result object if an error did not occur. - * See {@link AzureFirewallListResult} 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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the Azure Firewalls in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the Azure Firewalls in a subscription. - * - * @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 {AzureFirewallListResult} - 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. - * - * {AzureFirewallListResult} [result] - The deserialized result object if an error did not occur. - * See {@link AzureFirewallListResult} 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. - */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified Azure Firewall. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} azureFirewallName The name of the Azure Firewall. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, azureFirewallName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified Azure Firewall. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} azureFirewallName The name of the Azure Firewall. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, azureFirewallName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, azureFirewallName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, azureFirewallName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the specified Azure Firewall. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} azureFirewallName The name of the Azure Firewall. - * - * @param {object} parameters Parameters supplied to the create or update Azure - * Firewall operation. - * - * @param {array} [parameters.applicationRuleCollections] Collection of - * application rule collections used by Azure Firewall. - * - * @param {array} [parameters.natRuleCollections] Collection of NAT rule - * collections used by Azure Firewall. - * - * @param {array} [parameters.networkRuleCollections] Collection of network - * rule collections used by Azure Firewall. - * - * @param {array} [parameters.ipConfigurations] IP configuration of the Azure - * Firewall resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, azureFirewallName: string, parameters: models.AzureFirewall, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the specified Azure Firewall. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} azureFirewallName The name of the Azure Firewall. - * - * @param {object} parameters Parameters supplied to the create or update Azure - * Firewall operation. - * - * @param {array} [parameters.applicationRuleCollections] Collection of - * application rule collections used by Azure Firewall. - * - * @param {array} [parameters.natRuleCollections] Collection of NAT rule - * collections used by Azure Firewall. - * - * @param {array} [parameters.networkRuleCollections] Collection of network - * rule collections used by Azure Firewall. - * - * @param {array} [parameters.ipConfigurations] IP configuration of the Azure - * Firewall resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {AzureFirewall} - 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. - * - * {AzureFirewall} [result] - The deserialized result object if an error did not occur. - * See {@link AzureFirewall} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, azureFirewallName: string, parameters: models.AzureFirewall, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, azureFirewallName: string, parameters: models.AzureFirewall, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, azureFirewallName: string, parameters: models.AzureFirewall, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all Azure Firewalls in a resource group. - * - * @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>; - - /** - * Lists all Azure Firewalls in a resource group. - * - * @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 {AzureFirewallListResult} - 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. - * - * {AzureFirewallListResult} [result] - The deserialized result object if an error did not occur. - * See {@link AzureFirewallListResult} 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; - - - /** - * Gets all the Azure Firewalls in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the Azure Firewalls in a subscription. - * - * @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 {AzureFirewallListResult} - 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. - * - * {AzureFirewallListResult} [result] - The deserialized result object if an error did not occur. - * See {@link AzureFirewallListResult} 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. - */ - listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAllNext(nextPageLink: string, callback: ServiceCallback): void; - listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * AzureFirewallFqdnTags - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface AzureFirewallFqdnTags { - - - /** - * Gets all the Azure Firewall FQDN Tags in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the Azure Firewall FQDN Tags in a subscription. - * - * @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 {AzureFirewallFqdnTagListResult} - 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. - * - * {AzureFirewallFqdnTagListResult} [result] - The deserialized result object if an error did not occur. - * See {@link AzureFirewallFqdnTagListResult} 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. - */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the Azure Firewall FQDN Tags in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the Azure Firewall FQDN Tags in a subscription. - * - * @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 {AzureFirewallFqdnTagListResult} - 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. - * - * {AzureFirewallFqdnTagListResult} [result] - The deserialized result object if an error did not occur. - * See {@link AzureFirewallFqdnTagListResult} 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. - */ - listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAllNext(nextPageLink: string, callback: ServiceCallback): void; - listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * DdosProtectionPlans - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface DdosProtectionPlans { - - - /** - * Deletes the specified DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, ddosProtectionPlanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, ddosProtectionPlanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, ddosProtectionPlanName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, ddosProtectionPlanName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets information about the specified DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. - * - * @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, ddosProtectionPlanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets information about the specified DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. - * - * @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 {DdosProtectionPlan} - 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. - * - * {DdosProtectionPlan} [result] - The deserialized result object if an error did not occur. - * See {@link DdosProtectionPlan} 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, ddosProtectionPlanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, ddosProtectionPlanName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, ddosProtectionPlanName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. - * - * @param {object} parameters Parameters supplied to the create or update - * operation. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. - * - * @param {object} parameters Parameters supplied to the create or update - * operation. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {DdosProtectionPlan} - 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. - * - * {DdosProtectionPlan} [result] - The deserialized result object if an error did not occur. - * See {@link DdosProtectionPlan} 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. - */ - createOrUpdate(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all DDoS protection plans in a subscription. - * - * @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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all DDoS protection plans in a subscription. - * - * @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 {DdosProtectionPlanListResult} - 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. - * - * {DdosProtectionPlanListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DdosProtectionPlanListResult} 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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the DDoS protection plans in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the DDoS protection plans in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {DdosProtectionPlanListResult} - 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. - * - * {DdosProtectionPlanListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DdosProtectionPlanListResult} 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. - */ - listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, ddosProtectionPlanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, ddosProtectionPlanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, ddosProtectionPlanName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, ddosProtectionPlanName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. - * - * @param {object} parameters Parameters supplied to the create or update - * operation. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a DDoS protection plan. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} ddosProtectionPlanName The name of the DDoS protection plan. - * - * @param {object} parameters Parameters supplied to the create or update - * operation. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {DdosProtectionPlan} - 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. - * - * {DdosProtectionPlan} [result] - The deserialized result object if an error did not occur. - * See {@link DdosProtectionPlan} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, ddosProtectionPlanName: string, parameters: models.DdosProtectionPlan, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all DDoS protection plans in a subscription. - * - * @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 DDoS protection plans in a subscription. - * - * @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 {DdosProtectionPlanListResult} - 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. - * - * {DdosProtectionPlanListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DdosProtectionPlanListResult} 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; - - - /** - * Gets all the DDoS protection plans in a resource group. - * - * @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. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the DDoS protection plans in a resource group. - * - * @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 {DdosProtectionPlanListResult} - 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. - * - * {DdosProtectionPlanListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DdosProtectionPlanListResult} 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. - */ - listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * AvailableEndpointServices - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface AvailableEndpointServices { - - - /** - * List what values of endpoint services are available for use. - * - * @param {string} location The location to check available endpoint services. - * - * @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(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * List what values of endpoint services are available for use. - * - * @param {string} location The location to check available endpoint services. - * - * @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 {EndpointServicesListResult} - 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. - * - * {EndpointServicesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link EndpointServicesListResult} 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(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(location: string, callback: ServiceCallback): void; - list(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * List what values of endpoint services are available for use. - * - * @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>; - - /** - * List what values of endpoint services are available for use. - * - * @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 {EndpointServicesListResult} - 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. - * - * {EndpointServicesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link EndpointServicesListResult} 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 - * ExpressRouteCircuitAuthorizations - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface ExpressRouteCircuitAuthorizations { - - - /** - * Deletes the specified authorization 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} authorizationName The name of the authorization. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, authorizationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified authorization 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} authorizationName The name of the authorization. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, circuitName: string, authorizationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, circuitName: string, authorizationName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, circuitName: string, authorizationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified authorization 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} authorizationName The name of the authorization. - * - * @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, authorizationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified authorization 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} authorizationName The name of the authorization. - * - * @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 {ExpressRouteCircuitAuthorization} - 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. - * - * {ExpressRouteCircuitAuthorization} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitAuthorization} 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, authorizationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, circuitName: string, authorizationName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, circuitName: string, authorizationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates an authorization in 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} authorizationName The name of the authorization. - * - * @param {object} authorizationParameters Parameters supplied to the create or - * update express route circuit authorization operation. - * - * @param {string} [authorizationParameters.authorizationKey] The authorization - * key. - * - * @param {string} [authorizationParameters.authorizationUseStatus] - * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. - * Possible values include: 'Available', 'InUse' - * - * @param {string} [authorizationParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [authorizationParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [authorizationParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates an authorization in 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} authorizationName The name of the authorization. - * - * @param {object} authorizationParameters Parameters supplied to the create or - * update express route circuit authorization operation. - * - * @param {string} [authorizationParameters.authorizationKey] The authorization - * key. - * - * @param {string} [authorizationParameters.authorizationUseStatus] - * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. - * Possible values include: 'Available', 'InUse' - * - * @param {string} [authorizationParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [authorizationParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [authorizationParameters.id] Resource ID. - * - * @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 {ExpressRouteCircuitAuthorization} - 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. - * - * {ExpressRouteCircuitAuthorization} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitAuthorization} 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. - */ - createOrUpdate(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all authorizations in an express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the circuit. - * - * @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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all authorizations in an express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the circuit. - * - * @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 {AuthorizationListResult} - 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. - * - * {AuthorizationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link AuthorizationListResult} 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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, circuitName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, circuitName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified authorization 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} authorizationName The name of the authorization. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, authorizationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified authorization 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} authorizationName The name of the authorization. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, circuitName: string, authorizationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, circuitName: string, authorizationName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, circuitName: string, authorizationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates an authorization in 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} authorizationName The name of the authorization. - * - * @param {object} authorizationParameters Parameters supplied to the create or - * update express route circuit authorization operation. - * - * @param {string} [authorizationParameters.authorizationKey] The authorization - * key. - * - * @param {string} [authorizationParameters.authorizationUseStatus] - * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. - * Possible values include: 'Available', 'InUse' - * - * @param {string} [authorizationParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [authorizationParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [authorizationParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates an authorization in 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} authorizationName The name of the authorization. - * - * @param {object} authorizationParameters Parameters supplied to the create or - * update express route circuit authorization operation. - * - * @param {string} [authorizationParameters.authorizationKey] The authorization - * key. - * - * @param {string} [authorizationParameters.authorizationUseStatus] - * AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. - * Possible values include: 'Available', 'InUse' - * - * @param {string} [authorizationParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [authorizationParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [authorizationParameters.id] Resource ID. - * - * @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 {ExpressRouteCircuitAuthorization} - 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. - * - * {ExpressRouteCircuitAuthorization} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitAuthorization} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, circuitName: string, authorizationName: string, authorizationParameters: models.ExpressRouteCircuitAuthorization, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all authorizations 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 authorizations 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 {AuthorizationListResult} - 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. - * - * {AuthorizationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link AuthorizationListResult} 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 - * ExpressRouteCircuitPeerings - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface ExpressRouteCircuitPeerings { - - - /** - * Deletes the specified peering 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 {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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified peering 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 {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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified peering for the 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 {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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified peering for the 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 {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 {ExpressRouteCircuitPeering} - 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. - * - * {ExpressRouteCircuitPeering} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitPeering} 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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, circuitName: string, peeringName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, circuitName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a peering in the specified express route circuits. - * - * @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 {object} peeringParameters Parameters supplied to the create or - * update express route circuit peering operation. - * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' - * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {number} [peeringParameters.azureASN] The Azure ASN. - * - * @param {number} [peeringParameters.peerASN] The peer ASN. - * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. - * - * @param {string} [peeringParameters.primaryAzurePort] The primary port. - * - * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. - * - * @param {string} [peeringParameters.sharedKey] The shared key. - * - * @param {number} [peeringParameters.vlanId] The VLAN ID. - * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. - * - * @param {object} [peeringParameters.stats] Gets peering stats. - * - * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the - * peering. - * - * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of - * the peering. - * - * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of - * the peering. - * - * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of - * the peering. - * - * @param {string} [peeringParameters.provisioningState] Gets the provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager - * Etag. - * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. - * - * @param {object} [peeringParameters.routeFilter] The reference of the - * RouteFilter resource. - * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {object} [peeringParameters.expressRouteConnection] The ExpressRoute - * connection. - * - * @param {array} [peeringParameters.connections] The list of circuit - * connections associated with Azure Private Peering for this circuit. - * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [peeringParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a peering in the specified express route circuits. - * - * @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 {object} peeringParameters Parameters supplied to the create or - * update express route circuit peering operation. - * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' - * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {number} [peeringParameters.azureASN] The Azure ASN. - * - * @param {number} [peeringParameters.peerASN] The peer ASN. - * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. - * - * @param {string} [peeringParameters.primaryAzurePort] The primary port. - * - * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. - * - * @param {string} [peeringParameters.sharedKey] The shared key. - * - * @param {number} [peeringParameters.vlanId] The VLAN ID. - * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. - * - * @param {object} [peeringParameters.stats] Gets peering stats. - * - * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the - * peering. - * - * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of - * the peering. - * - * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of - * the peering. - * - * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of - * the peering. - * - * @param {string} [peeringParameters.provisioningState] Gets the provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager - * Etag. - * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. - * - * @param {object} [peeringParameters.routeFilter] The reference of the - * RouteFilter resource. - * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {object} [peeringParameters.expressRouteConnection] The ExpressRoute - * connection. - * - * @param {array} [peeringParameters.connections] The list of circuit - * connections associated with Azure Private Peering for this circuit. - * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [peeringParameters.id] Resource ID. - * - * @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 {ExpressRouteCircuitPeering} - 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. - * - * {ExpressRouteCircuitPeering} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitPeering} 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. - */ - createOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all peerings in a specified express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the express route circuit. - * - * @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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all peerings in a specified express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the express route circuit. - * - * @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 {ExpressRouteCircuitPeeringListResult} - 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. - * - * {ExpressRouteCircuitPeeringListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitPeeringListResult} 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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, circuitName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, circuitName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified peering 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 {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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified peering 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 {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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a peering in the specified express route circuits. - * - * @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 {object} peeringParameters Parameters supplied to the create or - * update express route circuit peering operation. - * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' - * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {number} [peeringParameters.azureASN] The Azure ASN. - * - * @param {number} [peeringParameters.peerASN] The peer ASN. - * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. - * - * @param {string} [peeringParameters.primaryAzurePort] The primary port. - * - * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. - * - * @param {string} [peeringParameters.sharedKey] The shared key. - * - * @param {number} [peeringParameters.vlanId] The VLAN ID. - * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. - * - * @param {object} [peeringParameters.stats] Gets peering stats. - * - * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the - * peering. - * - * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of - * the peering. - * - * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of - * the peering. - * - * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of - * the peering. - * - * @param {string} [peeringParameters.provisioningState] Gets the provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager - * Etag. - * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. - * - * @param {object} [peeringParameters.routeFilter] The reference of the - * RouteFilter resource. - * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {object} [peeringParameters.expressRouteConnection] The ExpressRoute - * connection. - * - * @param {array} [peeringParameters.connections] The list of circuit - * connections associated with Azure Private Peering for this circuit. - * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [peeringParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a peering in the specified express route circuits. - * - * @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 {object} peeringParameters Parameters supplied to the create or - * update express route circuit peering operation. - * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' - * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {number} [peeringParameters.azureASN] The Azure ASN. - * - * @param {number} [peeringParameters.peerASN] The peer ASN. - * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. - * - * @param {string} [peeringParameters.primaryAzurePort] The primary port. - * - * @param {string} [peeringParameters.secondaryAzurePort] The secondary port. - * - * @param {string} [peeringParameters.sharedKey] The shared key. - * - * @param {number} [peeringParameters.vlanId] The VLAN ID. - * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. - * - * @param {object} [peeringParameters.stats] Gets peering stats. - * - * @param {number} [peeringParameters.stats.primarybytesIn] Gets BytesIn of the - * peering. - * - * @param {number} [peeringParameters.stats.primarybytesOut] Gets BytesOut of - * the peering. - * - * @param {number} [peeringParameters.stats.secondarybytesIn] Gets BytesIn of - * the peering. - * - * @param {number} [peeringParameters.stats.secondarybytesOut] Gets BytesOut of - * the peering. - * - * @param {string} [peeringParameters.provisioningState] Gets the provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager - * Etag. - * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. - * - * @param {object} [peeringParameters.routeFilter] The reference of the - * RouteFilter resource. - * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {object} [peeringParameters.expressRouteConnection] The ExpressRoute - * connection. - * - * @param {array} [peeringParameters.connections] The list of circuit - * connections associated with Azure Private Peering for this circuit. - * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [peeringParameters.id] Resource ID. - * - * @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 {ExpressRouteCircuitPeering} - 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. - * - * {ExpressRouteCircuitPeering} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitPeering} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, peeringParameters: models.ExpressRouteCircuitPeering, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all peerings in a specified 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 peerings in a specified 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 {ExpressRouteCircuitPeeringListResult} - 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. - * - * {ExpressRouteCircuitPeeringListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitPeeringListResult} 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 - * ExpressRouteCircuitConnections - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface ExpressRouteCircuitConnections { - - - /** - * Deletes the specified 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 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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified 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 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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified 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 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 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 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 {ExpressRouteCircuitConnection} - 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. - * - * {ExpressRouteCircuitConnection} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitConnection} 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; - - - /** - * Creates or updates a Express Route Circuit Connection in the specified - * express route circuits. - * - * @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 express route circuit - * connection. - * - * @param {object} expressRouteCircuitConnectionParameters Parameters supplied - * to the create or update express route circuit circuit connection operation. - * - * @param {object} - * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the circuit - * initiating connection. - * - * @param {object} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the peered - * circuit. - * - * @param {string} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] - * Resource ID. - * - * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 - * IP address space to carve out Customer addresses for tunnels. - * - * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] - * The authorization key. - * - * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. - * - * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a Express Route Circuit Connection in the specified - * express route circuits. - * - * @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 express route circuit - * connection. - * - * @param {object} expressRouteCircuitConnectionParameters Parameters supplied - * to the create or update express route circuit circuit connection operation. - * - * @param {object} - * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the circuit - * initiating connection. - * - * @param {object} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the peered - * circuit. - * - * @param {string} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] - * Resource ID. - * - * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 - * IP address space to carve out Customer addresses for tunnels. - * - * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] - * The authorization key. - * - * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. - * - * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. - * - * @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 {ExpressRouteCircuitConnection} - 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. - * - * {ExpressRouteCircuitConnection} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitConnection} 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. - */ - createOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all global reach 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 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 {ExpressRouteCircuitConnectionListResult} - 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. - * - * {ExpressRouteCircuitConnectionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitConnectionListResult} 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; - - - /** - * Deletes the specified 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 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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified 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 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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a Express Route Circuit Connection in the specified - * express route circuits. - * - * @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 express route circuit - * connection. - * - * @param {object} expressRouteCircuitConnectionParameters Parameters supplied - * to the create or update express route circuit circuit connection operation. - * - * @param {object} - * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the circuit - * initiating connection. - * - * @param {object} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the peered - * circuit. - * - * @param {string} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] - * Resource ID. - * - * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 - * IP address space to carve out Customer addresses for tunnels. - * - * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] - * The authorization key. - * - * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. - * - * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a Express Route Circuit Connection in the specified - * express route circuits. - * - * @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 express route circuit - * connection. - * - * @param {object} expressRouteCircuitConnectionParameters Parameters supplied - * to the create or update express route circuit circuit connection operation. - * - * @param {object} - * [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the circuit - * initiating connection. - * - * @param {object} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering] - * Reference to Express Route Circuit Private Peering Resource of the peered - * circuit. - * - * @param {string} - * [expressRouteCircuitConnectionParameters.peerExpressRouteCircuitPeering.id] - * Resource ID. - * - * @param {string} [expressRouteCircuitConnectionParameters.addressPrefix] /29 - * IP address space to carve out Customer addresses for tunnels. - * - * @param {string} [expressRouteCircuitConnectionParameters.authorizationKey] - * The authorization key. - * - * @param {string} [expressRouteCircuitConnectionParameters.name] Gets name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. - * - * @param {string} [expressRouteCircuitConnectionParameters.id] Resource ID. - * - * @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 {ExpressRouteCircuitConnection} - 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. - * - * {ExpressRouteCircuitConnection} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitConnection} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, circuitName: string, peeringName: string, connectionName: string, expressRouteCircuitConnectionParameters: models.ExpressRouteCircuitConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all global reach 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 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 {ExpressRouteCircuitConnectionListResult} - 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. - * - * {ExpressRouteCircuitConnectionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitConnectionListResult} 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 - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface ExpressRouteCircuits { - - - /** - * Deletes 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 {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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes 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 {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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, circuitName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, circuitName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets information about the specified express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of express route circuit. - * - * @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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets information about the specified express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of express route circuit. - * - * @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 {ExpressRouteCircuit} - 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. - * - * {ExpressRouteCircuit} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuit} 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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, circuitName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, circuitName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates an express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the circuit. - * - * @param {object} parameters Parameters supplied to the create or update - * express route circuit operation. - * - * @param {object} [parameters.sku] The SKU. - * - * @param {string} [parameters.sku.name] The name of the SKU. - * - * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values - * are 'Standard', 'Premium' or 'Basic'. Possible values include: 'Standard', - * 'Premium', 'Basic' - * - * @param {string} [parameters.sku.family] The family of the SKU. Possible - * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: - * 'UnlimitedData', 'MeteredData' - * - * @param {boolean} [parameters.allowClassicOperations] Allow classic - * operations - * - * @param {string} [parameters.circuitProvisioningState] The - * CircuitProvisioningState state of the resource. - * - * @param {string} [parameters.serviceProviderProvisioningState] The - * ServiceProviderProvisioningState state of the resource. Possible values are - * 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' - * - * @param {array} [parameters.authorizations] The list of authorizations. - * - * @param {array} [parameters.peerings] The list of peerings. - * - * @param {string} [parameters.serviceKey] The ServiceKey. - * - * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. - * - * @param {object} [parameters.serviceProviderProperties] The - * ServiceProviderProperties. - * - * @param {string} [parameters.serviceProviderProperties.serviceProviderName] - * The serviceProviderName. - * - * @param {string} [parameters.serviceProviderProperties.peeringLocation] The - * peering location. - * - * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The - * BandwidthInMbps. - * - * @param {object} [parameters.expressRoutePort] The reference to the - * ExpressRoutePort resource when the circuit is provisioned on an - * ExpressRoutePort resource. - * - * @param {string} [parameters.expressRoutePort.id] Resource ID. - * - * @param {number} [parameters.bandwidthInGbps] The bandwidth of the circuit - * when the circuit is provisioned on an ExpressRoutePort resource. - * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. - * - * @param {boolean} [parameters.allowGlobalReach] Flag to enable Global Reach - * on the circuit. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates an express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the circuit. - * - * @param {object} parameters Parameters supplied to the create or update - * express route circuit operation. - * - * @param {object} [parameters.sku] The SKU. - * - * @param {string} [parameters.sku.name] The name of the SKU. - * - * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values - * are 'Standard', 'Premium' or 'Basic'. Possible values include: 'Standard', - * 'Premium', 'Basic' - * - * @param {string} [parameters.sku.family] The family of the SKU. Possible - * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: - * 'UnlimitedData', 'MeteredData' - * - * @param {boolean} [parameters.allowClassicOperations] Allow classic - * operations - * - * @param {string} [parameters.circuitProvisioningState] The - * CircuitProvisioningState state of the resource. - * - * @param {string} [parameters.serviceProviderProvisioningState] The - * ServiceProviderProvisioningState state of the resource. Possible values are - * 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' - * - * @param {array} [parameters.authorizations] The list of authorizations. - * - * @param {array} [parameters.peerings] The list of peerings. - * - * @param {string} [parameters.serviceKey] The ServiceKey. - * - * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. - * - * @param {object} [parameters.serviceProviderProperties] The - * ServiceProviderProperties. - * - * @param {string} [parameters.serviceProviderProperties.serviceProviderName] - * The serviceProviderName. - * - * @param {string} [parameters.serviceProviderProperties.peeringLocation] The - * peering location. - * - * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The - * BandwidthInMbps. - * - * @param {object} [parameters.expressRoutePort] The reference to the - * ExpressRoutePort resource when the circuit is provisioned on an - * ExpressRoutePort resource. - * - * @param {string} [parameters.expressRoutePort.id] Resource ID. - * - * @param {number} [parameters.bandwidthInGbps] The bandwidth of the circuit - * when the circuit is provisioned on an ExpressRoutePort resource. - * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. - * - * @param {boolean} [parameters.allowGlobalReach] Flag to enable Global Reach - * on the circuit. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ExpressRouteCircuit} - 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. - * - * {ExpressRouteCircuit} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuit} 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. - */ - createOrUpdate(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates an express route circuit tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the circuit. - * - * @param {object} parameters Parameters supplied to update express route - * circuit tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates an express route circuit tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the circuit. - * - * @param {object} parameters Parameters supplied to update express route - * circuit tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ExpressRouteCircuit} - 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. - * - * {ExpressRouteCircuit} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuit} 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. - */ - updateTags(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the currently advertised ARP table associated with the express route - * circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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. - */ - listArpTableWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the currently advertised ARP table associated with the express route - * circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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 {ExpressRouteCircuitsArpTableListResult} - 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. - * - * {ExpressRouteCircuitsArpTableListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitsArpTableListResult} 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. - */ - listArpTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listArpTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; - listArpTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the currently advertised routes table associated with the express route - * circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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. - */ - listRoutesTableWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the currently advertised routes table associated with the express route - * circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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 {ExpressRouteCircuitsRoutesTableListResult} - 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. - * - * {ExpressRouteCircuitsRoutesTableListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitsRoutesTableListResult} - * 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. - */ - listRoutesTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listRoutesTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; - listRoutesTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the currently advertised routes table summary associated with the - * express route circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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. - */ - listRoutesTableSummaryWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the currently advertised routes table summary associated with the - * express route circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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 {ExpressRouteCircuitsRoutesTableSummaryListResult} - 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. - * - * {ExpressRouteCircuitsRoutesTableSummaryListResult} [result] - The deserialized result object if an error did not occur. - * See {@link - * ExpressRouteCircuitsRoutesTableSummaryListResult} 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. - */ - listRoutesTableSummary(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listRoutesTableSummary(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; - listRoutesTableSummary(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the stats from an express route circuit in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the express route circuit. - * - * @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. - */ - getStatsWithHttpOperationResponse(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the stats from an express route circuit in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the express route circuit. - * - * @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 {ExpressRouteCircuitStats} - 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. - * - * {ExpressRouteCircuitStats} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitStats} 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. - */ - getStats(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getStats(resourceGroupName: string, circuitName: string, callback: ServiceCallback): void; - getStats(resourceGroupName: string, circuitName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all stats from an express route circuit in a resource group. - * - * @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 {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. - */ - getPeeringStatsWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all stats from an express route circuit in a resource group. - * - * @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 {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 {ExpressRouteCircuitStats} - 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. - * - * {ExpressRouteCircuitStats} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitStats} 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. - */ - getPeeringStats(resourceGroupName: string, circuitName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getPeeringStats(resourceGroupName: string, circuitName: string, peeringName: string, callback: ServiceCallback): void; - getPeeringStats(resourceGroupName: string, circuitName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the express route circuits in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the express route circuits in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {ExpressRouteCircuitListResult} - 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. - * - * {ExpressRouteCircuitListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitListResult} 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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the express route circuits in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the express route circuits in a subscription. - * - * @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 {ExpressRouteCircuitListResult} - 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. - * - * {ExpressRouteCircuitListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitListResult} 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. - */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes 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 {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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes 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 {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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, circuitName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, circuitName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, circuitName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates an express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the circuit. - * - * @param {object} parameters Parameters supplied to the create or update - * express route circuit operation. - * - * @param {object} [parameters.sku] The SKU. - * - * @param {string} [parameters.sku.name] The name of the SKU. - * - * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values - * are 'Standard', 'Premium' or 'Basic'. Possible values include: 'Standard', - * 'Premium', 'Basic' - * - * @param {string} [parameters.sku.family] The family of the SKU. Possible - * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: - * 'UnlimitedData', 'MeteredData' - * - * @param {boolean} [parameters.allowClassicOperations] Allow classic - * operations - * - * @param {string} [parameters.circuitProvisioningState] The - * CircuitProvisioningState state of the resource. - * - * @param {string} [parameters.serviceProviderProvisioningState] The - * ServiceProviderProvisioningState state of the resource. Possible values are - * 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' - * - * @param {array} [parameters.authorizations] The list of authorizations. - * - * @param {array} [parameters.peerings] The list of peerings. - * - * @param {string} [parameters.serviceKey] The ServiceKey. - * - * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. - * - * @param {object} [parameters.serviceProviderProperties] The - * ServiceProviderProperties. - * - * @param {string} [parameters.serviceProviderProperties.serviceProviderName] - * The serviceProviderName. - * - * @param {string} [parameters.serviceProviderProperties.peeringLocation] The - * peering location. - * - * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The - * BandwidthInMbps. - * - * @param {object} [parameters.expressRoutePort] The reference to the - * ExpressRoutePort resource when the circuit is provisioned on an - * ExpressRoutePort resource. - * - * @param {string} [parameters.expressRoutePort.id] Resource ID. - * - * @param {number} [parameters.bandwidthInGbps] The bandwidth of the circuit - * when the circuit is provisioned on an ExpressRoutePort resource. - * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. - * - * @param {boolean} [parameters.allowGlobalReach] Flag to enable Global Reach - * on the circuit. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates an express route circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the circuit. - * - * @param {object} parameters Parameters supplied to the create or update - * express route circuit operation. - * - * @param {object} [parameters.sku] The SKU. - * - * @param {string} [parameters.sku.name] The name of the SKU. - * - * @param {string} [parameters.sku.tier] The tier of the SKU. Possible values - * are 'Standard', 'Premium' or 'Basic'. Possible values include: 'Standard', - * 'Premium', 'Basic' - * - * @param {string} [parameters.sku.family] The family of the SKU. Possible - * values are: 'UnlimitedData' and 'MeteredData'. Possible values include: - * 'UnlimitedData', 'MeteredData' - * - * @param {boolean} [parameters.allowClassicOperations] Allow classic - * operations - * - * @param {string} [parameters.circuitProvisioningState] The - * CircuitProvisioningState state of the resource. - * - * @param {string} [parameters.serviceProviderProvisioningState] The - * ServiceProviderProvisioningState state of the resource. Possible values are - * 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' - * - * @param {array} [parameters.authorizations] The list of authorizations. - * - * @param {array} [parameters.peerings] The list of peerings. - * - * @param {string} [parameters.serviceKey] The ServiceKey. - * - * @param {string} [parameters.serviceProviderNotes] The ServiceProviderNotes. - * - * @param {object} [parameters.serviceProviderProperties] The - * ServiceProviderProperties. - * - * @param {string} [parameters.serviceProviderProperties.serviceProviderName] - * The serviceProviderName. - * - * @param {string} [parameters.serviceProviderProperties.peeringLocation] The - * peering location. - * - * @param {number} [parameters.serviceProviderProperties.bandwidthInMbps] The - * BandwidthInMbps. - * - * @param {object} [parameters.expressRoutePort] The reference to the - * ExpressRoutePort resource when the circuit is provisioned on an - * ExpressRoutePort resource. - * - * @param {string} [parameters.expressRoutePort.id] Resource ID. - * - * @param {number} [parameters.bandwidthInGbps] The bandwidth of the circuit - * when the circuit is provisioned on an ExpressRoutePort resource. - * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.gatewayManagerEtag] The GatewayManager Etag. - * - * @param {boolean} [parameters.allowGlobalReach] Flag to enable Global Reach - * on the circuit. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ExpressRouteCircuit} - 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. - * - * {ExpressRouteCircuit} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuit} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, circuitName: string, parameters: models.ExpressRouteCircuit, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates an express route circuit tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the circuit. - * - * @param {object} parameters Parameters supplied to update express route - * circuit tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates an express route circuit tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} circuitName The name of the circuit. - * - * @param {object} parameters Parameters supplied to update express route - * circuit tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ExpressRouteCircuit} - 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. - * - * {ExpressRouteCircuit} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuit} 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. - */ - beginUpdateTags(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, circuitName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the currently advertised ARP table associated with the express route - * circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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. - */ - beginListArpTableWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the currently advertised ARP table associated with the express route - * circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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 {ExpressRouteCircuitsArpTableListResult} - 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. - * - * {ExpressRouteCircuitsArpTableListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitsArpTableListResult} 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. - */ - beginListArpTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginListArpTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; - beginListArpTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the currently advertised routes table associated with the express route - * circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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. - */ - beginListRoutesTableWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the currently advertised routes table associated with the express route - * circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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 {ExpressRouteCircuitsRoutesTableListResult} - 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. - * - * {ExpressRouteCircuitsRoutesTableListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitsRoutesTableListResult} - * 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. - */ - beginListRoutesTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginListRoutesTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; - beginListRoutesTable(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the currently advertised routes table summary associated with the - * express route circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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. - */ - beginListRoutesTableSummaryWithHttpOperationResponse(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the currently advertised routes table summary associated with the - * express route circuit in a resource group. - * - * @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} devicePath The path of the device. - * - * @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 {ExpressRouteCircuitsRoutesTableSummaryListResult} - 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. - * - * {ExpressRouteCircuitsRoutesTableSummaryListResult} [result] - The deserialized result object if an error did not occur. - * See {@link - * ExpressRouteCircuitsRoutesTableSummaryListResult} 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. - */ - beginListRoutesTableSummary(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginListRoutesTableSummary(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; - beginListRoutesTableSummary(resourceGroupName: string, circuitName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the express route circuits in a resource group. - * - * @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 the express route circuits in a resource group. - * - * @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 {ExpressRouteCircuitListResult} - 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. - * - * {ExpressRouteCircuitListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitListResult} 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; - - - /** - * Gets all the express route circuits in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the express route circuits in a subscription. - * - * @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 {ExpressRouteCircuitListResult} - 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. - * - * {ExpressRouteCircuitListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitListResult} 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. - */ - listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAllNext(nextPageLink: string, callback: ServiceCallback): void; - listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ExpressRouteServiceProviders - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface ExpressRouteServiceProviders { - - - /** - * Gets all the available express route service providers. - * - * @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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the available express route service providers. - * - * @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 {ExpressRouteServiceProviderListResult} - 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. - * - * {ExpressRouteServiceProviderListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteServiceProviderListResult} 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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the available express route service providers. - * - * @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 the available express route service providers. - * - * @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 {ExpressRouteServiceProviderListResult} - 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. - * - * {ExpressRouteServiceProviderListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteServiceProviderListResult} 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 - * ExpressRouteCrossConnections - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface ExpressRouteCrossConnections { - - - /** - * Retrieves all the ExpressRouteCrossConnections in a subscription. - * - * @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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the ExpressRouteCrossConnections in a subscription. - * - * @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 {ExpressRouteCrossConnectionListResult} - 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. - * - * {ExpressRouteCrossConnectionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnectionListResult} 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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves all the ExpressRouteCrossConnections in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the ExpressRouteCrossConnections in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {ExpressRouteCrossConnectionListResult} - 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. - * - * {ExpressRouteCrossConnectionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnectionListResult} 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. - */ - listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets details about the specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group (peering - * location of the circuit). - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection (service key of the circuit). - * - * @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, crossConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets details about the specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group (peering - * location of the circuit). - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection (service key of the circuit). - * - * @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 {ExpressRouteCrossConnection} - 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. - * - * {ExpressRouteCrossConnection} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnection} 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, crossConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, crossConnectionName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, crossConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Update the specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {object} parameters Parameters supplied to the update express route - * crossConnection operation. - * - * @param {string} [parameters.peeringLocation] The peering location of the - * ExpressRoute circuit. - * - * @param {number} [parameters.bandwidthInMbps] The circuit bandwidth In Mbps. - * - * @param {object} [parameters.expressRouteCircuit] The ExpressRouteCircuit - * - * @param {string} [parameters.expressRouteCircuit.id] Corresponding Express - * Route Circuit Id. - * - * @param {string} [parameters.serviceProviderProvisioningState] The - * provisioning state of the circuit in the connectivity provider system. - * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' - * - * @param {string} [parameters.serviceProviderNotes] Additional read only notes - * set by the connectivity provider. - * - * @param {array} [parameters.peerings] The list of peerings. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Update the specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {object} parameters Parameters supplied to the update express route - * crossConnection operation. - * - * @param {string} [parameters.peeringLocation] The peering location of the - * ExpressRoute circuit. - * - * @param {number} [parameters.bandwidthInMbps] The circuit bandwidth In Mbps. - * - * @param {object} [parameters.expressRouteCircuit] The ExpressRouteCircuit - * - * @param {string} [parameters.expressRouteCircuit.id] Corresponding Express - * Route Circuit Id. - * - * @param {string} [parameters.serviceProviderProvisioningState] The - * provisioning state of the circuit in the connectivity provider system. - * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' - * - * @param {string} [parameters.serviceProviderNotes] Additional read only notes - * set by the connectivity provider. - * - * @param {array} [parameters.peerings] The list of peerings. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ExpressRouteCrossConnection} - 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. - * - * {ExpressRouteCrossConnection} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnection} 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. - */ - createOrUpdate(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates an express route cross connection tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the cross connection. - * - * @param {object} crossConnectionParameters Parameters supplied to update - * express route cross connection tags. - * - * @param {object} [crossConnectionParameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates an express route cross connection tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the cross connection. - * - * @param {object} crossConnectionParameters Parameters supplied to update - * express route cross connection tags. - * - * @param {object} [crossConnectionParameters.tags] Resource tags. - * - * @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 {ExpressRouteCrossConnection} - 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. - * - * {ExpressRouteCrossConnection} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnection} 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. - */ - updateTags(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the currently advertised ARP table associated with the express route - * cross connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device - * - * @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. - */ - listArpTableWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the currently advertised ARP table associated with the express route - * cross connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device - * - * @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 {ExpressRouteCircuitsArpTableListResult} - 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. - * - * {ExpressRouteCircuitsArpTableListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitsArpTableListResult} 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. - */ - listArpTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listArpTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; - listArpTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the route table summary associated with the express route cross - * connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device. - * - * @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. - */ - listRoutesTableSummaryWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the route table summary associated with the express route cross - * connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device. - * - * @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 {ExpressRouteCrossConnectionsRoutesTableSummaryListResult} - 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. - * - * {ExpressRouteCrossConnectionsRoutesTableSummaryListResult} [result] - The deserialized result object if an error did not occur. - * See {@link - * ExpressRouteCrossConnectionsRoutesTableSummaryListResult} - * 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. - */ - listRoutesTableSummary(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listRoutesTableSummary(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; - listRoutesTableSummary(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the currently advertised routes table associated with the express route - * cross connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device. - * - * @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. - */ - listRoutesTableWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the currently advertised routes table associated with the express route - * cross connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device. - * - * @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 {ExpressRouteCircuitsRoutesTableListResult} - 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. - * - * {ExpressRouteCircuitsRoutesTableListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitsRoutesTableListResult} - * 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. - */ - listRoutesTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listRoutesTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; - listRoutesTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Update the specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {object} parameters Parameters supplied to the update express route - * crossConnection operation. - * - * @param {string} [parameters.peeringLocation] The peering location of the - * ExpressRoute circuit. - * - * @param {number} [parameters.bandwidthInMbps] The circuit bandwidth In Mbps. - * - * @param {object} [parameters.expressRouteCircuit] The ExpressRouteCircuit - * - * @param {string} [parameters.expressRouteCircuit.id] Corresponding Express - * Route Circuit Id. - * - * @param {string} [parameters.serviceProviderProvisioningState] The - * provisioning state of the circuit in the connectivity provider system. - * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' - * - * @param {string} [parameters.serviceProviderNotes] Additional read only notes - * set by the connectivity provider. - * - * @param {array} [parameters.peerings] The list of peerings. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Update the specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {object} parameters Parameters supplied to the update express route - * crossConnection operation. - * - * @param {string} [parameters.peeringLocation] The peering location of the - * ExpressRoute circuit. - * - * @param {number} [parameters.bandwidthInMbps] The circuit bandwidth In Mbps. - * - * @param {object} [parameters.expressRouteCircuit] The ExpressRouteCircuit - * - * @param {string} [parameters.expressRouteCircuit.id] Corresponding Express - * Route Circuit Id. - * - * @param {string} [parameters.serviceProviderProvisioningState] The - * provisioning state of the circuit in the connectivity provider system. - * Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. - * Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', - * 'Deprovisioning' - * - * @param {string} [parameters.serviceProviderNotes] Additional read only notes - * set by the connectivity provider. - * - * @param {array} [parameters.peerings] The list of peerings. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ExpressRouteCrossConnection} - 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. - * - * {ExpressRouteCrossConnection} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnection} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, crossConnectionName: string, parameters: models.ExpressRouteCrossConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates an express route cross connection tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the cross connection. - * - * @param {object} crossConnectionParameters Parameters supplied to update - * express route cross connection tags. - * - * @param {object} [crossConnectionParameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates an express route cross connection tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the cross connection. - * - * @param {object} crossConnectionParameters Parameters supplied to update - * express route cross connection tags. - * - * @param {object} [crossConnectionParameters.tags] Resource tags. - * - * @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 {ExpressRouteCrossConnection} - 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. - * - * {ExpressRouteCrossConnection} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnection} 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. - */ - beginUpdateTags(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, crossConnectionName: string, crossConnectionParameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the currently advertised ARP table associated with the express route - * cross connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device - * - * @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. - */ - beginListArpTableWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the currently advertised ARP table associated with the express route - * cross connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device - * - * @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 {ExpressRouteCircuitsArpTableListResult} - 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. - * - * {ExpressRouteCircuitsArpTableListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitsArpTableListResult} 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. - */ - beginListArpTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginListArpTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; - beginListArpTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the route table summary associated with the express route cross - * connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device. - * - * @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. - */ - beginListRoutesTableSummaryWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the route table summary associated with the express route cross - * connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device. - * - * @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 {ExpressRouteCrossConnectionsRoutesTableSummaryListResult} - 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. - * - * {ExpressRouteCrossConnectionsRoutesTableSummaryListResult} [result] - The deserialized result object if an error did not occur. - * See {@link - * ExpressRouteCrossConnectionsRoutesTableSummaryListResult} - * 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. - */ - beginListRoutesTableSummary(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginListRoutesTableSummary(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; - beginListRoutesTableSummary(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the currently advertised routes table associated with the express route - * cross connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device. - * - * @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. - */ - beginListRoutesTableWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the currently advertised routes table associated with the express route - * cross connection in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {string} devicePath The path of the device. - * - * @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 {ExpressRouteCircuitsRoutesTableListResult} - 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. - * - * {ExpressRouteCircuitsRoutesTableListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCircuitsRoutesTableListResult} - * 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. - */ - beginListRoutesTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginListRoutesTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, callback: ServiceCallback): void; - beginListRoutesTable(resourceGroupName: string, crossConnectionName: string, peeringName: string, devicePath: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves all the ExpressRouteCrossConnections in a subscription. - * - * @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>; - - /** - * Retrieves all the ExpressRouteCrossConnections in a subscription. - * - * @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 {ExpressRouteCrossConnectionListResult} - 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. - * - * {ExpressRouteCrossConnectionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnectionListResult} 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; - - - /** - * Retrieves all the ExpressRouteCrossConnections in a resource group. - * - * @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. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the ExpressRouteCrossConnections in a resource group. - * - * @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 {ExpressRouteCrossConnectionListResult} - 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. - * - * {ExpressRouteCrossConnectionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnectionListResult} 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. - */ - listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ExpressRouteCrossConnectionPeerings - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface ExpressRouteCrossConnectionPeerings { - - - /** - * Gets all peerings in a specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @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, crossConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all peerings in a specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @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 {ExpressRouteCrossConnectionPeeringList} - 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. - * - * {ExpressRouteCrossConnectionPeeringList} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnectionPeeringList} 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, crossConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, crossConnectionName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, crossConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified peering from the ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified peering from the ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, crossConnectionName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, crossConnectionName: string, peeringName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, crossConnectionName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified peering for the ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @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. - */ - getWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified peering for the ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @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 {ExpressRouteCrossConnectionPeering} - 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. - * - * {ExpressRouteCrossConnectionPeering} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnectionPeering} 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, crossConnectionName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, crossConnectionName: string, peeringName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, crossConnectionName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {object} peeringParameters Parameters supplied to the create or - * update ExpressRouteCrossConnection peering operation. - * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' - * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {number} [peeringParameters.peerASN] The peer ASN. - * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. - * - * @param {string} [peeringParameters.sharedKey] The shared key. - * - * @param {number} [peeringParameters.vlanId] The VLAN ID. - * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. - * - * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager - * Etag. - * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. - * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [peeringParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {object} peeringParameters Parameters supplied to the create or - * update ExpressRouteCrossConnection peering operation. - * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' - * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {number} [peeringParameters.peerASN] The peer ASN. - * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. - * - * @param {string} [peeringParameters.sharedKey] The shared key. - * - * @param {number} [peeringParameters.vlanId] The VLAN ID. - * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. - * - * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager - * Etag. - * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. - * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [peeringParameters.id] Resource ID. - * - * @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 {ExpressRouteCrossConnectionPeering} - 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. - * - * {ExpressRouteCrossConnectionPeering} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnectionPeering} 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. - */ - createOrUpdate(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified peering from the ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified peering from the ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, crossConnectionName: string, peeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, crossConnectionName: string, peeringName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, crossConnectionName: string, peeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {object} peeringParameters Parameters supplied to the create or - * update ExpressRouteCrossConnection peering operation. - * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' - * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {number} [peeringParameters.peerASN] The peer ASN. - * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. - * - * @param {string} [peeringParameters.sharedKey] The shared key. - * - * @param {number} [peeringParameters.vlanId] The VLAN ID. - * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. - * - * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager - * Etag. - * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. - * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [peeringParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a peering in the specified ExpressRouteCrossConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} crossConnectionName The name of the - * ExpressRouteCrossConnection. - * - * @param {string} peeringName The name of the peering. - * - * @param {object} peeringParameters Parameters supplied to the create or - * update ExpressRouteCrossConnection peering operation. - * - * @param {string} [peeringParameters.peeringType] The peering type. Possible - * values include: 'AzurePublicPeering', 'AzurePrivatePeering', - * 'MicrosoftPeering' - * - * @param {string} [peeringParameters.state] The peering state. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {number} [peeringParameters.peerASN] The peer ASN. - * - * @param {string} [peeringParameters.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} [peeringParameters.secondaryPeerAddressPrefix] The secondary - * address prefix. - * - * @param {string} [peeringParameters.sharedKey] The shared key. - * - * @param {number} [peeringParameters.vlanId] The VLAN ID. - * - * @param {object} [peeringParameters.microsoftPeeringConfig] The Microsoft - * peering configuration. - * - * @param {string} [peeringParameters.gatewayManagerEtag] The GatewayManager - * Etag. - * - * @param {string} [peeringParameters.lastModifiedBy] Gets whether the provider - * or the customer last modified the peering. - * - * @param {object} [peeringParameters.ipv6PeeringConfig] The IPv6 peering - * configuration. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.primaryPeerAddressPrefix] The primary - * address prefix. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.secondaryPeerAddressPrefix] The - * secondary address prefix. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig] - * The Microsoft peering configuration. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixes] - * The reference of AdvertisedPublicPrefixes. - * - * @param {array} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedCommunities] - * The communities of bgp peering. Spepcified for microsoft peering - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.advertisedPublicPrefixesState] - * AdvertisedPublicPrefixState of the Peering resource. Possible values are - * 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - * Possible values include: 'NotConfigured', 'Configuring', 'Configured', - * 'ValidationNeeded' - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.legacyMode] The - * legacy mode of the peering. - * - * @param {number} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.customerASN] The - * CustomerASN of the peering. - * - * @param {string} - * [peeringParameters.ipv6PeeringConfig.microsoftPeeringConfig.routingRegistryName] - * The RoutingRegistryName of the configuration. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter] The - * reference of the RouteFilter resource. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.rules] - * Collection of RouteFilterRules contained within a route filter. - * - * @param {array} [peeringParameters.ipv6PeeringConfig.routeFilter.peerings] A - * collection of references to express route circuit peerings. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.id] - * Resource ID. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.routeFilter.location] - * Resource location. - * - * @param {object} [peeringParameters.ipv6PeeringConfig.routeFilter.tags] - * Resource tags. - * - * @param {string} [peeringParameters.ipv6PeeringConfig.state] The state of - * peering. Possible values are: 'Disabled' and 'Enabled'. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {string} [peeringParameters.name] Gets name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [peeringParameters.id] Resource ID. - * - * @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 {ExpressRouteCrossConnectionPeering} - 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. - * - * {ExpressRouteCrossConnectionPeering} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnectionPeering} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, crossConnectionName: string, peeringName: string, peeringParameters: models.ExpressRouteCrossConnectionPeering, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all peerings in a specified ExpressRouteCrossConnection. - * - * @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 peerings in a specified ExpressRouteCrossConnection. - * - * @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 {ExpressRouteCrossConnectionPeeringList} - 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. - * - * {ExpressRouteCrossConnectionPeeringList} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteCrossConnectionPeeringList} 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 - * ExpressRouteGateways - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface ExpressRouteGateways { - - - /** - * Lists ExpressRoute gateways under a given subscription. - * - * @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. - */ - listBySubscriptionWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists ExpressRoute gateways under a given subscription. - * - * @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 {ExpressRouteGatewayList} - 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. - * - * {ExpressRouteGatewayList} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteGatewayList} 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. - */ - listBySubscription(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listBySubscription(callback: ServiceCallback): void; - listBySubscription(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists ExpressRoute gateways in a given resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists ExpressRoute gateways in a given resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {ExpressRouteGatewayList} - 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. - * - * {ExpressRouteGatewayList} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteGatewayList} 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. - */ - listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a ExpressRoute gateway in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {object} putExpressRouteGatewayParameters Parameters required in an - * ExpressRoute gateway PUT operation. - * - * @param {object} [putExpressRouteGatewayParameters.autoScaleConfiguration] - * Configuration for auto scaling. - * - * @param {object} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds] Minimum and - * maximum number of scale units to deploy. - * - * @param {number} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds.min] Minimum - * number of scale units deployed for ExpressRoute gateway. - * - * @param {number} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds.max] Maximum - * number of scale units deployed for ExpressRoute gateway. - * - * @param {object} putExpressRouteGatewayParameters.virtualHub The Virtual Hub - * where the ExpressRoute gateway is or will be deployed. - * - * @param {string} [putExpressRouteGatewayParameters.virtualHub.id] The - * resource URI for the Virtual Hub where the ExpressRoute gateway is or will - * be deployed. The Virtual Hub resource and the ExpressRoute gateway resource - * reside in the same subscription. - * - * @param {string} [putExpressRouteGatewayParameters.id] Resource ID. - * - * @param {string} [putExpressRouteGatewayParameters.location] Resource - * location. - * - * @param {object} [putExpressRouteGatewayParameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, expressRouteGatewayName: string, putExpressRouteGatewayParameters: models.ExpressRouteGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a ExpressRoute gateway in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {object} putExpressRouteGatewayParameters Parameters required in an - * ExpressRoute gateway PUT operation. - * - * @param {object} [putExpressRouteGatewayParameters.autoScaleConfiguration] - * Configuration for auto scaling. - * - * @param {object} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds] Minimum and - * maximum number of scale units to deploy. - * - * @param {number} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds.min] Minimum - * number of scale units deployed for ExpressRoute gateway. - * - * @param {number} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds.max] Maximum - * number of scale units deployed for ExpressRoute gateway. - * - * @param {object} putExpressRouteGatewayParameters.virtualHub The Virtual Hub - * where the ExpressRoute gateway is or will be deployed. - * - * @param {string} [putExpressRouteGatewayParameters.virtualHub.id] The - * resource URI for the Virtual Hub where the ExpressRoute gateway is or will - * be deployed. The Virtual Hub resource and the ExpressRoute gateway resource - * reside in the same subscription. - * - * @param {string} [putExpressRouteGatewayParameters.id] Resource ID. - * - * @param {string} [putExpressRouteGatewayParameters.location] Resource - * location. - * - * @param {object} [putExpressRouteGatewayParameters.tags] Resource tags. - * - * @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 {ExpressRouteGateway} - 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. - * - * {ExpressRouteGateway} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteGateway} 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. - */ - createOrUpdate(resourceGroupName: string, expressRouteGatewayName: string, putExpressRouteGatewayParameters: models.ExpressRouteGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, expressRouteGatewayName: string, putExpressRouteGatewayParameters: models.ExpressRouteGateway, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, expressRouteGatewayName: string, putExpressRouteGatewayParameters: models.ExpressRouteGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Fetches the details of a ExpressRoute gateway in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @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, expressRouteGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Fetches the details of a ExpressRoute gateway in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @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 {ExpressRouteGateway} - 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. - * - * {ExpressRouteGateway} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteGateway} 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, expressRouteGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, expressRouteGatewayName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, expressRouteGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified ExpressRoute gateway in a resource group. An - * ExpressRoute gateway resource can only be deleted when there are no - * connection subresources. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, expressRouteGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified ExpressRoute gateway in a resource group. An - * ExpressRoute gateway resource can only be deleted when there are no - * connection subresources. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, expressRouteGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, expressRouteGatewayName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, expressRouteGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a ExpressRoute gateway in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {object} putExpressRouteGatewayParameters Parameters required in an - * ExpressRoute gateway PUT operation. - * - * @param {object} [putExpressRouteGatewayParameters.autoScaleConfiguration] - * Configuration for auto scaling. - * - * @param {object} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds] Minimum and - * maximum number of scale units to deploy. - * - * @param {number} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds.min] Minimum - * number of scale units deployed for ExpressRoute gateway. - * - * @param {number} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds.max] Maximum - * number of scale units deployed for ExpressRoute gateway. - * - * @param {object} putExpressRouteGatewayParameters.virtualHub The Virtual Hub - * where the ExpressRoute gateway is or will be deployed. - * - * @param {string} [putExpressRouteGatewayParameters.virtualHub.id] The - * resource URI for the Virtual Hub where the ExpressRoute gateway is or will - * be deployed. The Virtual Hub resource and the ExpressRoute gateway resource - * reside in the same subscription. - * - * @param {string} [putExpressRouteGatewayParameters.id] Resource ID. - * - * @param {string} [putExpressRouteGatewayParameters.location] Resource - * location. - * - * @param {object} [putExpressRouteGatewayParameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, expressRouteGatewayName: string, putExpressRouteGatewayParameters: models.ExpressRouteGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a ExpressRoute gateway in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {object} putExpressRouteGatewayParameters Parameters required in an - * ExpressRoute gateway PUT operation. - * - * @param {object} [putExpressRouteGatewayParameters.autoScaleConfiguration] - * Configuration for auto scaling. - * - * @param {object} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds] Minimum and - * maximum number of scale units to deploy. - * - * @param {number} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds.min] Minimum - * number of scale units deployed for ExpressRoute gateway. - * - * @param {number} - * [putExpressRouteGatewayParameters.autoScaleConfiguration.bounds.max] Maximum - * number of scale units deployed for ExpressRoute gateway. - * - * @param {object} putExpressRouteGatewayParameters.virtualHub The Virtual Hub - * where the ExpressRoute gateway is or will be deployed. - * - * @param {string} [putExpressRouteGatewayParameters.virtualHub.id] The - * resource URI for the Virtual Hub where the ExpressRoute gateway is or will - * be deployed. The Virtual Hub resource and the ExpressRoute gateway resource - * reside in the same subscription. - * - * @param {string} [putExpressRouteGatewayParameters.id] Resource ID. - * - * @param {string} [putExpressRouteGatewayParameters.location] Resource - * location. - * - * @param {object} [putExpressRouteGatewayParameters.tags] Resource tags. - * - * @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 {ExpressRouteGateway} - 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. - * - * {ExpressRouteGateway} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteGateway} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, expressRouteGatewayName: string, putExpressRouteGatewayParameters: models.ExpressRouteGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, expressRouteGatewayName: string, putExpressRouteGatewayParameters: models.ExpressRouteGateway, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, expressRouteGatewayName: string, putExpressRouteGatewayParameters: models.ExpressRouteGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified ExpressRoute gateway in a resource group. An - * ExpressRoute gateway resource can only be deleted when there are no - * connection subresources. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, expressRouteGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified ExpressRoute gateway in a resource group. An - * ExpressRoute gateway resource can only be deleted when there are no - * connection subresources. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, expressRouteGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, expressRouteGatewayName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, expressRouteGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ExpressRouteConnections - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface ExpressRouteConnections { - - - /** - * Creates a connection between an ExpressRoute gateway and an ExpressRoute - * circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {string} connectionName The name of the connection subresource. - * - * @param {object} putExpressRouteConnectionParameters Parameters required in - * an ExpressRouteConnection PUT operation. - * - * @param {object} - * putExpressRouteConnectionParameters.expressRouteCircuitPeering The - * ExpressRoute circuit peering. - * - * @param {string} - * [putExpressRouteConnectionParameters.expressRouteCircuitPeering.id] The ID - * of the ExpressRoute circuit peering. - * - * @param {string} [putExpressRouteConnectionParameters.authorizationKey] - * Authorization key to establish the connection. - * - * @param {number} [putExpressRouteConnectionParameters.routingWeight] The - * routing weight associated to the connection. - * - * @param {string} putExpressRouteConnectionParameters.name The name of the - * resource. - * - * @param {string} [putExpressRouteConnectionParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, expressRouteGatewayName: string, connectionName: string, putExpressRouteConnectionParameters: models.ExpressRouteConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates a connection between an ExpressRoute gateway and an ExpressRoute - * circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {string} connectionName The name of the connection subresource. - * - * @param {object} putExpressRouteConnectionParameters Parameters required in - * an ExpressRouteConnection PUT operation. - * - * @param {object} - * putExpressRouteConnectionParameters.expressRouteCircuitPeering The - * ExpressRoute circuit peering. - * - * @param {string} - * [putExpressRouteConnectionParameters.expressRouteCircuitPeering.id] The ID - * of the ExpressRoute circuit peering. - * - * @param {string} [putExpressRouteConnectionParameters.authorizationKey] - * Authorization key to establish the connection. - * - * @param {number} [putExpressRouteConnectionParameters.routingWeight] The - * routing weight associated to the connection. - * - * @param {string} putExpressRouteConnectionParameters.name The name of the - * resource. - * - * @param {string} [putExpressRouteConnectionParameters.id] Resource ID. - * - * @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 {ExpressRouteConnection} - 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. - * - * {ExpressRouteConnection} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteConnection} 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. - */ - createOrUpdate(resourceGroupName: string, expressRouteGatewayName: string, connectionName: string, putExpressRouteConnectionParameters: models.ExpressRouteConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, expressRouteGatewayName: string, connectionName: string, putExpressRouteConnectionParameters: models.ExpressRouteConnection, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, expressRouteGatewayName: string, connectionName: string, putExpressRouteConnectionParameters: models.ExpressRouteConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified ExpressRouteConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {string} connectionName The name of the ExpressRoute 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, expressRouteGatewayName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified ExpressRouteConnection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {string} connectionName The name of the ExpressRoute 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 {ExpressRouteConnection} - 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. - * - * {ExpressRouteConnection} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteConnection} 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, expressRouteGatewayName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, expressRouteGatewayName: string, connectionName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, expressRouteGatewayName: string, connectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes a connection to a ExpressRoute circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {string} connectionName The name of the connection subresource. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, expressRouteGatewayName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes a connection to a ExpressRoute circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {string} connectionName The name of the connection subresource. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, expressRouteGatewayName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, expressRouteGatewayName: string, connectionName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, expressRouteGatewayName: string, connectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists ExpressRouteConnections. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @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, expressRouteGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists ExpressRouteConnections. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @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 {ExpressRouteConnectionList} - 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. - * - * {ExpressRouteConnectionList} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteConnectionList} 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, expressRouteGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, expressRouteGatewayName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, expressRouteGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates a connection between an ExpressRoute gateway and an ExpressRoute - * circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {string} connectionName The name of the connection subresource. - * - * @param {object} putExpressRouteConnectionParameters Parameters required in - * an ExpressRouteConnection PUT operation. - * - * @param {object} - * putExpressRouteConnectionParameters.expressRouteCircuitPeering The - * ExpressRoute circuit peering. - * - * @param {string} - * [putExpressRouteConnectionParameters.expressRouteCircuitPeering.id] The ID - * of the ExpressRoute circuit peering. - * - * @param {string} [putExpressRouteConnectionParameters.authorizationKey] - * Authorization key to establish the connection. - * - * @param {number} [putExpressRouteConnectionParameters.routingWeight] The - * routing weight associated to the connection. - * - * @param {string} putExpressRouteConnectionParameters.name The name of the - * resource. - * - * @param {string} [putExpressRouteConnectionParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, expressRouteGatewayName: string, connectionName: string, putExpressRouteConnectionParameters: models.ExpressRouteConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates a connection between an ExpressRoute gateway and an ExpressRoute - * circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {string} connectionName The name of the connection subresource. - * - * @param {object} putExpressRouteConnectionParameters Parameters required in - * an ExpressRouteConnection PUT operation. - * - * @param {object} - * putExpressRouteConnectionParameters.expressRouteCircuitPeering The - * ExpressRoute circuit peering. - * - * @param {string} - * [putExpressRouteConnectionParameters.expressRouteCircuitPeering.id] The ID - * of the ExpressRoute circuit peering. - * - * @param {string} [putExpressRouteConnectionParameters.authorizationKey] - * Authorization key to establish the connection. - * - * @param {number} [putExpressRouteConnectionParameters.routingWeight] The - * routing weight associated to the connection. - * - * @param {string} putExpressRouteConnectionParameters.name The name of the - * resource. - * - * @param {string} [putExpressRouteConnectionParameters.id] Resource ID. - * - * @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 {ExpressRouteConnection} - 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. - * - * {ExpressRouteConnection} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteConnection} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, expressRouteGatewayName: string, connectionName: string, putExpressRouteConnectionParameters: models.ExpressRouteConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, expressRouteGatewayName: string, connectionName: string, putExpressRouteConnectionParameters: models.ExpressRouteConnection, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, expressRouteGatewayName: string, connectionName: string, putExpressRouteConnectionParameters: models.ExpressRouteConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes a connection to a ExpressRoute circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {string} connectionName The name of the connection subresource. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, expressRouteGatewayName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes a connection to a ExpressRoute circuit. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRouteGatewayName The name of the ExpressRoute - * gateway. - * - * @param {string} connectionName The name of the connection subresource. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, expressRouteGatewayName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, expressRouteGatewayName: string, connectionName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, expressRouteGatewayName: string, connectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ExpressRoutePortsLocations - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface ExpressRoutePortsLocations { - - - /** - * Retrieves all ExpressRoutePort peering locations. Does not return available - * bandwidths for each location. Available bandwidths can only be obtained when - * retriving a specific peering location. - * - * @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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all ExpressRoutePort peering locations. Does not return available - * bandwidths for each location. Available bandwidths can only be obtained when - * retriving a specific peering location. - * - * @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 {ExpressRoutePortsLocationListResult} - 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. - * - * {ExpressRoutePortsLocationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRoutePortsLocationListResult} 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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves a single ExpressRoutePort peering location, including the list of - * available bandwidths available at said peering location. - * - * @param {string} locationName Name of the requested ExpressRoutePort peering - * location. - * - * @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(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves a single ExpressRoutePort peering location, including the list of - * available bandwidths available at said peering location. - * - * @param {string} locationName Name of the requested ExpressRoutePort peering - * location. - * - * @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 {ExpressRoutePortsLocation} - 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. - * - * {ExpressRoutePortsLocation} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRoutePortsLocation} 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(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(locationName: string, callback: ServiceCallback): void; - get(locationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves all ExpressRoutePort peering locations. Does not return available - * bandwidths for each location. Available bandwidths can only be obtained when - * retriving a specific peering location. - * - * @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>; - - /** - * Retrieves all ExpressRoutePort peering locations. Does not return available - * bandwidths for each location. Available bandwidths can only be obtained when - * retriving a specific peering location. - * - * @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 {ExpressRoutePortsLocationListResult} - 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. - * - * {ExpressRoutePortsLocationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRoutePortsLocationListResult} 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 - * ExpressRoutePorts - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface ExpressRoutePorts { - - - /** - * Deletes the specified ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, expressRoutePortName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, expressRoutePortName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, expressRoutePortName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, expressRoutePortName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves the requested ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of ExpressRoutePort. - * - * @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, expressRoutePortName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves the requested ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of ExpressRoutePort. - * - * @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 {ExpressRoutePort} - 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. - * - * {ExpressRoutePort} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRoutePort} 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, expressRoutePortName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, expressRoutePortName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, expressRoutePortName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the specified ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @param {object} parameters Parameters supplied to the create - * ExpressRoutePort operation. - * - * @param {string} [parameters.peeringLocation] The name of the peering - * location that the ExpressRoutePort is mapped to physically. - * - * @param {number} [parameters.bandwidthInGbps] Bandwidth of procured ports in - * Gbps - * - * @param {string} [parameters.encapsulation] Encapsulation method on physical - * ports. Possible values include: 'Dot1Q', 'QinQ' - * - * @param {array} [parameters.links] ExpressRouteLink Sub-Resources The set of - * physical links of the ExpressRoutePort resource - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * ExpressRoutePort resource. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, expressRoutePortName: string, parameters: models.ExpressRoutePort, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the specified ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @param {object} parameters Parameters supplied to the create - * ExpressRoutePort operation. - * - * @param {string} [parameters.peeringLocation] The name of the peering - * location that the ExpressRoutePort is mapped to physically. - * - * @param {number} [parameters.bandwidthInGbps] Bandwidth of procured ports in - * Gbps - * - * @param {string} [parameters.encapsulation] Encapsulation method on physical - * ports. Possible values include: 'Dot1Q', 'QinQ' - * - * @param {array} [parameters.links] ExpressRouteLink Sub-Resources The set of - * physical links of the ExpressRoutePort resource - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * ExpressRoutePort resource. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ExpressRoutePort} - 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. - * - * {ExpressRoutePort} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRoutePort} 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. - */ - createOrUpdate(resourceGroupName: string, expressRoutePortName: string, parameters: models.ExpressRoutePort, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, expressRoutePortName: string, parameters: models.ExpressRoutePort, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, expressRoutePortName: string, parameters: models.ExpressRoutePort, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Update ExpressRoutePort tags - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @param {object} parameters Parameters supplied to update ExpressRoutePort - * resource tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, expressRoutePortName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Update ExpressRoutePort tags - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @param {object} parameters Parameters supplied to update ExpressRoutePort - * resource tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ExpressRoutePort} - 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. - * - * {ExpressRoutePort} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRoutePort} 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. - */ - updateTags(resourceGroupName: string, expressRoutePortName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, expressRoutePortName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, expressRoutePortName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * List all the ExpressRoutePort resources in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * List all the ExpressRoutePort resources in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {ExpressRoutePortListResult} - 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. - * - * {ExpressRoutePortListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRoutePortListResult} 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. - */ - listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * List all the ExpressRoutePort resources in the specified subscription - * - * @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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * List all the ExpressRoutePort resources in the specified subscription - * - * @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 {ExpressRoutePortListResult} - 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. - * - * {ExpressRoutePortListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRoutePortListResult} 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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, expressRoutePortName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, expressRoutePortName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, expressRoutePortName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, expressRoutePortName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the specified ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @param {object} parameters Parameters supplied to the create - * ExpressRoutePort operation. - * - * @param {string} [parameters.peeringLocation] The name of the peering - * location that the ExpressRoutePort is mapped to physically. - * - * @param {number} [parameters.bandwidthInGbps] Bandwidth of procured ports in - * Gbps - * - * @param {string} [parameters.encapsulation] Encapsulation method on physical - * ports. Possible values include: 'Dot1Q', 'QinQ' - * - * @param {array} [parameters.links] ExpressRouteLink Sub-Resources The set of - * physical links of the ExpressRoutePort resource - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * ExpressRoutePort resource. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, expressRoutePortName: string, parameters: models.ExpressRoutePort, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the specified ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @param {object} parameters Parameters supplied to the create - * ExpressRoutePort operation. - * - * @param {string} [parameters.peeringLocation] The name of the peering - * location that the ExpressRoutePort is mapped to physically. - * - * @param {number} [parameters.bandwidthInGbps] Bandwidth of procured ports in - * Gbps - * - * @param {string} [parameters.encapsulation] Encapsulation method on physical - * ports. Possible values include: 'Dot1Q', 'QinQ' - * - * @param {array} [parameters.links] ExpressRouteLink Sub-Resources The set of - * physical links of the ExpressRoutePort resource - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * ExpressRoutePort resource. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ExpressRoutePort} - 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. - * - * {ExpressRoutePort} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRoutePort} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, expressRoutePortName: string, parameters: models.ExpressRoutePort, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, expressRoutePortName: string, parameters: models.ExpressRoutePort, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, expressRoutePortName: string, parameters: models.ExpressRoutePort, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Update ExpressRoutePort tags - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @param {object} parameters Parameters supplied to update ExpressRoutePort - * resource tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, expressRoutePortName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Update ExpressRoutePort tags - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @param {object} parameters Parameters supplied to update ExpressRoutePort - * resource tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ExpressRoutePort} - 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. - * - * {ExpressRoutePort} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRoutePort} 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. - */ - beginUpdateTags(resourceGroupName: string, expressRoutePortName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, expressRoutePortName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, expressRoutePortName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * List all the ExpressRoutePort resources in the specified resource group. - * - * @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. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * List all the ExpressRoutePort resources in the specified resource group. - * - * @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 {ExpressRoutePortListResult} - 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. - * - * {ExpressRoutePortListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRoutePortListResult} 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. - */ - listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * List all the ExpressRoutePort resources in the specified subscription - * - * @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>; - - /** - * List all the ExpressRoutePort resources in the specified subscription - * - * @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 {ExpressRoutePortListResult} - 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. - * - * {ExpressRoutePortListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRoutePortListResult} 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 - * ExpressRouteLinks - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface ExpressRouteLinks { - - - /** - * Retrieves the specified ExpressRouteLink resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @param {string} linkName The name of the ExpressRouteLink resource. - * - * @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, expressRoutePortName: string, linkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves the specified ExpressRouteLink resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @param {string} linkName The name of the ExpressRouteLink resource. - * - * @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 {ExpressRouteLink} - 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. - * - * {ExpressRouteLink} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteLink} 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, expressRoutePortName: string, linkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, expressRoutePortName: string, linkName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, expressRoutePortName: string, linkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieve the ExpressRouteLink sub-resources of the specified - * ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @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, expressRoutePortName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieve the ExpressRouteLink sub-resources of the specified - * ExpressRoutePort resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} expressRoutePortName The name of the ExpressRoutePort - * resource. - * - * @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 {ExpressRouteLinkListResult} - 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. - * - * {ExpressRouteLinkListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteLinkListResult} 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, expressRoutePortName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, expressRoutePortName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, expressRoutePortName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieve the ExpressRouteLink sub-resources of the specified - * ExpressRoutePort resource. - * - * @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>; - - /** - * Retrieve the ExpressRouteLink sub-resources of the specified - * ExpressRoutePort resource. - * - * @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 {ExpressRouteLinkListResult} - 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. - * - * {ExpressRouteLinkListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ExpressRouteLinkListResult} 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 - * InterfaceEndpoints - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface InterfaceEndpoints { - - - /** - * Deletes the specified interface endpoint. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} interfaceEndpointName The name of the interface endpoint. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, interfaceEndpointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified interface endpoint. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} interfaceEndpointName The name of the interface endpoint. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, interfaceEndpointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, interfaceEndpointName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, interfaceEndpointName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified interface endpoint by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} interfaceEndpointName The name of the interface endpoint. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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, interfaceEndpointName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified interface endpoint by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} interfaceEndpointName The name of the interface endpoint. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {InterfaceEndpoint} - 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. - * - * {InterfaceEndpoint} [result] - The deserialized result object if an error did not occur. - * See {@link InterfaceEndpoint} 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, interfaceEndpointName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, interfaceEndpointName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, interfaceEndpointName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates an interface endpoint in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} interfaceEndpointName The name of the interface endpoint. - * - * @param {object} parameters Parameters supplied to the create or update - * interface endpoint operation - * - * @param {string} [parameters.fqdn] A first-party service's FQDN that is - * mapped to the private IP allocated via this interface endpoint. - * - * @param {object} [parameters.endpointService] A reference to the service - * being brought into the virtual network. - * - * @param {string} [parameters.endpointService.id] A unique identifier of the - * service being referenced by the interface endpoint. - * - * @param {object} [parameters.subnet] The ID of the subnet from which the - * private IP will be allocated. - * - * @param {string} [parameters.subnet.addressPrefix] The address prefix for the - * subnet. - * - * @param {array} [parameters.subnet.addressPrefixes] List of address prefixes - * for the subnet. - * - * @param {object} [parameters.subnet.networkSecurityGroup] The reference of - * the NetworkSecurityGroup resource. - * - * @param {array} [parameters.subnet.networkSecurityGroup.securityRules] A - * collection of security rules of the network security group. - * - * @param {array} [parameters.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} [parameters.subnet.networkSecurityGroup.resourceGuid] The - * resource GUID property of the network security group resource. - * - * @param {string} [parameters.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.subnet.networkSecurityGroup.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.networkSecurityGroup.id] Resource ID. - * - * @param {string} [parameters.subnet.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [parameters.subnet.networkSecurityGroup.tags] Resource tags. - * - * @param {object} [parameters.subnet.routeTable] The reference of the - * RouteTable resource. - * - * @param {array} [parameters.subnet.routeTable.routes] Collection of routes - * contained within a route table. - * - * @param {boolean} [parameters.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} [parameters.subnet.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [parameters.subnet.routeTable.etag] Gets a unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.routeTable.id] Resource ID. - * - * @param {string} [parameters.subnet.routeTable.location] Resource location. - * - * @param {object} [parameters.subnet.routeTable.tags] Resource tags. - * - * @param {array} [parameters.subnet.serviceEndpoints] An array of service - * endpoints. - * - * @param {array} [parameters.subnet.serviceEndpointPolicies] An array of - * service endpoint policies. - * - * @param {array} [parameters.subnet.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * - * @param {array} [parameters.subnet.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * - * @param {array} [parameters.subnet.delegations] Gets an array of references - * to the delegations on the subnet. - * - * @param {string} [parameters.subnet.provisioningState] The provisioning state - * of the resource. - * - * @param {string} [parameters.subnet.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [parameters.subnet.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.id] Resource ID. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, interfaceEndpointName: string, parameters: models.InterfaceEndpoint, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates an interface endpoint in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} interfaceEndpointName The name of the interface endpoint. - * - * @param {object} parameters Parameters supplied to the create or update - * interface endpoint operation - * - * @param {string} [parameters.fqdn] A first-party service's FQDN that is - * mapped to the private IP allocated via this interface endpoint. - * - * @param {object} [parameters.endpointService] A reference to the service - * being brought into the virtual network. - * - * @param {string} [parameters.endpointService.id] A unique identifier of the - * service being referenced by the interface endpoint. - * - * @param {object} [parameters.subnet] The ID of the subnet from which the - * private IP will be allocated. - * - * @param {string} [parameters.subnet.addressPrefix] The address prefix for the - * subnet. - * - * @param {array} [parameters.subnet.addressPrefixes] List of address prefixes - * for the subnet. - * - * @param {object} [parameters.subnet.networkSecurityGroup] The reference of - * the NetworkSecurityGroup resource. - * - * @param {array} [parameters.subnet.networkSecurityGroup.securityRules] A - * collection of security rules of the network security group. - * - * @param {array} [parameters.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} [parameters.subnet.networkSecurityGroup.resourceGuid] The - * resource GUID property of the network security group resource. - * - * @param {string} [parameters.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.subnet.networkSecurityGroup.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.networkSecurityGroup.id] Resource ID. - * - * @param {string} [parameters.subnet.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [parameters.subnet.networkSecurityGroup.tags] Resource tags. - * - * @param {object} [parameters.subnet.routeTable] The reference of the - * RouteTable resource. - * - * @param {array} [parameters.subnet.routeTable.routes] Collection of routes - * contained within a route table. - * - * @param {boolean} [parameters.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} [parameters.subnet.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [parameters.subnet.routeTable.etag] Gets a unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.routeTable.id] Resource ID. - * - * @param {string} [parameters.subnet.routeTable.location] Resource location. - * - * @param {object} [parameters.subnet.routeTable.tags] Resource tags. - * - * @param {array} [parameters.subnet.serviceEndpoints] An array of service - * endpoints. - * - * @param {array} [parameters.subnet.serviceEndpointPolicies] An array of - * service endpoint policies. - * - * @param {array} [parameters.subnet.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * - * @param {array} [parameters.subnet.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * - * @param {array} [parameters.subnet.delegations] Gets an array of references - * to the delegations on the subnet. - * - * @param {string} [parameters.subnet.provisioningState] The provisioning state - * of the resource. - * - * @param {string} [parameters.subnet.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [parameters.subnet.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.id] Resource ID. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {InterfaceEndpoint} - 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. - * - * {InterfaceEndpoint} [result] - The deserialized result object if an error did not occur. - * See {@link InterfaceEndpoint} 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. - */ - createOrUpdate(resourceGroupName: string, interfaceEndpointName: string, parameters: models.InterfaceEndpoint, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, interfaceEndpointName: string, parameters: models.InterfaceEndpoint, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, interfaceEndpointName: string, parameters: models.InterfaceEndpoint, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all interface endpoints in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all interface endpoints in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {InterfaceEndpointListResult} - 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. - * - * {InterfaceEndpointListResult} [result] - The deserialized result object if an error did not occur. - * See {@link InterfaceEndpointListResult} 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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all interface endpoints in a subscription. - * - * @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. - */ - listBySubscriptionWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all interface endpoints in a subscription. - * - * @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 {InterfaceEndpointListResult} - 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. - * - * {InterfaceEndpointListResult} [result] - The deserialized result object if an error did not occur. - * See {@link InterfaceEndpointListResult} 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. - */ - listBySubscription(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listBySubscription(callback: ServiceCallback): void; - listBySubscription(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified interface endpoint. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} interfaceEndpointName The name of the interface endpoint. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, interfaceEndpointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified interface endpoint. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} interfaceEndpointName The name of the interface endpoint. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, interfaceEndpointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, interfaceEndpointName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, interfaceEndpointName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates an interface endpoint in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} interfaceEndpointName The name of the interface endpoint. - * - * @param {object} parameters Parameters supplied to the create or update - * interface endpoint operation - * - * @param {string} [parameters.fqdn] A first-party service's FQDN that is - * mapped to the private IP allocated via this interface endpoint. - * - * @param {object} [parameters.endpointService] A reference to the service - * being brought into the virtual network. - * - * @param {string} [parameters.endpointService.id] A unique identifier of the - * service being referenced by the interface endpoint. - * - * @param {object} [parameters.subnet] The ID of the subnet from which the - * private IP will be allocated. - * - * @param {string} [parameters.subnet.addressPrefix] The address prefix for the - * subnet. - * - * @param {array} [parameters.subnet.addressPrefixes] List of address prefixes - * for the subnet. - * - * @param {object} [parameters.subnet.networkSecurityGroup] The reference of - * the NetworkSecurityGroup resource. - * - * @param {array} [parameters.subnet.networkSecurityGroup.securityRules] A - * collection of security rules of the network security group. - * - * @param {array} [parameters.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} [parameters.subnet.networkSecurityGroup.resourceGuid] The - * resource GUID property of the network security group resource. - * - * @param {string} [parameters.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.subnet.networkSecurityGroup.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.networkSecurityGroup.id] Resource ID. - * - * @param {string} [parameters.subnet.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [parameters.subnet.networkSecurityGroup.tags] Resource tags. - * - * @param {object} [parameters.subnet.routeTable] The reference of the - * RouteTable resource. - * - * @param {array} [parameters.subnet.routeTable.routes] Collection of routes - * contained within a route table. - * - * @param {boolean} [parameters.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} [parameters.subnet.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [parameters.subnet.routeTable.etag] Gets a unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.routeTable.id] Resource ID. - * - * @param {string} [parameters.subnet.routeTable.location] Resource location. - * - * @param {object} [parameters.subnet.routeTable.tags] Resource tags. - * - * @param {array} [parameters.subnet.serviceEndpoints] An array of service - * endpoints. - * - * @param {array} [parameters.subnet.serviceEndpointPolicies] An array of - * service endpoint policies. - * - * @param {array} [parameters.subnet.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * - * @param {array} [parameters.subnet.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * - * @param {array} [parameters.subnet.delegations] Gets an array of references - * to the delegations on the subnet. - * - * @param {string} [parameters.subnet.provisioningState] The provisioning state - * of the resource. - * - * @param {string} [parameters.subnet.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [parameters.subnet.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.id] Resource ID. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, interfaceEndpointName: string, parameters: models.InterfaceEndpoint, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates an interface endpoint in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} interfaceEndpointName The name of the interface endpoint. - * - * @param {object} parameters Parameters supplied to the create or update - * interface endpoint operation - * - * @param {string} [parameters.fqdn] A first-party service's FQDN that is - * mapped to the private IP allocated via this interface endpoint. - * - * @param {object} [parameters.endpointService] A reference to the service - * being brought into the virtual network. - * - * @param {string} [parameters.endpointService.id] A unique identifier of the - * service being referenced by the interface endpoint. - * - * @param {object} [parameters.subnet] The ID of the subnet from which the - * private IP will be allocated. - * - * @param {string} [parameters.subnet.addressPrefix] The address prefix for the - * subnet. - * - * @param {array} [parameters.subnet.addressPrefixes] List of address prefixes - * for the subnet. - * - * @param {object} [parameters.subnet.networkSecurityGroup] The reference of - * the NetworkSecurityGroup resource. - * - * @param {array} [parameters.subnet.networkSecurityGroup.securityRules] A - * collection of security rules of the network security group. - * - * @param {array} [parameters.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} [parameters.subnet.networkSecurityGroup.resourceGuid] The - * resource GUID property of the network security group resource. - * - * @param {string} [parameters.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.subnet.networkSecurityGroup.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.networkSecurityGroup.id] Resource ID. - * - * @param {string} [parameters.subnet.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [parameters.subnet.networkSecurityGroup.tags] Resource tags. - * - * @param {object} [parameters.subnet.routeTable] The reference of the - * RouteTable resource. - * - * @param {array} [parameters.subnet.routeTable.routes] Collection of routes - * contained within a route table. - * - * @param {boolean} [parameters.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} [parameters.subnet.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [parameters.subnet.routeTable.etag] Gets a unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.routeTable.id] Resource ID. - * - * @param {string} [parameters.subnet.routeTable.location] Resource location. - * - * @param {object} [parameters.subnet.routeTable.tags] Resource tags. - * - * @param {array} [parameters.subnet.serviceEndpoints] An array of service - * endpoints. - * - * @param {array} [parameters.subnet.serviceEndpointPolicies] An array of - * service endpoint policies. - * - * @param {array} [parameters.subnet.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * - * @param {array} [parameters.subnet.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * - * @param {array} [parameters.subnet.delegations] Gets an array of references - * to the delegations on the subnet. - * - * @param {string} [parameters.subnet.provisioningState] The provisioning state - * of the resource. - * - * @param {string} [parameters.subnet.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [parameters.subnet.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.id] Resource ID. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {InterfaceEndpoint} - 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. - * - * {InterfaceEndpoint} [result] - The deserialized result object if an error did not occur. - * See {@link InterfaceEndpoint} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, interfaceEndpointName: string, parameters: models.InterfaceEndpoint, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, interfaceEndpointName: string, parameters: models.InterfaceEndpoint, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, interfaceEndpointName: string, parameters: models.InterfaceEndpoint, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all interface endpoints in a resource group. - * - * @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 interface endpoints in a resource group. - * - * @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 {InterfaceEndpointListResult} - 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. - * - * {InterfaceEndpointListResult} [result] - The deserialized result object if an error did not occur. - * See {@link InterfaceEndpointListResult} 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; - - - /** - * Gets all interface endpoints in a subscription. - * - * @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. - */ - listBySubscriptionNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all interface endpoints in a subscription. - * - * @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 {InterfaceEndpointListResult} - 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. - * - * {InterfaceEndpointListResult} [result] - The deserialized result object if an error did not occur. - * See {@link InterfaceEndpointListResult} 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. - */ - listBySubscriptionNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listBySubscriptionNext(nextPageLink: string, callback: ServiceCallback): void; - listBySubscriptionNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * LoadBalancers - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface LoadBalancers { - - - /** - * Deletes the specified load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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, loadBalancerName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {LoadBalancer} - 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. - * - * {LoadBalancer} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancer} 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, loadBalancerName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, loadBalancerName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} parameters Parameters supplied to the create or update load - * balancer operation. - * - * @param {object} [parameters.sku] The load balancer SKU. - * - * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible - * values include: 'Basic', 'Standard' - * - * @param {array} [parameters.frontendIPConfigurations] Object representing the - * frontend IPs to be used for the load balancer - * - * @param {array} [parameters.backendAddressPools] Collection of backend - * address pools used by a load balancer - * - * @param {array} [parameters.loadBalancingRules] Object collection - * representing the load balancing rules Gets the provisioning - * - * @param {array} [parameters.probes] Collection of probe objects used in the - * load balancer - * - * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules - * used by a load balancer. Defining inbound NAT rules on your load balancer is - * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are - * referenced from virtual machine scale sets. NICs that are associated with - * individual virtual machines cannot reference an Inbound NAT pool. They have - * to reference individual inbound NAT rules. - * - * @param {array} [parameters.inboundNatPools] Defines an external port range - * for inbound NAT to a single backend port on NICs associated with a load - * balancer. Inbound NAT rules are created automatically for each NIC - * associated with the Load Balancer using an external port from this range. - * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive - * with defining inbound Nat rules. Inbound NAT pools are referenced from - * virtual machine scale sets. NICs that are associated with individual virtual - * machines cannot reference an inbound NAT pool. They have to reference - * individual inbound NAT rules. - * - * @param {array} [parameters.outboundRules] The outbound rules. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * load balancer resource. - * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} parameters Parameters supplied to the create or update load - * balancer operation. - * - * @param {object} [parameters.sku] The load balancer SKU. - * - * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible - * values include: 'Basic', 'Standard' - * - * @param {array} [parameters.frontendIPConfigurations] Object representing the - * frontend IPs to be used for the load balancer - * - * @param {array} [parameters.backendAddressPools] Collection of backend - * address pools used by a load balancer - * - * @param {array} [parameters.loadBalancingRules] Object collection - * representing the load balancing rules Gets the provisioning - * - * @param {array} [parameters.probes] Collection of probe objects used in the - * load balancer - * - * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules - * used by a load balancer. Defining inbound NAT rules on your load balancer is - * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are - * referenced from virtual machine scale sets. NICs that are associated with - * individual virtual machines cannot reference an Inbound NAT pool. They have - * to reference individual inbound NAT rules. - * - * @param {array} [parameters.inboundNatPools] Defines an external port range - * for inbound NAT to a single backend port on NICs associated with a load - * balancer. Inbound NAT rules are created automatically for each NIC - * associated with the Load Balancer using an external port from this range. - * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive - * with defining inbound Nat rules. Inbound NAT pools are referenced from - * virtual machine scale sets. NICs that are associated with individual virtual - * machines cannot reference an inbound NAT pool. They have to reference - * individual inbound NAT rules. - * - * @param {array} [parameters.outboundRules] The outbound rules. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * load balancer resource. - * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {LoadBalancer} - 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. - * - * {LoadBalancer} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancer} 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. - */ - createOrUpdate(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates a load balancer tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} parameters Parameters supplied to update load balancer tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a load balancer tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} parameters Parameters supplied to update load balancer tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {LoadBalancer} - 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. - * - * {LoadBalancer} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancer} 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. - */ - updateTags(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the load balancers in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the load balancers in a subscription. - * - * @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 {LoadBalancerListResult} - 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. - * - * {LoadBalancerListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancerListResult} 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. - */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the load balancers in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the load balancers in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {LoadBalancerListResult} - 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. - * - * {LoadBalancerListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancerListResult} 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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} parameters Parameters supplied to the create or update load - * balancer operation. - * - * @param {object} [parameters.sku] The load balancer SKU. - * - * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible - * values include: 'Basic', 'Standard' - * - * @param {array} [parameters.frontendIPConfigurations] Object representing the - * frontend IPs to be used for the load balancer - * - * @param {array} [parameters.backendAddressPools] Collection of backend - * address pools used by a load balancer - * - * @param {array} [parameters.loadBalancingRules] Object collection - * representing the load balancing rules Gets the provisioning - * - * @param {array} [parameters.probes] Collection of probe objects used in the - * load balancer - * - * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules - * used by a load balancer. Defining inbound NAT rules on your load balancer is - * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are - * referenced from virtual machine scale sets. NICs that are associated with - * individual virtual machines cannot reference an Inbound NAT pool. They have - * to reference individual inbound NAT rules. - * - * @param {array} [parameters.inboundNatPools] Defines an external port range - * for inbound NAT to a single backend port on NICs associated with a load - * balancer. Inbound NAT rules are created automatically for each NIC - * associated with the Load Balancer using an external port from this range. - * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive - * with defining inbound Nat rules. Inbound NAT pools are referenced from - * virtual machine scale sets. NICs that are associated with individual virtual - * machines cannot reference an inbound NAT pool. They have to reference - * individual inbound NAT rules. - * - * @param {array} [parameters.outboundRules] The outbound rules. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * load balancer resource. - * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} parameters Parameters supplied to the create or update load - * balancer operation. - * - * @param {object} [parameters.sku] The load balancer SKU. - * - * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible - * values include: 'Basic', 'Standard' - * - * @param {array} [parameters.frontendIPConfigurations] Object representing the - * frontend IPs to be used for the load balancer - * - * @param {array} [parameters.backendAddressPools] Collection of backend - * address pools used by a load balancer - * - * @param {array} [parameters.loadBalancingRules] Object collection - * representing the load balancing rules Gets the provisioning - * - * @param {array} [parameters.probes] Collection of probe objects used in the - * load balancer - * - * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules - * used by a load balancer. Defining inbound NAT rules on your load balancer is - * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are - * referenced from virtual machine scale sets. NICs that are associated with - * individual virtual machines cannot reference an Inbound NAT pool. They have - * to reference individual inbound NAT rules. - * - * @param {array} [parameters.inboundNatPools] Defines an external port range - * for inbound NAT to a single backend port on NICs associated with a load - * balancer. Inbound NAT rules are created automatically for each NIC - * associated with the Load Balancer using an external port from this range. - * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive - * with defining inbound Nat rules. Inbound NAT pools are referenced from - * virtual machine scale sets. NICs that are associated with individual virtual - * machines cannot reference an inbound NAT pool. They have to reference - * individual inbound NAT rules. - * - * @param {array} [parameters.outboundRules] The outbound rules. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * load balancer resource. - * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {LoadBalancer} - 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. - * - * {LoadBalancer} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancer} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, loadBalancerName: string, parameters: models.LoadBalancer, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates a load balancer tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} parameters Parameters supplied to update load balancer tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a load balancer tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} parameters Parameters supplied to update load balancer tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {LoadBalancer} - 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. - * - * {LoadBalancer} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancer} 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. - */ - beginUpdateTags(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, loadBalancerName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the load balancers in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the load balancers in a subscription. - * - * @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 {LoadBalancerListResult} - 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. - * - * {LoadBalancerListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancerListResult} 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. - */ - listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAllNext(nextPageLink: string, callback: ServiceCallback): void; - listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the load balancers in a resource group. - * - * @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 the load balancers in a resource group. - * - * @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 {LoadBalancerListResult} - 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. - * - * {LoadBalancerListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancerListResult} 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 - * LoadBalancerBackendAddressPools - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface LoadBalancerBackendAddressPools { - - - /** - * Gets all the load balancer backed address pools. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the load balancer backed address pools. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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 {LoadBalancerBackendAddressPoolListResult} - 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. - * - * {LoadBalancerBackendAddressPoolListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancerBackendAddressPoolListResult} - * 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, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets load balancer backend address pool. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} backendAddressPoolName The name of the backend address pool. - * - * @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, loadBalancerName: string, backendAddressPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets load balancer backend address pool. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} backendAddressPoolName The name of the backend address pool. - * - * @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 {BackendAddressPool} - 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. - * - * {BackendAddressPool} [result] - The deserialized result object if an error did not occur. - * See {@link BackendAddressPool} 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, loadBalancerName: string, backendAddressPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, loadBalancerName: string, backendAddressPoolName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, loadBalancerName: string, backendAddressPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the load balancer backed address pools. - * - * @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 the load balancer backed address pools. - * - * @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 {LoadBalancerBackendAddressPoolListResult} - 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. - * - * {LoadBalancerBackendAddressPoolListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancerBackendAddressPoolListResult} - * 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 - * LoadBalancerFrontendIPConfigurations - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface LoadBalancerFrontendIPConfigurations { - - - /** - * Gets all the load balancer frontend IP configurations. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the load balancer frontend IP configurations. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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 {LoadBalancerFrontendIPConfigurationListResult} - 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. - * - * {LoadBalancerFrontendIPConfigurationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link - * LoadBalancerFrontendIPConfigurationListResult} 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, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets load balancer frontend IP configuration. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} frontendIPConfigurationName The name of the frontend IP - * configuration. - * - * @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, loadBalancerName: string, frontendIPConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets load balancer frontend IP configuration. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} frontendIPConfigurationName The name of the frontend IP - * configuration. - * - * @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 {FrontendIPConfiguration} - 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. - * - * {FrontendIPConfiguration} [result] - The deserialized result object if an error did not occur. - * See {@link FrontendIPConfiguration} 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, loadBalancerName: string, frontendIPConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, loadBalancerName: string, frontendIPConfigurationName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, loadBalancerName: string, frontendIPConfigurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the load balancer frontend IP configurations. - * - * @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 the load balancer frontend IP configurations. - * - * @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 {LoadBalancerFrontendIPConfigurationListResult} - 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. - * - * {LoadBalancerFrontendIPConfigurationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link - * LoadBalancerFrontendIPConfigurationListResult} 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 - * InboundNatRules - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface InboundNatRules { - - - /** - * Gets all the inbound nat rules in a load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the inbound nat rules in a load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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 {InboundNatRuleListResult} - 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. - * - * {InboundNatRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link InboundNatRuleListResult} 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, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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, loadBalancerName: string, inboundNatRuleName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {InboundNatRule} - 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. - * - * {InboundNatRule} [result] - The deserialized result object if an error did not occur. - * See {@link InboundNatRule} 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, loadBalancerName: string, inboundNatRuleName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @param {object} inboundNatRuleParameters Parameters supplied to the create - * or update inbound nat rule operation. - * - * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A - * reference to frontend IP addresses. - * - * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] - * Resource ID. - * - * @param {string} [inboundNatRuleParameters.protocol] Possible values include: - * 'Udp', 'Tcp', 'All' - * - * @param {number} [inboundNatRuleParameters.frontendPort] The port for the - * external endpoint. Port numbers for each rule must be unique within the Load - * Balancer. Acceptable values range from 1 to 65534. - * - * @param {number} [inboundNatRuleParameters.backendPort] The port used for the - * internal endpoint. Acceptable values range from 1 to 65535. - * - * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout - * for the TCP idle connection. The value can be set between 4 and 30 minutes. - * The default value is 4 minutes. This element is only used when the protocol - * is set to TCP. - * - * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a - * virtual machine's endpoint for the floating IP capability required to - * configure a SQL AlwaysOn Availability Group. This setting is required when - * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't - * be changed after you create the endpoint. - * - * @param {boolean} [inboundNatRuleParameters.enableTcpReset] Receive - * bidirectional TCP Reset on TCP flow idle timeout or unexpected connection - * termination. This element is only used when the protocol is set to TCP. - * - * @param {string} [inboundNatRuleParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [inboundNatRuleParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [inboundNatRuleParameters.etag] A unique read-only string - * that changes whenever the resource is updated. - * - * @param {string} [inboundNatRuleParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @param {object} inboundNatRuleParameters Parameters supplied to the create - * or update inbound nat rule operation. - * - * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A - * reference to frontend IP addresses. - * - * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] - * Resource ID. - * - * @param {string} [inboundNatRuleParameters.protocol] Possible values include: - * 'Udp', 'Tcp', 'All' - * - * @param {number} [inboundNatRuleParameters.frontendPort] The port for the - * external endpoint. Port numbers for each rule must be unique within the Load - * Balancer. Acceptable values range from 1 to 65534. - * - * @param {number} [inboundNatRuleParameters.backendPort] The port used for the - * internal endpoint. Acceptable values range from 1 to 65535. - * - * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout - * for the TCP idle connection. The value can be set between 4 and 30 minutes. - * The default value is 4 minutes. This element is only used when the protocol - * is set to TCP. - * - * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a - * virtual machine's endpoint for the floating IP capability required to - * configure a SQL AlwaysOn Availability Group. This setting is required when - * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't - * be changed after you create the endpoint. - * - * @param {boolean} [inboundNatRuleParameters.enableTcpReset] Receive - * bidirectional TCP Reset on TCP flow idle timeout or unexpected connection - * termination. This element is only used when the protocol is set to TCP. - * - * @param {string} [inboundNatRuleParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [inboundNatRuleParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [inboundNatRuleParameters.etag] A unique read-only string - * that changes whenever the resource is updated. - * - * @param {string} [inboundNatRuleParameters.id] Resource ID. - * - * @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 {InboundNatRule} - 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. - * - * {InboundNatRule} [result] - The deserialized result object if an error did not occur. - * See {@link InboundNatRule} 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. - */ - createOrUpdate(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @param {object} inboundNatRuleParameters Parameters supplied to the create - * or update inbound nat rule operation. - * - * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A - * reference to frontend IP addresses. - * - * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] - * Resource ID. - * - * @param {string} [inboundNatRuleParameters.protocol] Possible values include: - * 'Udp', 'Tcp', 'All' - * - * @param {number} [inboundNatRuleParameters.frontendPort] The port for the - * external endpoint. Port numbers for each rule must be unique within the Load - * Balancer. Acceptable values range from 1 to 65534. - * - * @param {number} [inboundNatRuleParameters.backendPort] The port used for the - * internal endpoint. Acceptable values range from 1 to 65535. - * - * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout - * for the TCP idle connection. The value can be set between 4 and 30 minutes. - * The default value is 4 minutes. This element is only used when the protocol - * is set to TCP. - * - * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a - * virtual machine's endpoint for the floating IP capability required to - * configure a SQL AlwaysOn Availability Group. This setting is required when - * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't - * be changed after you create the endpoint. - * - * @param {boolean} [inboundNatRuleParameters.enableTcpReset] Receive - * bidirectional TCP Reset on TCP flow idle timeout or unexpected connection - * termination. This element is only used when the protocol is set to TCP. - * - * @param {string} [inboundNatRuleParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [inboundNatRuleParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [inboundNatRuleParameters.etag] A unique read-only string - * that changes whenever the resource is updated. - * - * @param {string} [inboundNatRuleParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a load balancer inbound nat rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} inboundNatRuleName The name of the inbound nat rule. - * - * @param {object} inboundNatRuleParameters Parameters supplied to the create - * or update inbound nat rule operation. - * - * @param {object} [inboundNatRuleParameters.frontendIPConfiguration] A - * reference to frontend IP addresses. - * - * @param {string} [inboundNatRuleParameters.frontendIPConfiguration.id] - * Resource ID. - * - * @param {string} [inboundNatRuleParameters.protocol] Possible values include: - * 'Udp', 'Tcp', 'All' - * - * @param {number} [inboundNatRuleParameters.frontendPort] The port for the - * external endpoint. Port numbers for each rule must be unique within the Load - * Balancer. Acceptable values range from 1 to 65534. - * - * @param {number} [inboundNatRuleParameters.backendPort] The port used for the - * internal endpoint. Acceptable values range from 1 to 65535. - * - * @param {number} [inboundNatRuleParameters.idleTimeoutInMinutes] The timeout - * for the TCP idle connection. The value can be set between 4 and 30 minutes. - * The default value is 4 minutes. This element is only used when the protocol - * is set to TCP. - * - * @param {boolean} [inboundNatRuleParameters.enableFloatingIP] Configures a - * virtual machine's endpoint for the floating IP capability required to - * configure a SQL AlwaysOn Availability Group. This setting is required when - * using the SQL AlwaysOn Availability Groups in SQL server. This setting can't - * be changed after you create the endpoint. - * - * @param {boolean} [inboundNatRuleParameters.enableTcpReset] Receive - * bidirectional TCP Reset on TCP flow idle timeout or unexpected connection - * termination. This element is only used when the protocol is set to TCP. - * - * @param {string} [inboundNatRuleParameters.provisioningState] Gets the - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [inboundNatRuleParameters.name] Gets name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [inboundNatRuleParameters.etag] A unique read-only string - * that changes whenever the resource is updated. - * - * @param {string} [inboundNatRuleParameters.id] Resource ID. - * - * @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 {InboundNatRule} - 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. - * - * {InboundNatRule} [result] - The deserialized result object if an error did not occur. - * See {@link InboundNatRule} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, loadBalancerName: string, inboundNatRuleName: string, inboundNatRuleParameters: models.InboundNatRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the inbound nat rules in a load balancer. - * - * @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 the inbound nat rules in a load balancer. - * - * @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 {InboundNatRuleListResult} - 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. - * - * {InboundNatRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link InboundNatRuleListResult} 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 - * LoadBalancerLoadBalancingRules - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface LoadBalancerLoadBalancingRules { - - - /** - * Gets all the load balancing rules in a load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the load balancing rules in a load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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 {LoadBalancerLoadBalancingRuleListResult} - 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. - * - * {LoadBalancerLoadBalancingRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancerLoadBalancingRuleListResult} 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, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified load balancer load balancing rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} loadBalancingRuleName The name of the load balancing rule. - * - * @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, loadBalancerName: string, loadBalancingRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified load balancer load balancing rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} loadBalancingRuleName The name of the load balancing rule. - * - * @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 {LoadBalancingRule} - 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. - * - * {LoadBalancingRule} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancingRule} 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, loadBalancerName: string, loadBalancingRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, loadBalancerName: string, loadBalancingRuleName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, loadBalancerName: string, loadBalancingRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the load balancing rules in a load balancer. - * - * @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 the load balancing rules in a load balancer. - * - * @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 {LoadBalancerLoadBalancingRuleListResult} - 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. - * - * {LoadBalancerLoadBalancingRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancerLoadBalancingRuleListResult} 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 - * LoadBalancerOutboundRules - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface LoadBalancerOutboundRules { - - - /** - * Gets all the outbound rules in a load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the outbound rules in a load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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 {LoadBalancerOutboundRuleListResult} - 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. - * - * {LoadBalancerOutboundRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancerOutboundRuleListResult} 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, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified load balancer outbound rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} outboundRuleName The name of the outbound rule. - * - * @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, loadBalancerName: string, outboundRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified load balancer outbound rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} outboundRuleName The name of the outbound rule. - * - * @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 {OutboundRule} - 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. - * - * {OutboundRule} [result] - The deserialized result object if an error did not occur. - * See {@link OutboundRule} 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, loadBalancerName: string, outboundRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, loadBalancerName: string, outboundRuleName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, loadBalancerName: string, outboundRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the outbound rules in a load balancer. - * - * @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 the outbound rules in a load balancer. - * - * @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 {LoadBalancerOutboundRuleListResult} - 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. - * - * {LoadBalancerOutboundRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancerOutboundRuleListResult} 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 - * LoadBalancerNetworkInterfaces - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface LoadBalancerNetworkInterfaces { - - - /** - * Gets associated load balancer network interfaces. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets associated load balancer network interfaces. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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 {NetworkInterfaceListResult} - 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. - * - * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceListResult} 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, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets associated load balancer network interfaces. - * - * @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 associated load balancer network interfaces. - * - * @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 {NetworkInterfaceListResult} - 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. - * - * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceListResult} 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 - * LoadBalancerProbes - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface LoadBalancerProbes { - - - /** - * Gets all the load balancer probes. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the load balancer probes. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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 {LoadBalancerProbeListResult} - 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. - * - * {LoadBalancerProbeListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancerProbeListResult} 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, loadBalancerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, loadBalancerName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, loadBalancerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets load balancer probe. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} probeName The name of the probe. - * - * @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, loadBalancerName: string, probeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets load balancer probe. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} probeName The name of the probe. - * - * @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 {Probe} - 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. - * - * {Probe} [result] - The deserialized result object if an error did not occur. - * See {@link Probe} 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, loadBalancerName: string, probeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, loadBalancerName: string, probeName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, loadBalancerName: string, probeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the load balancer probes. - * - * @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 the load balancer probes. - * - * @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 {LoadBalancerProbeListResult} - 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. - * - * {LoadBalancerProbeListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LoadBalancerProbeListResult} 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 - * NetworkInterfaces - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface NetworkInterfaces { - - - /** - * Deletes the specified network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets information about the specified network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets information about the specified network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {NetworkInterface} - 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. - * - * {NetworkInterface} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterface} 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, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, networkInterfaceName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} parameters Parameters supplied to the create or update - * network interface operation. - * - * @param {object} [parameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * - * @param {array} [parameters.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * - * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * - * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. - * - * @param {string} [parameters.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.networkSecurityGroup.id] Resource ID. - * - * @param {string} [parameters.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. - * - * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of - * the network interface. - * - * @param {array} [parameters.tapConfigurations] A list of TapConfigurations of - * the network interface. - * - * @param {object} [parameters.dnsSettings] The DNS settings in network - * interface. - * - * @param {array} [parameters.dnsSettings.dnsServers] List of DNS servers IP - * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS - * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it - * must be the only value in dnsServers collection. - * - * @param {array} [parameters.dnsSettings.appliedDnsServers] If the VM that - * uses this NIC is part of an Availability Set, then this list will have the - * union of all DNS servers from all NICs that are part of the Availability - * Set. This property is what is configured on each of those VMs. - * - * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS - * name for this NIC used for internal communications between VMs in the same - * virtual network. - * - * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS - * name supporting internal communications between VMs in the same virtual - * network. - * - * @param {string} [parameters.dnsSettings.internalDomainNameSuffix] Even if - * internalDnsNameLabel is not specified, a DNS entry is created for the - * primary NIC of the VM. This DNS name can be constructed by concatenating the - * VM name with the value of internalDomainNameSuffix. - * - * @param {string} [parameters.macAddress] The MAC address of the network - * interface. - * - * @param {boolean} [parameters.primary] Gets whether this is a primary network - * interface on a virtual machine. - * - * @param {boolean} [parameters.enableAcceleratedNetworking] If the network - * interface is accelerated networking enabled. - * - * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP - * forwarding is enabled on this network interface. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network interface resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} parameters Parameters supplied to the create or update - * network interface operation. - * - * @param {object} [parameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * - * @param {array} [parameters.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * - * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * - * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. - * - * @param {string} [parameters.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.networkSecurityGroup.id] Resource ID. - * - * @param {string} [parameters.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. - * - * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of - * the network interface. - * - * @param {array} [parameters.tapConfigurations] A list of TapConfigurations of - * the network interface. - * - * @param {object} [parameters.dnsSettings] The DNS settings in network - * interface. - * - * @param {array} [parameters.dnsSettings.dnsServers] List of DNS servers IP - * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS - * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it - * must be the only value in dnsServers collection. - * - * @param {array} [parameters.dnsSettings.appliedDnsServers] If the VM that - * uses this NIC is part of an Availability Set, then this list will have the - * union of all DNS servers from all NICs that are part of the Availability - * Set. This property is what is configured on each of those VMs. - * - * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS - * name for this NIC used for internal communications between VMs in the same - * virtual network. - * - * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS - * name supporting internal communications between VMs in the same virtual - * network. - * - * @param {string} [parameters.dnsSettings.internalDomainNameSuffix] Even if - * internalDnsNameLabel is not specified, a DNS entry is created for the - * primary NIC of the VM. This DNS name can be constructed by concatenating the - * VM name with the value of internalDomainNameSuffix. - * - * @param {string} [parameters.macAddress] The MAC address of the network - * interface. - * - * @param {boolean} [parameters.primary] Gets whether this is a primary network - * interface on a virtual machine. - * - * @param {boolean} [parameters.enableAcceleratedNetworking] If the network - * interface is accelerated networking enabled. - * - * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP - * forwarding is enabled on this network interface. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network interface resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {NetworkInterface} - 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. - * - * {NetworkInterface} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterface} 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. - */ - createOrUpdate(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates a network interface tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} parameters Parameters supplied to update network interface - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a network interface tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} parameters Parameters supplied to update network interface - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {NetworkInterface} - 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. - * - * {NetworkInterface} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterface} 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. - */ - updateTags(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all network interfaces in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all network interfaces in a subscription. - * - * @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 {NetworkInterfaceListResult} - 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. - * - * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceListResult} 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. - */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all network interfaces in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all network interfaces in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {NetworkInterfaceListResult} - 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. - * - * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceListResult} 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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all route tables applied to a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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. - */ - getEffectiveRouteTableWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all route tables applied to a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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 {EffectiveRouteListResult} - 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. - * - * {EffectiveRouteListResult} [result] - The deserialized result object if an error did not occur. - * See {@link EffectiveRouteListResult} 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. - */ - getEffectiveRouteTable(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getEffectiveRouteTable(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; - getEffectiveRouteTable(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all network security groups applied to a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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. - */ - listEffectiveNetworkSecurityGroupsWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all network security groups applied to a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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 {EffectiveNetworkSecurityGroupListResult} - 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. - * - * {EffectiveNetworkSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link EffectiveNetworkSecurityGroupListResult} 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. - */ - listEffectiveNetworkSecurityGroups(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listEffectiveNetworkSecurityGroups(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; - listEffectiveNetworkSecurityGroups(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets information about all network interfaces in a virtual machine in a - * virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @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. - */ - listVirtualMachineScaleSetVMNetworkInterfacesWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets information about all network interfaces in a virtual machine in a - * virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @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 {NetworkInterfaceListResult} - 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. - * - * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceListResult} 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. - */ - listVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, callback: ServiceCallback): void; - listVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all network interfaces in a virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @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. - */ - listVirtualMachineScaleSetNetworkInterfacesWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all network interfaces in a virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @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 {NetworkInterfaceListResult} - 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. - * - * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceListResult} 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. - */ - listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName: string, virtualMachineScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName: string, virtualMachineScaleSetName: string, callback: ServiceCallback): void; - listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName: string, virtualMachineScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get the specified network interface in a virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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. - */ - getVirtualMachineScaleSetNetworkInterfaceWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get the specified network interface in a virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {NetworkInterface} - 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. - * - * {NetworkInterface} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterface} 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. - */ - getVirtualMachineScaleSetNetworkInterface(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - getVirtualMachineScaleSetNetworkInterface(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, callback: ServiceCallback): void; - getVirtualMachineScaleSetNetworkInterface(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get the specified network interface ip configuration in a virtual machine - * scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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. - */ - listVirtualMachineScaleSetIpConfigurationsWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get the specified network interface ip configuration in a virtual machine - * scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {NetworkInterfaceIPConfigurationListResult} - 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. - * - * {NetworkInterfaceIPConfigurationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceIPConfigurationListResult} - * 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. - */ - listVirtualMachineScaleSetIpConfigurations(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listVirtualMachineScaleSetIpConfigurations(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, callback: ServiceCallback): void; - listVirtualMachineScaleSetIpConfigurations(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get the specified network interface ip configuration in a virtual machine - * scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} ipConfigurationName The name of the ip configuration. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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. - */ - getVirtualMachineScaleSetIpConfigurationWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get the specified network interface ip configuration in a virtual machine - * scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} ipConfigurationName The name of the ip configuration. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {NetworkInterfaceIPConfiguration} - 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. - * - * {NetworkInterfaceIPConfiguration} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceIPConfiguration} 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. - */ - getVirtualMachineScaleSetIpConfiguration(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - getVirtualMachineScaleSetIpConfiguration(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, callback: ServiceCallback): void; - getVirtualMachineScaleSetIpConfiguration(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} parameters Parameters supplied to the create or update - * network interface operation. - * - * @param {object} [parameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * - * @param {array} [parameters.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * - * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * - * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. - * - * @param {string} [parameters.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.networkSecurityGroup.id] Resource ID. - * - * @param {string} [parameters.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. - * - * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of - * the network interface. - * - * @param {array} [parameters.tapConfigurations] A list of TapConfigurations of - * the network interface. - * - * @param {object} [parameters.dnsSettings] The DNS settings in network - * interface. - * - * @param {array} [parameters.dnsSettings.dnsServers] List of DNS servers IP - * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS - * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it - * must be the only value in dnsServers collection. - * - * @param {array} [parameters.dnsSettings.appliedDnsServers] If the VM that - * uses this NIC is part of an Availability Set, then this list will have the - * union of all DNS servers from all NICs that are part of the Availability - * Set. This property is what is configured on each of those VMs. - * - * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS - * name for this NIC used for internal communications between VMs in the same - * virtual network. - * - * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS - * name supporting internal communications between VMs in the same virtual - * network. - * - * @param {string} [parameters.dnsSettings.internalDomainNameSuffix] Even if - * internalDnsNameLabel is not specified, a DNS entry is created for the - * primary NIC of the VM. This DNS name can be constructed by concatenating the - * VM name with the value of internalDomainNameSuffix. - * - * @param {string} [parameters.macAddress] The MAC address of the network - * interface. - * - * @param {boolean} [parameters.primary] Gets whether this is a primary network - * interface on a virtual machine. - * - * @param {boolean} [parameters.enableAcceleratedNetworking] If the network - * interface is accelerated networking enabled. - * - * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP - * forwarding is enabled on this network interface. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network interface resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} parameters Parameters supplied to the create or update - * network interface operation. - * - * @param {object} [parameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * - * @param {array} [parameters.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * - * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * - * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. - * - * @param {string} [parameters.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.networkSecurityGroup.id] Resource ID. - * - * @param {string} [parameters.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. - * - * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of - * the network interface. - * - * @param {array} [parameters.tapConfigurations] A list of TapConfigurations of - * the network interface. - * - * @param {object} [parameters.dnsSettings] The DNS settings in network - * interface. - * - * @param {array} [parameters.dnsSettings.dnsServers] List of DNS servers IP - * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS - * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it - * must be the only value in dnsServers collection. - * - * @param {array} [parameters.dnsSettings.appliedDnsServers] If the VM that - * uses this NIC is part of an Availability Set, then this list will have the - * union of all DNS servers from all NICs that are part of the Availability - * Set. This property is what is configured on each of those VMs. - * - * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS - * name for this NIC used for internal communications between VMs in the same - * virtual network. - * - * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS - * name supporting internal communications between VMs in the same virtual - * network. - * - * @param {string} [parameters.dnsSettings.internalDomainNameSuffix] Even if - * internalDnsNameLabel is not specified, a DNS entry is created for the - * primary NIC of the VM. This DNS name can be constructed by concatenating the - * VM name with the value of internalDomainNameSuffix. - * - * @param {string} [parameters.macAddress] The MAC address of the network - * interface. - * - * @param {boolean} [parameters.primary] Gets whether this is a primary network - * interface on a virtual machine. - * - * @param {boolean} [parameters.enableAcceleratedNetworking] If the network - * interface is accelerated networking enabled. - * - * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP - * forwarding is enabled on this network interface. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network interface resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {NetworkInterface} - 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. - * - * {NetworkInterface} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterface} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, networkInterfaceName: string, parameters: models.NetworkInterface, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates a network interface tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} parameters Parameters supplied to update network interface - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a network interface tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} parameters Parameters supplied to update network interface - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {NetworkInterface} - 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. - * - * {NetworkInterface} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterface} 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. - */ - beginUpdateTags(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, networkInterfaceName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all route tables applied to a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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. - */ - beginGetEffectiveRouteTableWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all route tables applied to a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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 {EffectiveRouteListResult} - 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. - * - * {EffectiveRouteListResult} [result] - The deserialized result object if an error did not occur. - * See {@link EffectiveRouteListResult} 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. - */ - beginGetEffectiveRouteTable(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGetEffectiveRouteTable(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; - beginGetEffectiveRouteTable(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all network security groups applied to a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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. - */ - beginListEffectiveNetworkSecurityGroupsWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all network security groups applied to a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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 {EffectiveNetworkSecurityGroupListResult} - 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. - * - * {EffectiveNetworkSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link EffectiveNetworkSecurityGroupListResult} 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. - */ - beginListEffectiveNetworkSecurityGroups(resourceGroupName: string, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginListEffectiveNetworkSecurityGroups(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; - beginListEffectiveNetworkSecurityGroups(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all network interfaces in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all network interfaces in a subscription. - * - * @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 {NetworkInterfaceListResult} - 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. - * - * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceListResult} 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. - */ - listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAllNext(nextPageLink: string, callback: ServiceCallback): void; - listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all network interfaces in a resource group. - * - * @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 network interfaces in a resource group. - * - * @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 {NetworkInterfaceListResult} - 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. - * - * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceListResult} 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; - - - /** - * Gets information about all network interfaces in a virtual machine in a - * virtual machine scale set. - * - * @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. - */ - listVirtualMachineScaleSetVMNetworkInterfacesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets information about all network interfaces in a virtual machine in a - * virtual machine scale set. - * - * @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 {NetworkInterfaceListResult} - 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. - * - * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceListResult} 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. - */ - listVirtualMachineScaleSetVMNetworkInterfacesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listVirtualMachineScaleSetVMNetworkInterfacesNext(nextPageLink: string, callback: ServiceCallback): void; - listVirtualMachineScaleSetVMNetworkInterfacesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all network interfaces in a virtual machine scale set. - * - * @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. - */ - listVirtualMachineScaleSetNetworkInterfacesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all network interfaces in a virtual machine scale set. - * - * @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 {NetworkInterfaceListResult} - 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. - * - * {NetworkInterfaceListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceListResult} 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. - */ - listVirtualMachineScaleSetNetworkInterfacesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listVirtualMachineScaleSetNetworkInterfacesNext(nextPageLink: string, callback: ServiceCallback): void; - listVirtualMachineScaleSetNetworkInterfacesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get the specified network interface ip configuration in a virtual machine - * scale set. - * - * @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. - */ - listVirtualMachineScaleSetIpConfigurationsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get the specified network interface ip configuration in a virtual machine - * scale set. - * - * @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 {NetworkInterfaceIPConfigurationListResult} - 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. - * - * {NetworkInterfaceIPConfigurationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceIPConfigurationListResult} - * 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. - */ - listVirtualMachineScaleSetIpConfigurationsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listVirtualMachineScaleSetIpConfigurationsNext(nextPageLink: string, callback: ServiceCallback): void; - listVirtualMachineScaleSetIpConfigurationsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * NetworkInterfaceIPConfigurations - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface NetworkInterfaceIPConfigurations { - - - /** - * Get all ip configurations in a network interface - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get all ip configurations in a network interface - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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 {NetworkInterfaceIPConfigurationListResult} - 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. - * - * {NetworkInterfaceIPConfigurationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceIPConfigurationListResult} - * 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, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified network interface ip configuration. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} ipConfigurationName The name of the ip configuration name. - * - * @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, networkInterfaceName: string, ipConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified network interface ip configuration. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} ipConfigurationName The name of the ip configuration name. - * - * @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 {NetworkInterfaceIPConfiguration} - 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. - * - * {NetworkInterfaceIPConfiguration} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceIPConfiguration} 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, networkInterfaceName: string, ipConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, networkInterfaceName: string, ipConfigurationName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, networkInterfaceName: string, ipConfigurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get all ip configurations in a network interface - * - * @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>; - - /** - * Get all ip configurations in a network interface - * - * @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 {NetworkInterfaceIPConfigurationListResult} - 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. - * - * {NetworkInterfaceIPConfigurationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceIPConfigurationListResult} - * 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 - * NetworkInterfaceLoadBalancers - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface NetworkInterfaceLoadBalancers { - - - /** - * List all load balancers in a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * List all load balancers in a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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 {NetworkInterfaceLoadBalancerListResult} - 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. - * - * {NetworkInterfaceLoadBalancerListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceLoadBalancerListResult} 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, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * List all load balancers in a network interface. - * - * @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>; - - /** - * List all load balancers in a network interface. - * - * @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 {NetworkInterfaceLoadBalancerListResult} - 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. - * - * {NetworkInterfaceLoadBalancerListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceLoadBalancerListResult} 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 - * NetworkInterfaceTapConfigurations - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface NetworkInterfaceTapConfigurations { - - - /** - * Deletes the specified tap configuration from the NetworkInterface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} tapConfigurationName The name of the tap configuration. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, tapConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified tap configuration from the NetworkInterface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} tapConfigurationName The name of the tap configuration. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, networkInterfaceName: string, tapConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, networkInterfaceName: string, tapConfigurationName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, networkInterfaceName: string, tapConfigurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get the specified tap configuration on a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} tapConfigurationName The name of the tap configuration. - * - * @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, networkInterfaceName: string, tapConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get the specified tap configuration on a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} tapConfigurationName The name of the tap configuration. - * - * @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 {NetworkInterfaceTapConfiguration} - 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. - * - * {NetworkInterfaceTapConfiguration} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceTapConfiguration} 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, networkInterfaceName: string, tapConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, networkInterfaceName: string, tapConfigurationName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, networkInterfaceName: string, tapConfigurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a Tap configuration in the specified NetworkInterface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} tapConfigurationName The name of the tap configuration. - * - * @param {object} tapConfigurationParameters Parameters supplied to the create - * or update tap configuration operation. - * - * @param {object} [tapConfigurationParameters.virtualNetworkTap] The reference - * of the Virtual Network Tap resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration] - * The reference to the private IP Address of the collector nic that will - * receive the tap - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.virtualNetworkTaps] - * The reference to Virtual Network Taps. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.applicationGatewayBackendAddressPools] - * The reference of ApplicationGatewayBackendAddressPool resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.loadBalancerBackendAddressPools] - * The reference of LoadBalancerBackendAddressPool resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.loadBalancerInboundNatRules] - * A list of references of LoadBalancerInboundNatRules. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAddress] - * Private IP address of the IP configuration. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAllocationMethod] - * Defines how a private IP address is assigned. Possible values are: 'Static' - * and 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAddressVersion] - * Available from Api-Version 2016-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet] - * Subnet bound to the IP configuration. - * - * @param {boolean} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.primary] - * Gets whether this is a primary customer address on the network interface. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress] - * Public IP address bound to the IP configuration. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.applicationSecurityGroups] - * Application security groups in which the IP configuration is included. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.provisioningState] - * The provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.id] - * Resource ID. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration] - * The reference to the private IP address on the internal Load Balancer that - * will receive the tap - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.privateIPAllocationMethod] - * The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet] - * The reference of the subnet resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.tags] - * Resource tags. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * - * @param {boolean} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.tags] - * Resource tags. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.id] - * Resource ID. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress] - * The reference of the Public IP resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku] - * The public IP address SKU. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku.name] - * Name of a public IP address SKU. Possible values include: 'Basic', - * 'Standard' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is specified, - * an A DNS record is created for the public IP in the Microsoft Azure DNS - * system. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and the - * regionalized DNS zone. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipTags] - * The list of tags associated with the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipAddress] - * The IP address associated with the public IP address resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * - * @param {number} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.tags] - * Resource tags. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix] - * The reference of the Public IP Prefix resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.id] - * Resource ID. - * - * @param {number} - * [tapConfigurationParameters.virtualNetworkTap.destinationPort] The VXLAN - * destination port that will receive the tapped traffic. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.etag] Gets a - * unique read-only string that changes whenever the resource is updated. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.id] Resource - * ID. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.location] - * Resource location. - * - * @param {object} [tapConfigurationParameters.virtualNetworkTap.tags] Resource - * tags. - * - * @param {string} [tapConfigurationParameters.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [tapConfigurationParameters.etag] A unique read-only string - * that changes whenever the resource is updated. - * - * @param {string} [tapConfigurationParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, tapConfigurationName: string, tapConfigurationParameters: models.NetworkInterfaceTapConfiguration, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a Tap configuration in the specified NetworkInterface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} tapConfigurationName The name of the tap configuration. - * - * @param {object} tapConfigurationParameters Parameters supplied to the create - * or update tap configuration operation. - * - * @param {object} [tapConfigurationParameters.virtualNetworkTap] The reference - * of the Virtual Network Tap resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration] - * The reference to the private IP Address of the collector nic that will - * receive the tap - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.virtualNetworkTaps] - * The reference to Virtual Network Taps. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.applicationGatewayBackendAddressPools] - * The reference of ApplicationGatewayBackendAddressPool resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.loadBalancerBackendAddressPools] - * The reference of LoadBalancerBackendAddressPool resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.loadBalancerInboundNatRules] - * A list of references of LoadBalancerInboundNatRules. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAddress] - * Private IP address of the IP configuration. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAllocationMethod] - * Defines how a private IP address is assigned. Possible values are: 'Static' - * and 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAddressVersion] - * Available from Api-Version 2016-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet] - * Subnet bound to the IP configuration. - * - * @param {boolean} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.primary] - * Gets whether this is a primary customer address on the network interface. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress] - * Public IP address bound to the IP configuration. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.applicationSecurityGroups] - * Application security groups in which the IP configuration is included. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.provisioningState] - * The provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.id] - * Resource ID. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration] - * The reference to the private IP address on the internal Load Balancer that - * will receive the tap - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.privateIPAllocationMethod] - * The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet] - * The reference of the subnet resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.tags] - * Resource tags. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * - * @param {boolean} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.tags] - * Resource tags. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.id] - * Resource ID. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress] - * The reference of the Public IP resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku] - * The public IP address SKU. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku.name] - * Name of a public IP address SKU. Possible values include: 'Basic', - * 'Standard' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is specified, - * an A DNS record is created for the public IP in the Microsoft Azure DNS - * system. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and the - * regionalized DNS zone. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipTags] - * The list of tags associated with the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipAddress] - * The IP address associated with the public IP address resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * - * @param {number} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.tags] - * Resource tags. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix] - * The reference of the Public IP Prefix resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.id] - * Resource ID. - * - * @param {number} - * [tapConfigurationParameters.virtualNetworkTap.destinationPort] The VXLAN - * destination port that will receive the tapped traffic. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.etag] Gets a - * unique read-only string that changes whenever the resource is updated. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.id] Resource - * ID. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.location] - * Resource location. - * - * @param {object} [tapConfigurationParameters.virtualNetworkTap.tags] Resource - * tags. - * - * @param {string} [tapConfigurationParameters.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [tapConfigurationParameters.etag] A unique read-only string - * that changes whenever the resource is updated. - * - * @param {string} [tapConfigurationParameters.id] Resource ID. - * - * @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 {NetworkInterfaceTapConfiguration} - 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. - * - * {NetworkInterfaceTapConfiguration} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceTapConfiguration} 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. - */ - createOrUpdate(resourceGroupName: string, networkInterfaceName: string, tapConfigurationName: string, tapConfigurationParameters: models.NetworkInterfaceTapConfiguration, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, networkInterfaceName: string, tapConfigurationName: string, tapConfigurationParameters: models.NetworkInterfaceTapConfiguration, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, networkInterfaceName: string, tapConfigurationName: string, tapConfigurationParameters: models.NetworkInterfaceTapConfiguration, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get all Tap configurations in a network interface - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get all Tap configurations in a network interface - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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 {NetworkInterfaceTapConfigurationListResult} - 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. - * - * {NetworkInterfaceTapConfigurationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceTapConfigurationListResult} - * 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, networkInterfaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, networkInterfaceName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, networkInterfaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified tap configuration from the NetworkInterface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} tapConfigurationName The name of the tap configuration. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, tapConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified tap configuration from the NetworkInterface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} tapConfigurationName The name of the tap configuration. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, networkInterfaceName: string, tapConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, networkInterfaceName: string, tapConfigurationName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, networkInterfaceName: string, tapConfigurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a Tap configuration in the specified NetworkInterface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} tapConfigurationName The name of the tap configuration. - * - * @param {object} tapConfigurationParameters Parameters supplied to the create - * or update tap configuration operation. - * - * @param {object} [tapConfigurationParameters.virtualNetworkTap] The reference - * of the Virtual Network Tap resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration] - * The reference to the private IP Address of the collector nic that will - * receive the tap - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.virtualNetworkTaps] - * The reference to Virtual Network Taps. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.applicationGatewayBackendAddressPools] - * The reference of ApplicationGatewayBackendAddressPool resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.loadBalancerBackendAddressPools] - * The reference of LoadBalancerBackendAddressPool resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.loadBalancerInboundNatRules] - * A list of references of LoadBalancerInboundNatRules. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAddress] - * Private IP address of the IP configuration. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAllocationMethod] - * Defines how a private IP address is assigned. Possible values are: 'Static' - * and 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAddressVersion] - * Available from Api-Version 2016-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet] - * Subnet bound to the IP configuration. - * - * @param {boolean} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.primary] - * Gets whether this is a primary customer address on the network interface. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress] - * Public IP address bound to the IP configuration. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.applicationSecurityGroups] - * Application security groups in which the IP configuration is included. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.provisioningState] - * The provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.id] - * Resource ID. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration] - * The reference to the private IP address on the internal Load Balancer that - * will receive the tap - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.privateIPAllocationMethod] - * The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet] - * The reference of the subnet resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.tags] - * Resource tags. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * - * @param {boolean} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.tags] - * Resource tags. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.id] - * Resource ID. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress] - * The reference of the Public IP resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku] - * The public IP address SKU. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku.name] - * Name of a public IP address SKU. Possible values include: 'Basic', - * 'Standard' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is specified, - * an A DNS record is created for the public IP in the Microsoft Azure DNS - * system. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and the - * regionalized DNS zone. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipTags] - * The list of tags associated with the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipAddress] - * The IP address associated with the public IP address resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * - * @param {number} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.tags] - * Resource tags. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix] - * The reference of the Public IP Prefix resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.id] - * Resource ID. - * - * @param {number} - * [tapConfigurationParameters.virtualNetworkTap.destinationPort] The VXLAN - * destination port that will receive the tapped traffic. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.etag] Gets a - * unique read-only string that changes whenever the resource is updated. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.id] Resource - * ID. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.location] - * Resource location. - * - * @param {object} [tapConfigurationParameters.virtualNetworkTap.tags] Resource - * tags. - * - * @param {string} [tapConfigurationParameters.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [tapConfigurationParameters.etag] A unique read-only string - * that changes whenever the resource is updated. - * - * @param {string} [tapConfigurationParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkInterfaceName: string, tapConfigurationName: string, tapConfigurationParameters: models.NetworkInterfaceTapConfiguration, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a Tap configuration in the specified NetworkInterface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} tapConfigurationName The name of the tap configuration. - * - * @param {object} tapConfigurationParameters Parameters supplied to the create - * or update tap configuration operation. - * - * @param {object} [tapConfigurationParameters.virtualNetworkTap] The reference - * of the Virtual Network Tap resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration] - * The reference to the private IP Address of the collector nic that will - * receive the tap - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.virtualNetworkTaps] - * The reference to Virtual Network Taps. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.applicationGatewayBackendAddressPools] - * The reference of ApplicationGatewayBackendAddressPool resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.loadBalancerBackendAddressPools] - * The reference of LoadBalancerBackendAddressPool resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.loadBalancerInboundNatRules] - * A list of references of LoadBalancerInboundNatRules. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAddress] - * Private IP address of the IP configuration. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAllocationMethod] - * Defines how a private IP address is assigned. Possible values are: 'Static' - * and 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAddressVersion] - * Available from Api-Version 2016-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet] - * Subnet bound to the IP configuration. - * - * @param {boolean} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.primary] - * Gets whether this is a primary customer address on the network interface. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress] - * Public IP address bound to the IP configuration. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.applicationSecurityGroups] - * Application security groups in which the IP configuration is included. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.provisioningState] - * The provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.id] - * Resource ID. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration] - * The reference to the private IP address on the internal Load Balancer that - * will receive the tap - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.privateIPAllocationMethod] - * The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet] - * The reference of the subnet resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.tags] - * Resource tags. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * - * @param {boolean} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.tags] - * Resource tags. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.id] - * Resource ID. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress] - * The reference of the Public IP resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku] - * The public IP address SKU. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku.name] - * Name of a public IP address SKU. Possible values include: 'Basic', - * 'Standard' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is specified, - * an A DNS record is created for the public IP in the Microsoft Azure DNS - * system. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and the - * regionalized DNS zone. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipTags] - * The list of tags associated with the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipAddress] - * The IP address associated with the public IP address resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * - * @param {number} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.tags] - * Resource tags. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix] - * The reference of the Public IP Prefix resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.id] - * Resource ID. - * - * @param {number} - * [tapConfigurationParameters.virtualNetworkTap.destinationPort] The VXLAN - * destination port that will receive the tapped traffic. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.etag] Gets a - * unique read-only string that changes whenever the resource is updated. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.id] Resource - * ID. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.location] - * Resource location. - * - * @param {object} [tapConfigurationParameters.virtualNetworkTap.tags] Resource - * tags. - * - * @param {string} [tapConfigurationParameters.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [tapConfigurationParameters.etag] A unique read-only string - * that changes whenever the resource is updated. - * - * @param {string} [tapConfigurationParameters.id] Resource ID. - * - * @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 {NetworkInterfaceTapConfiguration} - 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. - * - * {NetworkInterfaceTapConfiguration} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceTapConfiguration} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, networkInterfaceName: string, tapConfigurationName: string, tapConfigurationParameters: models.NetworkInterfaceTapConfiguration, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, networkInterfaceName: string, tapConfigurationName: string, tapConfigurationParameters: models.NetworkInterfaceTapConfiguration, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, networkInterfaceName: string, tapConfigurationName: string, tapConfigurationParameters: models.NetworkInterfaceTapConfiguration, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get all Tap configurations in a network interface - * - * @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>; - - /** - * Get all Tap configurations in a network interface - * - * @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 {NetworkInterfaceTapConfigurationListResult} - 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. - * - * {NetworkInterfaceTapConfigurationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkInterfaceTapConfigurationListResult} - * 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 - * NetworkProfiles - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface NetworkProfiles { - - - /** - * Deletes the specified network profile. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkProfileName The name of the NetworkProfile. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkProfileName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified network profile. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkProfileName The name of the NetworkProfile. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, networkProfileName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, networkProfileName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, networkProfileName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified network profile in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkProfileName The name of the PublicIPPrefx. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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, networkProfileName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified network profile in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkProfileName The name of the PublicIPPrefx. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {NetworkProfile} - 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. - * - * {NetworkProfile} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkProfile} 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, networkProfileName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, networkProfileName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, networkProfileName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a network profile. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkProfileName The name of the network profile. - * - * @param {object} parameters Parameters supplied to the create or update - * network profile operation. - * - * @param {array} [parameters.containerNetworkInterfaces] List of child - * container network interfaces. - * - * @param {array} [parameters.containerNetworkInterfaceConfigurations] List of - * chid container network interface configurations. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkProfileName: string, parameters: models.NetworkProfile, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a network profile. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkProfileName The name of the network profile. - * - * @param {object} parameters Parameters supplied to the create or update - * network profile operation. - * - * @param {array} [parameters.containerNetworkInterfaces] List of child - * container network interfaces. - * - * @param {array} [parameters.containerNetworkInterfaceConfigurations] List of - * chid container network interface configurations. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {NetworkProfile} - 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. - * - * {NetworkProfile} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkProfile} 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. - */ - createOrUpdate(resourceGroupName: string, networkProfileName: string, parameters: models.NetworkProfile, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, networkProfileName: string, parameters: models.NetworkProfile, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, networkProfileName: string, parameters: models.NetworkProfile, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates network profile tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkProfileName The name of the network profile. - * - * @param {object} parameters Parameters supplied to update network profile - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, networkProfileName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates network profile tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkProfileName The name of the network profile. - * - * @param {object} parameters Parameters supplied to update network profile - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {NetworkProfile} - 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. - * - * {NetworkProfile} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkProfile} 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. - */ - updateTags(resourceGroupName: string, networkProfileName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, networkProfileName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, networkProfileName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the network profiles in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the network profiles in a subscription. - * - * @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 {NetworkProfileListResult} - 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. - * - * {NetworkProfileListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkProfileListResult} 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. - */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all network profiles in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all network profiles in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {NetworkProfileListResult} - 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. - * - * {NetworkProfileListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkProfileListResult} 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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the network profiles in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the network profiles in a subscription. - * - * @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 {NetworkProfileListResult} - 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. - * - * {NetworkProfileListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkProfileListResult} 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. - */ - listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAllNext(nextPageLink: string, callback: ServiceCallback): void; - listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all network profiles in a resource group. - * - * @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 network profiles in a resource group. - * - * @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 {NetworkProfileListResult} - 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. - * - * {NetworkProfileListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkProfileListResult} 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 - * NetworkSecurityGroups - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface NetworkSecurityGroups { - - - /** - * Deletes the specified network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, networkSecurityGroupName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, networkSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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, networkSecurityGroupName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {NetworkSecurityGroup} - 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. - * - * {NetworkSecurityGroup} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkSecurityGroup} 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, networkSecurityGroupName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, networkSecurityGroupName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, networkSecurityGroupName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a network security group in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to the create or update - * network security group operation. - * - * @param {array} [parameters.securityRules] A collection of security rules of - * the network security group. - * - * @param {array} [parameters.defaultSecurityRules] The default security rules - * of network security group. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network security group resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a network security group in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to the create or update - * network security group operation. - * - * @param {array} [parameters.securityRules] A collection of security rules of - * the network security group. - * - * @param {array} [parameters.defaultSecurityRules] The default security rules - * of network security group. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network security group resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {NetworkSecurityGroup} - 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. - * - * {NetworkSecurityGroup} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkSecurityGroup} 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. - */ - createOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates a network security group tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to update network security - * group tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a network security group tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to update network security - * group tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {NetworkSecurityGroup} - 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. - * - * {NetworkSecurityGroup} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkSecurityGroup} 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. - */ - updateTags(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all network security groups in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all network security groups in a subscription. - * - * @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 {NetworkSecurityGroupListResult} - 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. - * - * {NetworkSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkSecurityGroupListResult} 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. - */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all network security groups in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all network security groups in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {NetworkSecurityGroupListResult} - 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. - * - * {NetworkSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkSecurityGroupListResult} 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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, networkSecurityGroupName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, networkSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a network security group in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to the create or update - * network security group operation. - * - * @param {array} [parameters.securityRules] A collection of security rules of - * the network security group. - * - * @param {array} [parameters.defaultSecurityRules] The default security rules - * of network security group. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network security group resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a network security group in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to the create or update - * network security group operation. - * - * @param {array} [parameters.securityRules] A collection of security rules of - * the network security group. - * - * @param {array} [parameters.defaultSecurityRules] The default security rules - * of network security group. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network security group resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {NetworkSecurityGroup} - 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. - * - * {NetworkSecurityGroup} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkSecurityGroup} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.NetworkSecurityGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates a network security group tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to update network security - * group tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a network security group tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to update network security - * group tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {NetworkSecurityGroup} - 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. - * - * {NetworkSecurityGroup} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkSecurityGroup} 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. - */ - beginUpdateTags(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, networkSecurityGroupName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all network security groups in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all network security groups in a subscription. - * - * @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 {NetworkSecurityGroupListResult} - 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. - * - * {NetworkSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkSecurityGroupListResult} 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. - */ - listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAllNext(nextPageLink: string, callback: ServiceCallback): void; - listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all network security groups in a resource group. - * - * @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 network security groups in a resource group. - * - * @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 {NetworkSecurityGroupListResult} - 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. - * - * {NetworkSecurityGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkSecurityGroupListResult} 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 - * SecurityRules - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface SecurityRules { - - - /** - * Deletes the specified network security rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} securityRuleName The name of the security rule. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified network security rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} securityRuleName The name of the security rule. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get the specified network security rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} securityRuleName The name of the security rule. - * - * @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, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get the specified network security rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} securityRuleName The name of the security rule. - * - * @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 {SecurityRule} - 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. - * - * {SecurityRule} [result] - The deserialized result object if an error did not occur. - * See {@link SecurityRule} 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, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a security rule in the specified network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} securityRuleName The name of the security rule. - * - * @param {object} securityRuleParameters Parameters supplied to the create or - * update network security rule operation. - * - * @param {string} [securityRuleParameters.description] A description for this - * rule. Restricted to 140 chars. - * - * @param {string} securityRuleParameters.protocol Network protocol this rule - * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values - * include: 'Tcp', 'Udp', '*' - * - * @param {string} [securityRuleParameters.sourcePortRange] The source port or - * range. Integer or range between 0 and 65535. Asterix '*' can also be used to - * match all ports. - * - * @param {string} [securityRuleParameters.destinationPortRange] The - * destination port or range. Integer or range between 0 and 65535. Asterix '*' - * can also be used to match all ports. - * - * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or - * source IP range. Asterix '*' can also be used to match all source IPs. - * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' - * can also be used. If this is an ingress rule, specifies where network - * traffic originates from. - * - * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or - * source IP ranges. - * - * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The - * application security group specified as source. - * - * @param {string} [securityRuleParameters.destinationAddressPrefix] The - * destination address prefix. CIDR or destination IP range. Asterix '*' can - * also be used to match all source IPs. Default tags such as 'VirtualNetwork', - * 'AzureLoadBalancer' and 'Internet' can also be used. - * - * @param {array} [securityRuleParameters.destinationAddressPrefixes] The - * destination address prefixes. CIDR or destination IP ranges. - * - * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] - * The application security group specified as destination. - * - * @param {array} [securityRuleParameters.sourcePortRanges] The source port - * ranges. - * - * @param {array} [securityRuleParameters.destinationPortRanges] The - * destination port ranges. - * - * @param {string} securityRuleParameters.access The network traffic is allowed - * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: - * 'Allow', 'Deny' - * - * @param {number} [securityRuleParameters.priority] The priority of the rule. - * The value can be between 100 and 4096. The priority number must be unique - * for each rule in the collection. The lower the priority number, the higher - * the priority of the rule. - * - * @param {string} securityRuleParameters.direction The direction of the rule. - * The direction specifies if rule will be evaluated on incoming or outcoming - * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values - * include: 'Inbound', 'Outbound' - * - * @param {string} [securityRuleParameters.provisioningState] The provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [securityRuleParameters.name] The name of the resource that - * is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [securityRuleParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [securityRuleParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a security rule in the specified network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} securityRuleName The name of the security rule. - * - * @param {object} securityRuleParameters Parameters supplied to the create or - * update network security rule operation. - * - * @param {string} [securityRuleParameters.description] A description for this - * rule. Restricted to 140 chars. - * - * @param {string} securityRuleParameters.protocol Network protocol this rule - * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values - * include: 'Tcp', 'Udp', '*' - * - * @param {string} [securityRuleParameters.sourcePortRange] The source port or - * range. Integer or range between 0 and 65535. Asterix '*' can also be used to - * match all ports. - * - * @param {string} [securityRuleParameters.destinationPortRange] The - * destination port or range. Integer or range between 0 and 65535. Asterix '*' - * can also be used to match all ports. - * - * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or - * source IP range. Asterix '*' can also be used to match all source IPs. - * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' - * can also be used. If this is an ingress rule, specifies where network - * traffic originates from. - * - * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or - * source IP ranges. - * - * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The - * application security group specified as source. - * - * @param {string} [securityRuleParameters.destinationAddressPrefix] The - * destination address prefix. CIDR or destination IP range. Asterix '*' can - * also be used to match all source IPs. Default tags such as 'VirtualNetwork', - * 'AzureLoadBalancer' and 'Internet' can also be used. - * - * @param {array} [securityRuleParameters.destinationAddressPrefixes] The - * destination address prefixes. CIDR or destination IP ranges. - * - * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] - * The application security group specified as destination. - * - * @param {array} [securityRuleParameters.sourcePortRanges] The source port - * ranges. - * - * @param {array} [securityRuleParameters.destinationPortRanges] The - * destination port ranges. - * - * @param {string} securityRuleParameters.access The network traffic is allowed - * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: - * 'Allow', 'Deny' - * - * @param {number} [securityRuleParameters.priority] The priority of the rule. - * The value can be between 100 and 4096. The priority number must be unique - * for each rule in the collection. The lower the priority number, the higher - * the priority of the rule. - * - * @param {string} securityRuleParameters.direction The direction of the rule. - * The direction specifies if rule will be evaluated on incoming or outcoming - * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values - * include: 'Inbound', 'Outbound' - * - * @param {string} [securityRuleParameters.provisioningState] The provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [securityRuleParameters.name] The name of the resource that - * is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [securityRuleParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [securityRuleParameters.id] Resource ID. - * - * @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 {SecurityRule} - 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. - * - * {SecurityRule} [result] - The deserialized result object if an error did not occur. - * See {@link SecurityRule} 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. - */ - createOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all security rules in a network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @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, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all security rules in a network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @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 {SecurityRuleListResult} - 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. - * - * {SecurityRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SecurityRuleListResult} 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, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, networkSecurityGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, networkSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified network security rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} securityRuleName The name of the security rule. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified network security rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} securityRuleName The name of the security rule. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a security rule in the specified network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} securityRuleName The name of the security rule. - * - * @param {object} securityRuleParameters Parameters supplied to the create or - * update network security rule operation. - * - * @param {string} [securityRuleParameters.description] A description for this - * rule. Restricted to 140 chars. - * - * @param {string} securityRuleParameters.protocol Network protocol this rule - * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values - * include: 'Tcp', 'Udp', '*' - * - * @param {string} [securityRuleParameters.sourcePortRange] The source port or - * range. Integer or range between 0 and 65535. Asterix '*' can also be used to - * match all ports. - * - * @param {string} [securityRuleParameters.destinationPortRange] The - * destination port or range. Integer or range between 0 and 65535. Asterix '*' - * can also be used to match all ports. - * - * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or - * source IP range. Asterix '*' can also be used to match all source IPs. - * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' - * can also be used. If this is an ingress rule, specifies where network - * traffic originates from. - * - * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or - * source IP ranges. - * - * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The - * application security group specified as source. - * - * @param {string} [securityRuleParameters.destinationAddressPrefix] The - * destination address prefix. CIDR or destination IP range. Asterix '*' can - * also be used to match all source IPs. Default tags such as 'VirtualNetwork', - * 'AzureLoadBalancer' and 'Internet' can also be used. - * - * @param {array} [securityRuleParameters.destinationAddressPrefixes] The - * destination address prefixes. CIDR or destination IP ranges. - * - * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] - * The application security group specified as destination. - * - * @param {array} [securityRuleParameters.sourcePortRanges] The source port - * ranges. - * - * @param {array} [securityRuleParameters.destinationPortRanges] The - * destination port ranges. - * - * @param {string} securityRuleParameters.access The network traffic is allowed - * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: - * 'Allow', 'Deny' - * - * @param {number} [securityRuleParameters.priority] The priority of the rule. - * The value can be between 100 and 4096. The priority number must be unique - * for each rule in the collection. The lower the priority number, the higher - * the priority of the rule. - * - * @param {string} securityRuleParameters.direction The direction of the rule. - * The direction specifies if rule will be evaluated on incoming or outcoming - * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values - * include: 'Inbound', 'Outbound' - * - * @param {string} [securityRuleParameters.provisioningState] The provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [securityRuleParameters.name] The name of the resource that - * is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [securityRuleParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [securityRuleParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a security rule in the specified network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} securityRuleName The name of the security rule. - * - * @param {object} securityRuleParameters Parameters supplied to the create or - * update network security rule operation. - * - * @param {string} [securityRuleParameters.description] A description for this - * rule. Restricted to 140 chars. - * - * @param {string} securityRuleParameters.protocol Network protocol this rule - * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values - * include: 'Tcp', 'Udp', '*' - * - * @param {string} [securityRuleParameters.sourcePortRange] The source port or - * range. Integer or range between 0 and 65535. Asterix '*' can also be used to - * match all ports. - * - * @param {string} [securityRuleParameters.destinationPortRange] The - * destination port or range. Integer or range between 0 and 65535. Asterix '*' - * can also be used to match all ports. - * - * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or - * source IP range. Asterix '*' can also be used to match all source IPs. - * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' - * can also be used. If this is an ingress rule, specifies where network - * traffic originates from. - * - * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or - * source IP ranges. - * - * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The - * application security group specified as source. - * - * @param {string} [securityRuleParameters.destinationAddressPrefix] The - * destination address prefix. CIDR or destination IP range. Asterix '*' can - * also be used to match all source IPs. Default tags such as 'VirtualNetwork', - * 'AzureLoadBalancer' and 'Internet' can also be used. - * - * @param {array} [securityRuleParameters.destinationAddressPrefixes] The - * destination address prefixes. CIDR or destination IP ranges. - * - * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] - * The application security group specified as destination. - * - * @param {array} [securityRuleParameters.sourcePortRanges] The source port - * ranges. - * - * @param {array} [securityRuleParameters.destinationPortRanges] The - * destination port ranges. - * - * @param {string} securityRuleParameters.access The network traffic is allowed - * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: - * 'Allow', 'Deny' - * - * @param {number} [securityRuleParameters.priority] The priority of the rule. - * The value can be between 100 and 4096. The priority number must be unique - * for each rule in the collection. The lower the priority number, the higher - * the priority of the rule. - * - * @param {string} securityRuleParameters.direction The direction of the rule. - * The direction specifies if rule will be evaluated on incoming or outcoming - * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values - * include: 'Inbound', 'Outbound' - * - * @param {string} [securityRuleParameters.provisioningState] The provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [securityRuleParameters.name] The name of the resource that - * is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [securityRuleParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [securityRuleParameters.id] Resource ID. - * - * @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 {SecurityRule} - 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. - * - * {SecurityRule} [result] - The deserialized result object if an error did not occur. - * See {@link SecurityRule} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, networkSecurityGroupName: string, securityRuleName: string, securityRuleParameters: models.SecurityRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all security rules in a network security group. - * - * @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 security rules in a network security group. - * - * @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 {SecurityRuleListResult} - 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. - * - * {SecurityRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SecurityRuleListResult} 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 - * DefaultSecurityRules - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface DefaultSecurityRules { - - - /** - * Gets all default security rules in a network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @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, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all default security rules in a network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @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 {SecurityRuleListResult} - 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. - * - * {SecurityRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SecurityRuleListResult} 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, networkSecurityGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, networkSecurityGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, networkSecurityGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get the specified default network security rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} defaultSecurityRuleName The name of the default security - * rule. - * - * @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, networkSecurityGroupName: string, defaultSecurityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get the specified default network security rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} defaultSecurityRuleName The name of the default security - * rule. - * - * @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 {SecurityRule} - 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. - * - * {SecurityRule} [result] - The deserialized result object if an error did not occur. - * See {@link SecurityRule} 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, networkSecurityGroupName: string, defaultSecurityRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, networkSecurityGroupName: string, defaultSecurityRuleName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, networkSecurityGroupName: string, defaultSecurityRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all default security rules in a network security group. - * - * @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 default security rules in a network security group. - * - * @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 {SecurityRuleListResult} - 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. - * - * {SecurityRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SecurityRuleListResult} 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 - * NetworkWatchers - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface NetworkWatchers { - - - /** - * Creates or updates a network watcher in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the network watcher - * resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkWatcher, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a network watcher in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the network watcher - * resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {NetworkWatcher} - 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. - * - * {NetworkWatcher} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkWatcher} 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. - */ - createOrUpdate(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkWatcher, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkWatcher, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkWatcher, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified network watcher by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @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, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified network watcher by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @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 {NetworkWatcher} - 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. - * - * {NetworkWatcher} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkWatcher} 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, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, networkWatcherName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, networkWatcherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified network watcher resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified network watcher resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, networkWatcherName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, networkWatcherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates a network watcher tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters supplied to update network watcher - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a network watcher tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters supplied to update network watcher - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {NetworkWatcher} - 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. - * - * {NetworkWatcher} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkWatcher} 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. - */ - updateTags(resourceGroupName: string, networkWatcherName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, networkWatcherName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, networkWatcherName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all network watchers by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all network watchers by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {NetworkWatcherListResult} - 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. - * - * {NetworkWatcherListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkWatcherListResult} 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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all network watchers by subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all network watchers by subscription. - * - * @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 {NetworkWatcherListResult} - 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. - * - * {NetworkWatcherListResult} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkWatcherListResult} 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. - */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the current network topology by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the representation of - * topology. - * - * @param {string} [parameters.targetResourceGroupName] The name of the target - * resource group to perform topology on. - * - * @param {object} [parameters.targetVirtualNetwork] The reference of the - * Virtual Network resource. - * - * @param {object} [parameters.targetSubnet] The reference of the Subnet - * resource. - * - * @param {string} [parameters.targetSubnet.id] Resource ID. - * - * @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. - */ - getTopologyWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.TopologyParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the current network topology by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the representation of - * topology. - * - * @param {string} [parameters.targetResourceGroupName] The name of the target - * resource group to perform topology on. - * - * @param {object} [parameters.targetVirtualNetwork] The reference of the - * Virtual Network resource. - * - * @param {object} [parameters.targetSubnet] The reference of the Subnet - * resource. - * - * @param {string} [parameters.targetSubnet.id] Resource ID. - * - * @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 {Topology} - 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. - * - * {Topology} [result] - The deserialized result object if an error did not occur. - * See {@link Topology} 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. - */ - getTopology(resourceGroupName: string, networkWatcherName: string, parameters: models.TopologyParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getTopology(resourceGroupName: string, networkWatcherName: string, parameters: models.TopologyParameters, callback: ServiceCallback): void; - getTopology(resourceGroupName: string, networkWatcherName: string, parameters: models.TopologyParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Verify IP flow from the specified VM to a location given the currently - * configured NSG rules. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the IP flow to be - * verified. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform next-hop on. - * - * @param {string} parameters.direction The direction of the packet represented - * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' - * - * @param {string} parameters.protocol Protocol to be verified on. Possible - * values include: 'TCP', 'UDP' - * - * @param {string} parameters.localPort The local port. Acceptable values are a - * single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.remotePort The remote port. Acceptable values are - * a single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.localIPAddress The local IP address. Acceptable - * values are valid IPv4 addresses. - * - * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable - * values are valid IPv4 addresses. - * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of them, then this - * parameter must be specified. Otherwise optional). - * - * @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. - */ - verifyIPFlowWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Verify IP flow from the specified VM to a location given the currently - * configured NSG rules. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the IP flow to be - * verified. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform next-hop on. - * - * @param {string} parameters.direction The direction of the packet represented - * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' - * - * @param {string} parameters.protocol Protocol to be verified on. Possible - * values include: 'TCP', 'UDP' - * - * @param {string} parameters.localPort The local port. Acceptable values are a - * single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.remotePort The remote port. Acceptable values are - * a single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.localIPAddress The local IP address. Acceptable - * values are valid IPv4 addresses. - * - * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable - * values are valid IPv4 addresses. - * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of them, then this - * parameter must be specified. Otherwise optional). - * - * @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 {VerificationIPFlowResult} - 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. - * - * {VerificationIPFlowResult} [result] - The deserialized result object if an error did not occur. - * See {@link VerificationIPFlowResult} 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. - */ - verifyIPFlow(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - verifyIPFlow(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, callback: ServiceCallback): void; - verifyIPFlow(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the next hop from the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the source and destination - * endpoint. - * - * @param {string} parameters.targetResourceId The resource identifier of the - * target resource against which the action is to be performed. - * - * @param {string} parameters.sourceIPAddress The source IP address. - * - * @param {string} parameters.destinationIPAddress The destination IP address. - * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of the nics, then this - * parameter must be specified. Otherwise optional). - * - * @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. - */ - getNextHopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the next hop from the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the source and destination - * endpoint. - * - * @param {string} parameters.targetResourceId The resource identifier of the - * target resource against which the action is to be performed. - * - * @param {string} parameters.sourceIPAddress The source IP address. - * - * @param {string} parameters.destinationIPAddress The destination IP address. - * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of the nics, then this - * parameter must be specified. Otherwise optional). - * - * @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 {NextHopResult} - 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. - * - * {NextHopResult} [result] - The deserialized result object if an error did not occur. - * See {@link NextHopResult} 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. - */ - getNextHop(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getNextHop(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, callback: ServiceCallback): void; - getNextHop(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the configured and effective security group rules on the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the VM to check security - * groups for. - * - * @param {string} parameters.targetResourceId ID of the target VM. - * - * @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. - */ - getVMSecurityRulesWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the configured and effective security group rules on the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the VM to check security - * groups for. - * - * @param {string} parameters.targetResourceId ID of the target VM. - * - * @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 {SecurityGroupViewResult} - 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. - * - * {SecurityGroupViewResult} [result] - The deserialized result object if an error did not occur. - * See {@link SecurityGroupViewResult} 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. - */ - getVMSecurityRules(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getVMSecurityRules(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, callback: ServiceCallback): void; - getVMSecurityRules(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Initiate troubleshooting on a specified resource - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the resource to - * troubleshoot. - * - * @param {string} parameters.targetResourceId The target resource to - * troubleshoot. - * - * @param {string} parameters.storageId The ID for the storage account to save - * the troubleshoot result. - * - * @param {string} parameters.storagePath The path to the blob to save the - * troubleshoot result in. - * - * @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. - */ - getTroubleshootingWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Initiate troubleshooting on a specified resource - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the resource to - * troubleshoot. - * - * @param {string} parameters.targetResourceId The target resource to - * troubleshoot. - * - * @param {string} parameters.storageId The ID for the storage account to save - * the troubleshoot result. - * - * @param {string} parameters.storagePath The path to the blob to save the - * troubleshoot result in. - * - * @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 {TroubleshootingResult} - 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. - * - * {TroubleshootingResult} [result] - The deserialized result object if an error did not occur. - * See {@link TroubleshootingResult} 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. - */ - getTroubleshooting(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getTroubleshooting(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, callback: ServiceCallback): void; - getTroubleshooting(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get the last completed troubleshooting result on a specified resource - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the resource to query the - * troubleshooting result. - * - * @param {string} parameters.targetResourceId The target resource ID to query - * the troubleshooting result. - * - * @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. - */ - getTroubleshootingResultWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get the last completed troubleshooting result on a specified resource - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the resource to query the - * troubleshooting result. - * - * @param {string} parameters.targetResourceId The target resource ID to query - * the troubleshooting result. - * - * @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 {TroubleshootingResult} - 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. - * - * {TroubleshootingResult} [result] - The deserialized result object if an error did not occur. - * See {@link TroubleshootingResult} 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. - */ - getTroubleshootingResult(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getTroubleshootingResult(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, callback: ServiceCallback): void; - getTroubleshootingResult(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Configures flow log and traffic analytics (optional) on a specified - * resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the configuration of flow - * log. - * - * @param {string} parameters.targetResourceId The ID of the resource to - * configure for flow log and traffic analytics (optional) . - * - * @param {string} parameters.storageId ID of the storage account which is used - * to store the flow log. - * - * @param {boolean} parameters.enabled Flag to enable/disable flow logging. - * - * @param {object} [parameters.retentionPolicy] - * - * @param {number} [parameters.retentionPolicy.days] Number of days to retain - * flow log records. - * - * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable - * retention. - * - * @param {object} [parameters.format] - * - * @param {string} [parameters.format.type] The file type of flow log. Possible - * values include: 'JSON' - * - * @param {number} [parameters.format.version] The version (revision) of the - * flow log. - * - * @param {object} [parameters.flowAnalyticsConfiguration] - * - * @param {object} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration - * - * @param {boolean} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled - * Flag to enable/disable traffic analytics. - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId - * The resource guid of the attached workspace - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion - * The location of the attached workspace - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId - * Resource Id of the attached workspace - * - * @param {number} - * [parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.trafficAnalyticsInterval] - * The interval in minutes which would decide how frequently TA service should - * do flow analytics - * - * @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. - */ - setFlowLogConfigurationWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Configures flow log and traffic analytics (optional) on a specified - * resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the configuration of flow - * log. - * - * @param {string} parameters.targetResourceId The ID of the resource to - * configure for flow log and traffic analytics (optional) . - * - * @param {string} parameters.storageId ID of the storage account which is used - * to store the flow log. - * - * @param {boolean} parameters.enabled Flag to enable/disable flow logging. - * - * @param {object} [parameters.retentionPolicy] - * - * @param {number} [parameters.retentionPolicy.days] Number of days to retain - * flow log records. - * - * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable - * retention. - * - * @param {object} [parameters.format] - * - * @param {string} [parameters.format.type] The file type of flow log. Possible - * values include: 'JSON' - * - * @param {number} [parameters.format.version] The version (revision) of the - * flow log. - * - * @param {object} [parameters.flowAnalyticsConfiguration] - * - * @param {object} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration - * - * @param {boolean} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled - * Flag to enable/disable traffic analytics. - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId - * The resource guid of the attached workspace - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion - * The location of the attached workspace - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId - * Resource Id of the attached workspace - * - * @param {number} - * [parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.trafficAnalyticsInterval] - * The interval in minutes which would decide how frequently TA service should - * do flow analytics - * - * @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 {FlowLogInformation} - 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. - * - * {FlowLogInformation} [result] - The deserialized result object if an error did not occur. - * See {@link FlowLogInformation} 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. - */ - setFlowLogConfiguration(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - setFlowLogConfiguration(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, callback: ServiceCallback): void; - setFlowLogConfiguration(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Queries status of flow log and traffic analytics (optional) on a specified - * resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define a resource to query flow - * log and traffic analytics (optional) status. - * - * @param {string} parameters.targetResourceId The target resource where - * getting the flow log and traffic analytics (optional) status. - * - * @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. - */ - getFlowLogStatusWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Queries status of flow log and traffic analytics (optional) on a specified - * resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define a resource to query flow - * log and traffic analytics (optional) status. - * - * @param {string} parameters.targetResourceId The target resource where - * getting the flow log and traffic analytics (optional) status. - * - * @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 {FlowLogInformation} - 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. - * - * {FlowLogInformation} [result] - The deserialized result object if an error did not occur. - * See {@link FlowLogInformation} 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. - */ - getFlowLogStatus(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getFlowLogStatus(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, callback: ServiceCallback): void; - getFlowLogStatus(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Verifies the possibility of establishing a direct TCP connection from a - * virtual machine to a given endpoint including another VM or an arbitrary - * remote server. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine how the connectivity - * check will be performed. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource from - * which a connectivity check will be initiated. - * - * @param {number} [parameters.source.port] The source port from which a - * connectivity check will be performed. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * to which a connection attempt will be made. - * - * @param {string} [parameters.destination.address] The IP address or URI the - * resource to which a connection attempt will be made. - * - * @param {number} [parameters.destination.port] Port on which check - * connectivity will be performed. - * - * @param {string} [parameters.protocol] Network protocol. Possible values - * include: 'Tcp', 'Http', 'Https', 'Icmp' - * - * @param {object} [parameters.protocolConfiguration] - * - * @param {object} [parameters.protocolConfiguration.hTTPConfiguration] - * - * @param {string} [parameters.protocolConfiguration.hTTPConfiguration.method] - * HTTP method. Possible values include: 'Get' - * - * @param {array} [parameters.protocolConfiguration.hTTPConfiguration.headers] - * List of HTTP headers. - * - * @param {array} - * [parameters.protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid - * status codes. - * - * @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. - */ - checkConnectivityWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Verifies the possibility of establishing a direct TCP connection from a - * virtual machine to a given endpoint including another VM or an arbitrary - * remote server. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine how the connectivity - * check will be performed. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource from - * which a connectivity check will be initiated. - * - * @param {number} [parameters.source.port] The source port from which a - * connectivity check will be performed. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * to which a connection attempt will be made. - * - * @param {string} [parameters.destination.address] The IP address or URI the - * resource to which a connection attempt will be made. - * - * @param {number} [parameters.destination.port] Port on which check - * connectivity will be performed. - * - * @param {string} [parameters.protocol] Network protocol. Possible values - * include: 'Tcp', 'Http', 'Https', 'Icmp' - * - * @param {object} [parameters.protocolConfiguration] - * - * @param {object} [parameters.protocolConfiguration.hTTPConfiguration] - * - * @param {string} [parameters.protocolConfiguration.hTTPConfiguration.method] - * HTTP method. Possible values include: 'Get' - * - * @param {array} [parameters.protocolConfiguration.hTTPConfiguration.headers] - * List of HTTP headers. - * - * @param {array} - * [parameters.protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid - * status codes. - * - * @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 {ConnectivityInformation} - 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. - * - * {ConnectivityInformation} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectivityInformation} 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. - */ - checkConnectivity(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - checkConnectivity(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, callback: ServiceCallback): void; - checkConnectivity(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the relative latency score for internet service providers from a - * specified location to Azure regions. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine Azure reachability - * report configuration. - * - * @param {object} parameters.providerLocation - * - * @param {string} parameters.providerLocation.country The name of the country. - * - * @param {string} [parameters.providerLocation.state] The name of the state. - * - * @param {string} [parameters.providerLocation.city] The name of the city or - * town. - * - * @param {array} [parameters.providers] List of Internet service providers. - * - * @param {array} [parameters.azureLocations] Optional Azure regions to scope - * the query to. - * - * @param {date} parameters.startTime The start time for the Azure reachability - * report. - * - * @param {date} parameters.endTime The end time for the Azure reachability - * report. - * - * @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. - */ - getAzureReachabilityReportWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the relative latency score for internet service providers from a - * specified location to Azure regions. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine Azure reachability - * report configuration. - * - * @param {object} parameters.providerLocation - * - * @param {string} parameters.providerLocation.country The name of the country. - * - * @param {string} [parameters.providerLocation.state] The name of the state. - * - * @param {string} [parameters.providerLocation.city] The name of the city or - * town. - * - * @param {array} [parameters.providers] List of Internet service providers. - * - * @param {array} [parameters.azureLocations] Optional Azure regions to scope - * the query to. - * - * @param {date} parameters.startTime The start time for the Azure reachability - * report. - * - * @param {date} parameters.endTime The end time for the Azure reachability - * report. - * - * @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 {AzureReachabilityReport} - 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. - * - * {AzureReachabilityReport} [result] - The deserialized result object if an error did not occur. - * See {@link AzureReachabilityReport} 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. - */ - getAzureReachabilityReport(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getAzureReachabilityReport(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, callback: ServiceCallback): void; - getAzureReachabilityReport(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all available internet service providers for a specified Azure region. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that scope the list of available - * providers. - * - * @param {array} [parameters.azureLocations] A list of Azure regions. - * - * @param {string} [parameters.country] The country for available providers - * list. - * - * @param {string} [parameters.state] The state for available providers list. - * - * @param {string} [parameters.city] The city or town for available providers - * list. - * - * @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. - */ - listAvailableProvidersWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all available internet service providers for a specified Azure region. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that scope the list of available - * providers. - * - * @param {array} [parameters.azureLocations] A list of Azure regions. - * - * @param {string} [parameters.country] The country for available providers - * list. - * - * @param {string} [parameters.state] The state for available providers list. - * - * @param {string} [parameters.city] The city or town for available providers - * list. - * - * @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 {AvailableProvidersList} - 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. - * - * {AvailableProvidersList} [result] - The deserialized result object if an error did not occur. - * See {@link AvailableProvidersList} 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. - */ - listAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, callback: ServiceCallback): void; - listAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get network configuration diagnostic. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters to get network configuration - * diagnostic. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform network configuration diagnostic. Valid options are VM, - * NetworkInterface, VMSS/NetworkInterface and Application Gateway. - * - * @param {string} [parameters.verbosityLevel] Verbosity level. Accepted values - * are 'Normal', 'Minimum', 'Full'. Possible values include: 'Normal', - * 'Minimum', 'Full' - * - * @param {array} parameters.profiles List of network configuration diagnostic - * profiles. - * - * @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. - */ - getNetworkConfigurationDiagnosticWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkConfigurationDiagnosticParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get network configuration diagnostic. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters to get network configuration - * diagnostic. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform network configuration diagnostic. Valid options are VM, - * NetworkInterface, VMSS/NetworkInterface and Application Gateway. - * - * @param {string} [parameters.verbosityLevel] Verbosity level. Accepted values - * are 'Normal', 'Minimum', 'Full'. Possible values include: 'Normal', - * 'Minimum', 'Full' - * - * @param {array} parameters.profiles List of network configuration diagnostic - * profiles. - * - * @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 {NetworkConfigurationDiagnosticResponse} - 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. - * - * {NetworkConfigurationDiagnosticResponse} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkConfigurationDiagnosticResponse} 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. - */ - getNetworkConfigurationDiagnostic(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkConfigurationDiagnosticParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getNetworkConfigurationDiagnostic(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkConfigurationDiagnosticParameters, callback: ServiceCallback): void; - getNetworkConfigurationDiagnostic(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkConfigurationDiagnosticParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified network watcher resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified network watcher resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Verify IP flow from the specified VM to a location given the currently - * configured NSG rules. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the IP flow to be - * verified. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform next-hop on. - * - * @param {string} parameters.direction The direction of the packet represented - * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' - * - * @param {string} parameters.protocol Protocol to be verified on. Possible - * values include: 'TCP', 'UDP' - * - * @param {string} parameters.localPort The local port. Acceptable values are a - * single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.remotePort The remote port. Acceptable values are - * a single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.localIPAddress The local IP address. Acceptable - * values are valid IPv4 addresses. - * - * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable - * values are valid IPv4 addresses. - * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of them, then this - * parameter must be specified. Otherwise optional). - * - * @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. - */ - beginVerifyIPFlowWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Verify IP flow from the specified VM to a location given the currently - * configured NSG rules. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the IP flow to be - * verified. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform next-hop on. - * - * @param {string} parameters.direction The direction of the packet represented - * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' - * - * @param {string} parameters.protocol Protocol to be verified on. Possible - * values include: 'TCP', 'UDP' - * - * @param {string} parameters.localPort The local port. Acceptable values are a - * single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.remotePort The remote port. Acceptable values are - * a single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.localIPAddress The local IP address. Acceptable - * values are valid IPv4 addresses. - * - * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable - * values are valid IPv4 addresses. - * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of them, then this - * parameter must be specified. Otherwise optional). - * - * @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 {VerificationIPFlowResult} - 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. - * - * {VerificationIPFlowResult} [result] - The deserialized result object if an error did not occur. - * See {@link VerificationIPFlowResult} 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. - */ - beginVerifyIPFlow(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginVerifyIPFlow(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, callback: ServiceCallback): void; - beginVerifyIPFlow(resourceGroupName: string, networkWatcherName: string, parameters: models.VerificationIPFlowParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the next hop from the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the source and destination - * endpoint. - * - * @param {string} parameters.targetResourceId The resource identifier of the - * target resource against which the action is to be performed. - * - * @param {string} parameters.sourceIPAddress The source IP address. - * - * @param {string} parameters.destinationIPAddress The destination IP address. - * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of the nics, then this - * parameter must be specified. Otherwise optional). - * - * @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. - */ - beginGetNextHopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the next hop from the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the source and destination - * endpoint. - * - * @param {string} parameters.targetResourceId The resource identifier of the - * target resource against which the action is to be performed. - * - * @param {string} parameters.sourceIPAddress The source IP address. - * - * @param {string} parameters.destinationIPAddress The destination IP address. - * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of the nics, then this - * parameter must be specified. Otherwise optional). - * - * @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 {NextHopResult} - 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. - * - * {NextHopResult} [result] - The deserialized result object if an error did not occur. - * See {@link NextHopResult} 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. - */ - beginGetNextHop(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGetNextHop(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, callback: ServiceCallback): void; - beginGetNextHop(resourceGroupName: string, networkWatcherName: string, parameters: models.NextHopParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the configured and effective security group rules on the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the VM to check security - * groups for. - * - * @param {string} parameters.targetResourceId ID of the target VM. - * - * @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. - */ - beginGetVMSecurityRulesWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the configured and effective security group rules on the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the VM to check security - * groups for. - * - * @param {string} parameters.targetResourceId ID of the target VM. - * - * @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 {SecurityGroupViewResult} - 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. - * - * {SecurityGroupViewResult} [result] - The deserialized result object if an error did not occur. - * See {@link SecurityGroupViewResult} 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. - */ - beginGetVMSecurityRules(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGetVMSecurityRules(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, callback: ServiceCallback): void; - beginGetVMSecurityRules(resourceGroupName: string, networkWatcherName: string, parameters: models.SecurityGroupViewParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Initiate troubleshooting on a specified resource - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the resource to - * troubleshoot. - * - * @param {string} parameters.targetResourceId The target resource to - * troubleshoot. - * - * @param {string} parameters.storageId The ID for the storage account to save - * the troubleshoot result. - * - * @param {string} parameters.storagePath The path to the blob to save the - * troubleshoot result in. - * - * @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. - */ - beginGetTroubleshootingWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Initiate troubleshooting on a specified resource - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the resource to - * troubleshoot. - * - * @param {string} parameters.targetResourceId The target resource to - * troubleshoot. - * - * @param {string} parameters.storageId The ID for the storage account to save - * the troubleshoot result. - * - * @param {string} parameters.storagePath The path to the blob to save the - * troubleshoot result in. - * - * @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 {TroubleshootingResult} - 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. - * - * {TroubleshootingResult} [result] - The deserialized result object if an error did not occur. - * See {@link TroubleshootingResult} 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. - */ - beginGetTroubleshooting(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGetTroubleshooting(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, callback: ServiceCallback): void; - beginGetTroubleshooting(resourceGroupName: string, networkWatcherName: string, parameters: models.TroubleshootingParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get the last completed troubleshooting result on a specified resource - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the resource to query the - * troubleshooting result. - * - * @param {string} parameters.targetResourceId The target resource ID to query - * the troubleshooting result. - * - * @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. - */ - beginGetTroubleshootingResultWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get the last completed troubleshooting result on a specified resource - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the resource to query the - * troubleshooting result. - * - * @param {string} parameters.targetResourceId The target resource ID to query - * the troubleshooting result. - * - * @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 {TroubleshootingResult} - 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. - * - * {TroubleshootingResult} [result] - The deserialized result object if an error did not occur. - * See {@link TroubleshootingResult} 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. - */ - beginGetTroubleshootingResult(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGetTroubleshootingResult(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, callback: ServiceCallback): void; - beginGetTroubleshootingResult(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryTroubleshootingParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Configures flow log and traffic analytics (optional) on a specified - * resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the configuration of flow - * log. - * - * @param {string} parameters.targetResourceId The ID of the resource to - * configure for flow log and traffic analytics (optional) . - * - * @param {string} parameters.storageId ID of the storage account which is used - * to store the flow log. - * - * @param {boolean} parameters.enabled Flag to enable/disable flow logging. - * - * @param {object} [parameters.retentionPolicy] - * - * @param {number} [parameters.retentionPolicy.days] Number of days to retain - * flow log records. - * - * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable - * retention. - * - * @param {object} [parameters.format] - * - * @param {string} [parameters.format.type] The file type of flow log. Possible - * values include: 'JSON' - * - * @param {number} [parameters.format.version] The version (revision) of the - * flow log. - * - * @param {object} [parameters.flowAnalyticsConfiguration] - * - * @param {object} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration - * - * @param {boolean} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled - * Flag to enable/disable traffic analytics. - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId - * The resource guid of the attached workspace - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion - * The location of the attached workspace - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId - * Resource Id of the attached workspace - * - * @param {number} - * [parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.trafficAnalyticsInterval] - * The interval in minutes which would decide how frequently TA service should - * do flow analytics - * - * @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. - */ - beginSetFlowLogConfigurationWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Configures flow log and traffic analytics (optional) on a specified - * resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the configuration of flow - * log. - * - * @param {string} parameters.targetResourceId The ID of the resource to - * configure for flow log and traffic analytics (optional) . - * - * @param {string} parameters.storageId ID of the storage account which is used - * to store the flow log. - * - * @param {boolean} parameters.enabled Flag to enable/disable flow logging. - * - * @param {object} [parameters.retentionPolicy] - * - * @param {number} [parameters.retentionPolicy.days] Number of days to retain - * flow log records. - * - * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable - * retention. - * - * @param {object} [parameters.format] - * - * @param {string} [parameters.format.type] The file type of flow log. Possible - * values include: 'JSON' - * - * @param {number} [parameters.format.version] The version (revision) of the - * flow log. - * - * @param {object} [parameters.flowAnalyticsConfiguration] - * - * @param {object} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration - * - * @param {boolean} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled - * Flag to enable/disable traffic analytics. - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId - * The resource guid of the attached workspace - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion - * The location of the attached workspace - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId - * Resource Id of the attached workspace - * - * @param {number} - * [parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.trafficAnalyticsInterval] - * The interval in minutes which would decide how frequently TA service should - * do flow analytics - * - * @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 {FlowLogInformation} - 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. - * - * {FlowLogInformation} [result] - The deserialized result object if an error did not occur. - * See {@link FlowLogInformation} 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. - */ - beginSetFlowLogConfiguration(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginSetFlowLogConfiguration(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, callback: ServiceCallback): void; - beginSetFlowLogConfiguration(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogInformation, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Queries status of flow log and traffic analytics (optional) on a specified - * resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define a resource to query flow - * log and traffic analytics (optional) status. - * - * @param {string} parameters.targetResourceId The target resource where - * getting the flow log and traffic analytics (optional) status. - * - * @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. - */ - beginGetFlowLogStatusWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Queries status of flow log and traffic analytics (optional) on a specified - * resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define a resource to query flow - * log and traffic analytics (optional) status. - * - * @param {string} parameters.targetResourceId The target resource where - * getting the flow log and traffic analytics (optional) status. - * - * @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 {FlowLogInformation} - 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. - * - * {FlowLogInformation} [result] - The deserialized result object if an error did not occur. - * See {@link FlowLogInformation} 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. - */ - beginGetFlowLogStatus(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGetFlowLogStatus(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, callback: ServiceCallback): void; - beginGetFlowLogStatus(resourceGroupName: string, networkWatcherName: string, parameters: models.FlowLogStatusParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Verifies the possibility of establishing a direct TCP connection from a - * virtual machine to a given endpoint including another VM or an arbitrary - * remote server. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine how the connectivity - * check will be performed. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource from - * which a connectivity check will be initiated. - * - * @param {number} [parameters.source.port] The source port from which a - * connectivity check will be performed. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * to which a connection attempt will be made. - * - * @param {string} [parameters.destination.address] The IP address or URI the - * resource to which a connection attempt will be made. - * - * @param {number} [parameters.destination.port] Port on which check - * connectivity will be performed. - * - * @param {string} [parameters.protocol] Network protocol. Possible values - * include: 'Tcp', 'Http', 'Https', 'Icmp' - * - * @param {object} [parameters.protocolConfiguration] - * - * @param {object} [parameters.protocolConfiguration.hTTPConfiguration] - * - * @param {string} [parameters.protocolConfiguration.hTTPConfiguration.method] - * HTTP method. Possible values include: 'Get' - * - * @param {array} [parameters.protocolConfiguration.hTTPConfiguration.headers] - * List of HTTP headers. - * - * @param {array} - * [parameters.protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid - * status codes. - * - * @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. - */ - beginCheckConnectivityWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Verifies the possibility of establishing a direct TCP connection from a - * virtual machine to a given endpoint including another VM or an arbitrary - * remote server. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine how the connectivity - * check will be performed. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource from - * which a connectivity check will be initiated. - * - * @param {number} [parameters.source.port] The source port from which a - * connectivity check will be performed. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * to which a connection attempt will be made. - * - * @param {string} [parameters.destination.address] The IP address or URI the - * resource to which a connection attempt will be made. - * - * @param {number} [parameters.destination.port] Port on which check - * connectivity will be performed. - * - * @param {string} [parameters.protocol] Network protocol. Possible values - * include: 'Tcp', 'Http', 'Https', 'Icmp' - * - * @param {object} [parameters.protocolConfiguration] - * - * @param {object} [parameters.protocolConfiguration.hTTPConfiguration] - * - * @param {string} [parameters.protocolConfiguration.hTTPConfiguration.method] - * HTTP method. Possible values include: 'Get' - * - * @param {array} [parameters.protocolConfiguration.hTTPConfiguration.headers] - * List of HTTP headers. - * - * @param {array} - * [parameters.protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid - * status codes. - * - * @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 {ConnectivityInformation} - 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. - * - * {ConnectivityInformation} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectivityInformation} 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. - */ - beginCheckConnectivity(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCheckConnectivity(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, callback: ServiceCallback): void; - beginCheckConnectivity(resourceGroupName: string, networkWatcherName: string, parameters: models.ConnectivityParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the relative latency score for internet service providers from a - * specified location to Azure regions. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine Azure reachability - * report configuration. - * - * @param {object} parameters.providerLocation - * - * @param {string} parameters.providerLocation.country The name of the country. - * - * @param {string} [parameters.providerLocation.state] The name of the state. - * - * @param {string} [parameters.providerLocation.city] The name of the city or - * town. - * - * @param {array} [parameters.providers] List of Internet service providers. - * - * @param {array} [parameters.azureLocations] Optional Azure regions to scope - * the query to. - * - * @param {date} parameters.startTime The start time for the Azure reachability - * report. - * - * @param {date} parameters.endTime The end time for the Azure reachability - * report. - * - * @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. - */ - beginGetAzureReachabilityReportWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the relative latency score for internet service providers from a - * specified location to Azure regions. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine Azure reachability - * report configuration. - * - * @param {object} parameters.providerLocation - * - * @param {string} parameters.providerLocation.country The name of the country. - * - * @param {string} [parameters.providerLocation.state] The name of the state. - * - * @param {string} [parameters.providerLocation.city] The name of the city or - * town. - * - * @param {array} [parameters.providers] List of Internet service providers. - * - * @param {array} [parameters.azureLocations] Optional Azure regions to scope - * the query to. - * - * @param {date} parameters.startTime The start time for the Azure reachability - * report. - * - * @param {date} parameters.endTime The end time for the Azure reachability - * report. - * - * @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 {AzureReachabilityReport} - 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. - * - * {AzureReachabilityReport} [result] - The deserialized result object if an error did not occur. - * See {@link AzureReachabilityReport} 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. - */ - beginGetAzureReachabilityReport(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGetAzureReachabilityReport(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, callback: ServiceCallback): void; - beginGetAzureReachabilityReport(resourceGroupName: string, networkWatcherName: string, parameters: models.AzureReachabilityReportParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all available internet service providers for a specified Azure region. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that scope the list of available - * providers. - * - * @param {array} [parameters.azureLocations] A list of Azure regions. - * - * @param {string} [parameters.country] The country for available providers - * list. - * - * @param {string} [parameters.state] The state for available providers list. - * - * @param {string} [parameters.city] The city or town for available providers - * list. - * - * @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. - */ - beginListAvailableProvidersWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all available internet service providers for a specified Azure region. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that scope the list of available - * providers. - * - * @param {array} [parameters.azureLocations] A list of Azure regions. - * - * @param {string} [parameters.country] The country for available providers - * list. - * - * @param {string} [parameters.state] The state for available providers list. - * - * @param {string} [parameters.city] The city or town for available providers - * list. - * - * @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 {AvailableProvidersList} - 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. - * - * {AvailableProvidersList} [result] - The deserialized result object if an error did not occur. - * See {@link AvailableProvidersList} 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. - */ - beginListAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginListAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, callback: ServiceCallback): void; - beginListAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get network configuration diagnostic. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters to get network configuration - * diagnostic. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform network configuration diagnostic. Valid options are VM, - * NetworkInterface, VMSS/NetworkInterface and Application Gateway. - * - * @param {string} [parameters.verbosityLevel] Verbosity level. Accepted values - * are 'Normal', 'Minimum', 'Full'. Possible values include: 'Normal', - * 'Minimum', 'Full' - * - * @param {array} parameters.profiles List of network configuration diagnostic - * profiles. - * - * @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. - */ - beginGetNetworkConfigurationDiagnosticWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkConfigurationDiagnosticParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get network configuration diagnostic. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters to get network configuration - * diagnostic. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform network configuration diagnostic. Valid options are VM, - * NetworkInterface, VMSS/NetworkInterface and Application Gateway. - * - * @param {string} [parameters.verbosityLevel] Verbosity level. Accepted values - * are 'Normal', 'Minimum', 'Full'. Possible values include: 'Normal', - * 'Minimum', 'Full' - * - * @param {array} parameters.profiles List of network configuration diagnostic - * profiles. - * - * @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 {NetworkConfigurationDiagnosticResponse} - 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. - * - * {NetworkConfigurationDiagnosticResponse} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkConfigurationDiagnosticResponse} 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. - */ - beginGetNetworkConfigurationDiagnostic(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkConfigurationDiagnosticParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGetNetworkConfigurationDiagnostic(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkConfigurationDiagnosticParameters, callback: ServiceCallback): void; - beginGetNetworkConfigurationDiagnostic(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkConfigurationDiagnosticParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * PacketCaptures - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface PacketCaptures { - - - /** - * Create and start a packet capture on the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @param {object} parameters Parameters that define the create packet capture - * operation. - * - * @param {string} parameters.target The ID of the targeted resource, only VM - * is currently supported. - * - * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes - * captured per packet, the remaining bytes are truncated. - * - * @param {number} [parameters.totalBytesPerSession] Maximum size of the - * capture output. - * - * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the - * capture session in seconds. - * - * @param {object} parameters.storageLocation - * - * @param {string} [parameters.storageLocation.storageId] The ID of the storage - * account to save the packet capture session. Required if no local file path - * is provided. - * - * @param {string} [parameters.storageLocation.storagePath] The URI of the - * storage path to save the packet capture. Must be a well-formed URI - * describing the location to save the packet capture. - * - * @param {string} [parameters.storageLocation.filePath] A valid local path on - * the targeting VM. Must include the name of the capture file (*.cap). For - * linux virtual machine it must start with /var/captures. Required if no - * storage ID is provided, otherwise optional. - * - * @param {array} [parameters.filters] - * - * @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. - */ - createWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Create and start a packet capture on the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @param {object} parameters Parameters that define the create packet capture - * operation. - * - * @param {string} parameters.target The ID of the targeted resource, only VM - * is currently supported. - * - * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes - * captured per packet, the remaining bytes are truncated. - * - * @param {number} [parameters.totalBytesPerSession] Maximum size of the - * capture output. - * - * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the - * capture session in seconds. - * - * @param {object} parameters.storageLocation - * - * @param {string} [parameters.storageLocation.storageId] The ID of the storage - * account to save the packet capture session. Required if no local file path - * is provided. - * - * @param {string} [parameters.storageLocation.storagePath] The URI of the - * storage path to save the packet capture. Must be a well-formed URI - * describing the location to save the packet capture. - * - * @param {string} [parameters.storageLocation.filePath] A valid local path on - * the targeting VM. Must include the name of the capture file (*.cap). For - * linux virtual machine it must start with /var/captures. Required if no - * storage ID is provided, otherwise optional. - * - * @param {array} [parameters.filters] - * - * @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 {PacketCaptureResult} - 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. - * - * {PacketCaptureResult} [result] - The deserialized result object if an error did not occur. - * See {@link PacketCaptureResult} 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. - */ - create(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - create(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, callback: ServiceCallback): void; - create(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets a packet capture session by name. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @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, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a packet capture session by name. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @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 {PacketCaptureResult} - 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. - * - * {PacketCaptureResult} [result] - The deserialized result object if an error did not occur. - * See {@link PacketCaptureResult} 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, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Stops a specified packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @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. - */ - stopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Stops a specified packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - stop(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - stop(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; - stop(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Query the status of a running packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} packetCaptureName The name given to the packet capture - * session. - * - * @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. - */ - getStatusWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Query the status of a running packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} packetCaptureName The name given to the packet capture - * session. - * - * @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 {PacketCaptureQueryStatusResult} - 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. - * - * {PacketCaptureQueryStatusResult} [result] - The deserialized result object if an error did not occur. - * See {@link PacketCaptureQueryStatusResult} 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. - */ - getStatus(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getStatus(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; - getStatus(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all packet capture sessions within the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @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, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all packet capture sessions within the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @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 {PacketCaptureListResult} - 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. - * - * {PacketCaptureListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PacketCaptureListResult} 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, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, networkWatcherName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, networkWatcherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Create and start a packet capture on the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @param {object} parameters Parameters that define the create packet capture - * operation. - * - * @param {string} parameters.target The ID of the targeted resource, only VM - * is currently supported. - * - * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes - * captured per packet, the remaining bytes are truncated. - * - * @param {number} [parameters.totalBytesPerSession] Maximum size of the - * capture output. - * - * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the - * capture session in seconds. - * - * @param {object} parameters.storageLocation - * - * @param {string} [parameters.storageLocation.storageId] The ID of the storage - * account to save the packet capture session. Required if no local file path - * is provided. - * - * @param {string} [parameters.storageLocation.storagePath] The URI of the - * storage path to save the packet capture. Must be a well-formed URI - * describing the location to save the packet capture. - * - * @param {string} [parameters.storageLocation.filePath] A valid local path on - * the targeting VM. Must include the name of the capture file (*.cap). For - * linux virtual machine it must start with /var/captures. Required if no - * storage ID is provided, otherwise optional. - * - * @param {array} [parameters.filters] - * - * @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. - */ - beginCreateWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Create and start a packet capture on the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @param {object} parameters Parameters that define the create packet capture - * operation. - * - * @param {string} parameters.target The ID of the targeted resource, only VM - * is currently supported. - * - * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes - * captured per packet, the remaining bytes are truncated. - * - * @param {number} [parameters.totalBytesPerSession] Maximum size of the - * capture output. - * - * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the - * capture session in seconds. - * - * @param {object} parameters.storageLocation - * - * @param {string} [parameters.storageLocation.storageId] The ID of the storage - * account to save the packet capture session. Required if no local file path - * is provided. - * - * @param {string} [parameters.storageLocation.storagePath] The URI of the - * storage path to save the packet capture. Must be a well-formed URI - * describing the location to save the packet capture. - * - * @param {string} [parameters.storageLocation.filePath] A valid local path on - * the targeting VM. Must include the name of the capture file (*.cap). For - * linux virtual machine it must start with /var/captures. Required if no - * storage ID is provided, otherwise optional. - * - * @param {array} [parameters.filters] - * - * @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 {PacketCaptureResult} - 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. - * - * {PacketCaptureResult} [result] - The deserialized result object if an error did not occur. - * See {@link PacketCaptureResult} 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. - */ - beginCreate(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreate(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, callback: ServiceCallback): void; - beginCreate(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, parameters: models.PacketCapture, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Stops a specified packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @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. - */ - beginStopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Stops a specified packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginStop(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginStop(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; - beginStop(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Query the status of a running packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} packetCaptureName The name given to the packet capture - * session. - * - * @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. - */ - beginGetStatusWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Query the status of a running packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} packetCaptureName The name given to the packet capture - * session. - * - * @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 {PacketCaptureQueryStatusResult} - 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. - * - * {PacketCaptureQueryStatusResult} [result] - The deserialized result object if an error did not occur. - * See {@link PacketCaptureQueryStatusResult} 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. - */ - beginGetStatus(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGetStatus(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, callback: ServiceCallback): void; - beginGetStatus(resourceGroupName: string, networkWatcherName: string, packetCaptureName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ConnectionMonitors - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface ConnectionMonitors { - - - /** - * Create or update a connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @param {object} parameters Parameters that define the operation to create a - * connection monitor. - * - * @param {string} [parameters.location] Connection monitor location. - * - * @param {object} [parameters.tags] Connection monitor tags. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource used as - * the source by connection monitor. - * - * @param {number} [parameters.source.port] The source port used by connection - * monitor. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * used as the destination by connection monitor. - * - * @param {string} [parameters.destination.address] Address of the connection - * monitor destination (IP or domain name). - * - * @param {number} [parameters.destination.port] The destination port used by - * connection monitor. - * - * @param {boolean} [parameters.autoStart] Determines if the connection monitor - * will start automatically once created. - * - * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval - * in seconds. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Create or update a connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @param {object} parameters Parameters that define the operation to create a - * connection monitor. - * - * @param {string} [parameters.location] Connection monitor location. - * - * @param {object} [parameters.tags] Connection monitor tags. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource used as - * the source by connection monitor. - * - * @param {number} [parameters.source.port] The source port used by connection - * monitor. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * used as the destination by connection monitor. - * - * @param {string} [parameters.destination.address] Address of the connection - * monitor destination (IP or domain name). - * - * @param {number} [parameters.destination.port] The destination port used by - * connection monitor. - * - * @param {boolean} [parameters.autoStart] Determines if the connection monitor - * will start automatically once created. - * - * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval - * in seconds. - * - * @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 {ConnectionMonitorResult} - 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. - * - * {ConnectionMonitorResult} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectionMonitorResult} 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. - */ - createOrUpdate(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets a connection monitor by name. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a connection monitor by name. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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 {ConnectionMonitorResult} - 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. - * - * {ConnectionMonitorResult} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectionMonitorResult} 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, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Stops the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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. - */ - stopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Stops the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - stop(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - stop(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; - stop(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Starts the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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. - */ - startWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Starts the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - start(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - start(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; - start(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Query a snapshot of the most recent connection states. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name given to the connection - * monitor. - * - * @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. - */ - queryWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Query a snapshot of the most recent connection states. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name given to the connection - * monitor. - * - * @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 {ConnectionMonitorQueryResult} - 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. - * - * {ConnectionMonitorQueryResult} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectionMonitorQueryResult} 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. - */ - query(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - query(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; - query(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all connection monitors for the specified Network Watcher. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @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, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all connection monitors for the specified Network Watcher. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @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 {ConnectionMonitorListResult} - 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. - * - * {ConnectionMonitorListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectionMonitorListResult} 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, networkWatcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, networkWatcherName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, networkWatcherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Create or update a connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @param {object} parameters Parameters that define the operation to create a - * connection monitor. - * - * @param {string} [parameters.location] Connection monitor location. - * - * @param {object} [parameters.tags] Connection monitor tags. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource used as - * the source by connection monitor. - * - * @param {number} [parameters.source.port] The source port used by connection - * monitor. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * used as the destination by connection monitor. - * - * @param {string} [parameters.destination.address] Address of the connection - * monitor destination (IP or domain name). - * - * @param {number} [parameters.destination.port] The destination port used by - * connection monitor. - * - * @param {boolean} [parameters.autoStart] Determines if the connection monitor - * will start automatically once created. - * - * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval - * in seconds. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Create or update a connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @param {object} parameters Parameters that define the operation to create a - * connection monitor. - * - * @param {string} [parameters.location] Connection monitor location. - * - * @param {object} [parameters.tags] Connection monitor tags. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource used as - * the source by connection monitor. - * - * @param {number} [parameters.source.port] The source port used by connection - * monitor. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * used as the destination by connection monitor. - * - * @param {string} [parameters.destination.address] Address of the connection - * monitor destination (IP or domain name). - * - * @param {number} [parameters.destination.port] The destination port used by - * connection monitor. - * - * @param {boolean} [parameters.autoStart] Determines if the connection monitor - * will start automatically once created. - * - * @param {number} [parameters.monitoringIntervalInSeconds] Monitoring interval - * in seconds. - * - * @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 {ConnectionMonitorResult} - 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. - * - * {ConnectionMonitorResult} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectionMonitorResult} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, parameters: models.ConnectionMonitor, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Stops the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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. - */ - beginStopWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Stops the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginStop(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginStop(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; - beginStop(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Starts the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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. - */ - beginStartWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Starts the specified connection monitor. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name of the connection monitor. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginStart(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginStart(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; - beginStart(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Query a snapshot of the most recent connection states. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name given to the connection - * monitor. - * - * @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. - */ - beginQueryWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Query a snapshot of the most recent connection states. - * - * @param {string} resourceGroupName The name of the resource group containing - * Network Watcher. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} connectionMonitorName The name given to the connection - * monitor. - * - * @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 {ConnectionMonitorQueryResult} - 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. - * - * {ConnectionMonitorQueryResult} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectionMonitorQueryResult} 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. - */ - beginQuery(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginQuery(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, callback: ServiceCallback): void; - beginQuery(resourceGroupName: string, networkWatcherName: string, connectionMonitorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Operations - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface Operations { - - - /** - * Lists all of the available Network Rest API operations. - * - * @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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all of the available Network Rest API operations. - * - * @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 {OperationListResult} - 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. - * - * {OperationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link OperationListResult} 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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all of the available Network Rest API operations. - * - * @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>; - - /** - * Lists all of the available Network Rest API operations. - * - * @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 {OperationListResult} - 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. - * - * {OperationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link OperationListResult} 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 - * PublicIPAddresses - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface PublicIPAddresses { - - - /** - * Deletes the specified public IP address. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the subnet. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, publicIpAddressName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified public IP address. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the subnet. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, publicIpAddressName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, publicIpAddressName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, publicIpAddressName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified public IP address in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the subnet. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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, publicIpAddressName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified public IP address in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the subnet. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {PublicIPAddress} - 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. - * - * {PublicIPAddress} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddress} 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, publicIpAddressName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, publicIpAddressName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, publicIpAddressName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a static or dynamic public IP address. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the public IP address. - * - * @param {object} parameters Parameters supplied to the create or update - * public IP address operation. - * - * @param {object} [parameters.sku] The public IP address SKU. - * - * @param {string} [parameters.sku.name] Name of a public IP address SKU. - * Possible values include: 'Basic', 'Standard' - * - * @param {string} [parameters.publicIPAllocationMethod] The public IP - * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' - * - * @param {string} [parameters.publicIPAddressVersion] The public IP address - * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: - * 'IPv4', 'IPv6' - * - * @param {object} [parameters.dnsSettings] The FQDN of the DNS record - * associated with the public IP address. - * - * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the - * Domain name label.The concatenation of the domain name label and the - * regionalized DNS zone make up the fully qualified domain name associated - * with the public IP address. If a domain name label is specified, an A DNS - * record is created for the public IP in the Microsoft Azure DNS system. - * - * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified - * domain name of the A DNS record associated with the public IP. This is the - * concatenation of the domainNameLabel and the regionalized DNS zone. - * - * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the - * Reverse FQDN. A user-visible, fully qualified domain name that resolves to - * this public IP address. If the reverseFqdn is specified, then a PTR DNS - * record is created pointing from the IP address in the in-addr.arpa domain to - * the reverse FQDN. - * - * @param {array} [parameters.ipTags] The list of tags associated with the - * public IP address. - * - * @param {string} [parameters.ipAddress] The IP address associated with the - * public IP address resource. - * - * @param {object} [parameters.publicIPPrefix] The Public IP Prefix this Public - * IP Address should be allocated from. - * - * @param {string} [parameters.publicIPPrefix.id] Resource ID. - * - * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the - * public IP address. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * public IP resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting the - * IP allocated for the resource needs to come from. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a static or dynamic public IP address. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the public IP address. - * - * @param {object} parameters Parameters supplied to the create or update - * public IP address operation. - * - * @param {object} [parameters.sku] The public IP address SKU. - * - * @param {string} [parameters.sku.name] Name of a public IP address SKU. - * Possible values include: 'Basic', 'Standard' - * - * @param {string} [parameters.publicIPAllocationMethod] The public IP - * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' - * - * @param {string} [parameters.publicIPAddressVersion] The public IP address - * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: - * 'IPv4', 'IPv6' - * - * @param {object} [parameters.dnsSettings] The FQDN of the DNS record - * associated with the public IP address. - * - * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the - * Domain name label.The concatenation of the domain name label and the - * regionalized DNS zone make up the fully qualified domain name associated - * with the public IP address. If a domain name label is specified, an A DNS - * record is created for the public IP in the Microsoft Azure DNS system. - * - * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified - * domain name of the A DNS record associated with the public IP. This is the - * concatenation of the domainNameLabel and the regionalized DNS zone. - * - * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the - * Reverse FQDN. A user-visible, fully qualified domain name that resolves to - * this public IP address. If the reverseFqdn is specified, then a PTR DNS - * record is created pointing from the IP address in the in-addr.arpa domain to - * the reverse FQDN. - * - * @param {array} [parameters.ipTags] The list of tags associated with the - * public IP address. - * - * @param {string} [parameters.ipAddress] The IP address associated with the - * public IP address resource. - * - * @param {object} [parameters.publicIPPrefix] The Public IP Prefix this Public - * IP Address should be allocated from. - * - * @param {string} [parameters.publicIPPrefix.id] Resource ID. - * - * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the - * public IP address. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * public IP resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting the - * IP allocated for the resource needs to come from. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {PublicIPAddress} - 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. - * - * {PublicIPAddress} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddress} 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. - */ - createOrUpdate(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates public IP address tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the public IP address. - * - * @param {object} parameters Parameters supplied to update public IP address - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates public IP address tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the public IP address. - * - * @param {object} parameters Parameters supplied to update public IP address - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {PublicIPAddress} - 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. - * - * {PublicIPAddress} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddress} 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. - */ - updateTags(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the public IP addresses in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the public IP addresses in a subscription. - * - * @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 {PublicIPAddressListResult} - 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. - * - * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddressListResult} 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. - */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all public IP addresses in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all public IP addresses in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {PublicIPAddressListResult} - 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. - * - * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddressListResult} 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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets information about all public IP addresses on a virtual machine scale - * set level. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @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. - */ - listVirtualMachineScaleSetPublicIPAddressesWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets information about all public IP addresses on a virtual machine scale - * set level. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @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 {PublicIPAddressListResult} - 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. - * - * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddressListResult} 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. - */ - listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName: string, virtualMachineScaleSetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName: string, virtualMachineScaleSetName: string, callback: ServiceCallback): void; - listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName: string, virtualMachineScaleSetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets information about all public IP addresses in a virtual machine IP - * configuration in a virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @param {string} networkInterfaceName The network interface name. - * - * @param {string} ipConfigurationName The IP configuration name. - * - * @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. - */ - listVirtualMachineScaleSetVMPublicIPAddressesWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets information about all public IP addresses in a virtual machine IP - * configuration in a virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @param {string} networkInterfaceName The network interface name. - * - * @param {string} ipConfigurationName The IP configuration name. - * - * @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 {PublicIPAddressListResult} - 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. - * - * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddressListResult} 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. - */ - listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, callback: ServiceCallback): void; - listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get the specified public IP address in a virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} ipConfigurationName The name of the IP configuration. - * - * @param {string} publicIpAddressName The name of the public IP Address. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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. - */ - getVirtualMachineScaleSetPublicIPAddressWithHttpOperationResponse(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, publicIpAddressName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get the specified public IP address in a virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} ipConfigurationName The name of the IP configuration. - * - * @param {string} publicIpAddressName The name of the public IP Address. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {PublicIPAddress} - 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. - * - * {PublicIPAddress} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddress} 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. - */ - getVirtualMachineScaleSetPublicIPAddress(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, publicIpAddressName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - getVirtualMachineScaleSetPublicIPAddress(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, publicIpAddressName: string, callback: ServiceCallback): void; - getVirtualMachineScaleSetPublicIPAddress(resourceGroupName: string, virtualMachineScaleSetName: string, virtualmachineIndex: string, networkInterfaceName: string, ipConfigurationName: string, publicIpAddressName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified public IP address. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the subnet. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, publicIpAddressName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified public IP address. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the subnet. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, publicIpAddressName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, publicIpAddressName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, publicIpAddressName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a static or dynamic public IP address. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the public IP address. - * - * @param {object} parameters Parameters supplied to the create or update - * public IP address operation. - * - * @param {object} [parameters.sku] The public IP address SKU. - * - * @param {string} [parameters.sku.name] Name of a public IP address SKU. - * Possible values include: 'Basic', 'Standard' - * - * @param {string} [parameters.publicIPAllocationMethod] The public IP - * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' - * - * @param {string} [parameters.publicIPAddressVersion] The public IP address - * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: - * 'IPv4', 'IPv6' - * - * @param {object} [parameters.dnsSettings] The FQDN of the DNS record - * associated with the public IP address. - * - * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the - * Domain name label.The concatenation of the domain name label and the - * regionalized DNS zone make up the fully qualified domain name associated - * with the public IP address. If a domain name label is specified, an A DNS - * record is created for the public IP in the Microsoft Azure DNS system. - * - * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified - * domain name of the A DNS record associated with the public IP. This is the - * concatenation of the domainNameLabel and the regionalized DNS zone. - * - * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the - * Reverse FQDN. A user-visible, fully qualified domain name that resolves to - * this public IP address. If the reverseFqdn is specified, then a PTR DNS - * record is created pointing from the IP address in the in-addr.arpa domain to - * the reverse FQDN. - * - * @param {array} [parameters.ipTags] The list of tags associated with the - * public IP address. - * - * @param {string} [parameters.ipAddress] The IP address associated with the - * public IP address resource. - * - * @param {object} [parameters.publicIPPrefix] The Public IP Prefix this Public - * IP Address should be allocated from. - * - * @param {string} [parameters.publicIPPrefix.id] Resource ID. - * - * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the - * public IP address. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * public IP resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting the - * IP allocated for the resource needs to come from. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a static or dynamic public IP address. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the public IP address. - * - * @param {object} parameters Parameters supplied to the create or update - * public IP address operation. - * - * @param {object} [parameters.sku] The public IP address SKU. - * - * @param {string} [parameters.sku.name] Name of a public IP address SKU. - * Possible values include: 'Basic', 'Standard' - * - * @param {string} [parameters.publicIPAllocationMethod] The public IP - * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' - * - * @param {string} [parameters.publicIPAddressVersion] The public IP address - * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: - * 'IPv4', 'IPv6' - * - * @param {object} [parameters.dnsSettings] The FQDN of the DNS record - * associated with the public IP address. - * - * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the - * Domain name label.The concatenation of the domain name label and the - * regionalized DNS zone make up the fully qualified domain name associated - * with the public IP address. If a domain name label is specified, an A DNS - * record is created for the public IP in the Microsoft Azure DNS system. - * - * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified - * domain name of the A DNS record associated with the public IP. This is the - * concatenation of the domainNameLabel and the regionalized DNS zone. - * - * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the - * Reverse FQDN. A user-visible, fully qualified domain name that resolves to - * this public IP address. If the reverseFqdn is specified, then a PTR DNS - * record is created pointing from the IP address in the in-addr.arpa domain to - * the reverse FQDN. - * - * @param {array} [parameters.ipTags] The list of tags associated with the - * public IP address. - * - * @param {string} [parameters.ipAddress] The IP address associated with the - * public IP address resource. - * - * @param {object} [parameters.publicIPPrefix] The Public IP Prefix this Public - * IP Address should be allocated from. - * - * @param {string} [parameters.publicIPPrefix.id] Resource ID. - * - * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the - * public IP address. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * public IP resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting the - * IP allocated for the resource needs to come from. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {PublicIPAddress} - 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. - * - * {PublicIPAddress} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddress} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, publicIpAddressName: string, parameters: models.PublicIPAddress, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates public IP address tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the public IP address. - * - * @param {object} parameters Parameters supplied to update public IP address - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates public IP address tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the public IP address. - * - * @param {object} parameters Parameters supplied to update public IP address - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {PublicIPAddress} - 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. - * - * {PublicIPAddress} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddress} 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. - */ - beginUpdateTags(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, publicIpAddressName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the public IP addresses in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the public IP addresses in a subscription. - * - * @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 {PublicIPAddressListResult} - 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. - * - * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddressListResult} 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. - */ - listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAllNext(nextPageLink: string, callback: ServiceCallback): void; - listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all public IP addresses in a resource group. - * - * @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 public IP addresses in a resource group. - * - * @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 {PublicIPAddressListResult} - 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. - * - * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddressListResult} 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; - - - /** - * Gets information about all public IP addresses on a virtual machine scale - * set level. - * - * @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. - */ - listVirtualMachineScaleSetPublicIPAddressesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets information about all public IP addresses on a virtual machine scale - * set level. - * - * @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 {PublicIPAddressListResult} - 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. - * - * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddressListResult} 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. - */ - listVirtualMachineScaleSetPublicIPAddressesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listVirtualMachineScaleSetPublicIPAddressesNext(nextPageLink: string, callback: ServiceCallback): void; - listVirtualMachineScaleSetPublicIPAddressesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets information about all public IP addresses in a virtual machine IP - * configuration in a virtual machine scale set. - * - * @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. - */ - listVirtualMachineScaleSetVMPublicIPAddressesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets information about all public IP addresses in a virtual machine IP - * configuration in a virtual machine scale set. - * - * @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 {PublicIPAddressListResult} - 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. - * - * {PublicIPAddressListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPAddressListResult} 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. - */ - listVirtualMachineScaleSetVMPublicIPAddressesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listVirtualMachineScaleSetVMPublicIPAddressesNext(nextPageLink: string, callback: ServiceCallback): void; - listVirtualMachineScaleSetVMPublicIPAddressesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * PublicIPPrefixes - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface PublicIPPrefixes { - - - /** - * Deletes the specified public IP prefix. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the PublicIpPrefix. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, publicIpPrefixName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified public IP prefix. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the PublicIpPrefix. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, publicIpPrefixName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, publicIpPrefixName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, publicIpPrefixName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified public IP prefix in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the PublicIPPrefx. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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, publicIpPrefixName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified public IP prefix in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the PublicIPPrefx. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {PublicIPPrefix} - 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. - * - * {PublicIPPrefix} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPPrefix} 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, publicIpPrefixName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, publicIpPrefixName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, publicIpPrefixName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a static or dynamic public IP prefix. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the public IP prefix. - * - * @param {object} parameters Parameters supplied to the create or update - * public IP prefix operation. - * - * @param {object} [parameters.sku] The public IP prefix SKU. - * - * @param {string} [parameters.sku.name] Name of a public IP prefix SKU. - * Possible values include: 'Standard' - * - * @param {string} [parameters.publicIPAddressVersion] The public IP address - * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: - * 'IPv4', 'IPv6' - * - * @param {array} [parameters.ipTags] The list of tags associated with the - * public IP prefix. - * - * @param {number} [parameters.prefixLength] The Length of the Public IP - * Prefix. - * - * @param {string} [parameters.ipPrefix] The allocated Prefix - * - * @param {array} [parameters.publicIPAddresses] The list of all referenced - * PublicIPAddresses - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * public IP prefix resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * Public IP prefix resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting the - * IP allocated for the resource needs to come from. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, publicIpPrefixName: string, parameters: models.PublicIPPrefix, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a static or dynamic public IP prefix. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the public IP prefix. - * - * @param {object} parameters Parameters supplied to the create or update - * public IP prefix operation. - * - * @param {object} [parameters.sku] The public IP prefix SKU. - * - * @param {string} [parameters.sku.name] Name of a public IP prefix SKU. - * Possible values include: 'Standard' - * - * @param {string} [parameters.publicIPAddressVersion] The public IP address - * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: - * 'IPv4', 'IPv6' - * - * @param {array} [parameters.ipTags] The list of tags associated with the - * public IP prefix. - * - * @param {number} [parameters.prefixLength] The Length of the Public IP - * Prefix. - * - * @param {string} [parameters.ipPrefix] The allocated Prefix - * - * @param {array} [parameters.publicIPAddresses] The list of all referenced - * PublicIPAddresses - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * public IP prefix resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * Public IP prefix resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting the - * IP allocated for the resource needs to come from. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {PublicIPPrefix} - 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. - * - * {PublicIPPrefix} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPPrefix} 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. - */ - createOrUpdate(resourceGroupName: string, publicIpPrefixName: string, parameters: models.PublicIPPrefix, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, publicIpPrefixName: string, parameters: models.PublicIPPrefix, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, publicIpPrefixName: string, parameters: models.PublicIPPrefix, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates public IP prefix tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the public IP prefix. - * - * @param {object} parameters Parameters supplied to update public IP prefix - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, publicIpPrefixName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates public IP prefix tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the public IP prefix. - * - * @param {object} parameters Parameters supplied to update public IP prefix - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {PublicIPPrefix} - 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. - * - * {PublicIPPrefix} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPPrefix} 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. - */ - updateTags(resourceGroupName: string, publicIpPrefixName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, publicIpPrefixName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, publicIpPrefixName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the public IP prefixes in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the public IP prefixes in a subscription. - * - * @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 {PublicIPPrefixListResult} - 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. - * - * {PublicIPPrefixListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPPrefixListResult} 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. - */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all public IP prefixes in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all public IP prefixes in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {PublicIPPrefixListResult} - 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. - * - * {PublicIPPrefixListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPPrefixListResult} 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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified public IP prefix. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the PublicIpPrefix. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, publicIpPrefixName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified public IP prefix. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the PublicIpPrefix. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, publicIpPrefixName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, publicIpPrefixName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, publicIpPrefixName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a static or dynamic public IP prefix. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the public IP prefix. - * - * @param {object} parameters Parameters supplied to the create or update - * public IP prefix operation. - * - * @param {object} [parameters.sku] The public IP prefix SKU. - * - * @param {string} [parameters.sku.name] Name of a public IP prefix SKU. - * Possible values include: 'Standard' - * - * @param {string} [parameters.publicIPAddressVersion] The public IP address - * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: - * 'IPv4', 'IPv6' - * - * @param {array} [parameters.ipTags] The list of tags associated with the - * public IP prefix. - * - * @param {number} [parameters.prefixLength] The Length of the Public IP - * Prefix. - * - * @param {string} [parameters.ipPrefix] The allocated Prefix - * - * @param {array} [parameters.publicIPAddresses] The list of all referenced - * PublicIPAddresses - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * public IP prefix resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * Public IP prefix resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting the - * IP allocated for the resource needs to come from. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, publicIpPrefixName: string, parameters: models.PublicIPPrefix, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a static or dynamic public IP prefix. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the public IP prefix. - * - * @param {object} parameters Parameters supplied to the create or update - * public IP prefix operation. - * - * @param {object} [parameters.sku] The public IP prefix SKU. - * - * @param {string} [parameters.sku.name] Name of a public IP prefix SKU. - * Possible values include: 'Standard' - * - * @param {string} [parameters.publicIPAddressVersion] The public IP address - * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: - * 'IPv4', 'IPv6' - * - * @param {array} [parameters.ipTags] The list of tags associated with the - * public IP prefix. - * - * @param {number} [parameters.prefixLength] The Length of the Public IP - * Prefix. - * - * @param {string} [parameters.ipPrefix] The allocated Prefix - * - * @param {array} [parameters.publicIPAddresses] The list of all referenced - * PublicIPAddresses - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * public IP prefix resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * Public IP prefix resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting the - * IP allocated for the resource needs to come from. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {PublicIPPrefix} - 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. - * - * {PublicIPPrefix} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPPrefix} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, publicIpPrefixName: string, parameters: models.PublicIPPrefix, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, publicIpPrefixName: string, parameters: models.PublicIPPrefix, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, publicIpPrefixName: string, parameters: models.PublicIPPrefix, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates public IP prefix tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the public IP prefix. - * - * @param {object} parameters Parameters supplied to update public IP prefix - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, publicIpPrefixName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates public IP prefix tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the public IP prefix. - * - * @param {object} parameters Parameters supplied to update public IP prefix - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {PublicIPPrefix} - 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. - * - * {PublicIPPrefix} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPPrefix} 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. - */ - beginUpdateTags(resourceGroupName: string, publicIpPrefixName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, publicIpPrefixName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, publicIpPrefixName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the public IP prefixes in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the public IP prefixes in a subscription. - * - * @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 {PublicIPPrefixListResult} - 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. - * - * {PublicIPPrefixListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPPrefixListResult} 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. - */ - listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAllNext(nextPageLink: string, callback: ServiceCallback): void; - listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all public IP prefixes in a resource group. - * - * @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 public IP prefixes in a resource group. - * - * @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 {PublicIPPrefixListResult} - 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. - * - * {PublicIPPrefixListResult} [result] - The deserialized result object if an error did not occur. - * See {@link PublicIPPrefixListResult} 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 - * RouteFilters - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface RouteFilters { - - - /** - * Deletes the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, routeFilterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, routeFilterName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, routeFilterName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced express route bgp - * peering resources. - * - * @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, routeFilterName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced express route bgp - * peering resources. - * - * @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 {RouteFilter} - 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. - * - * {RouteFilter} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilter} 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, routeFilterName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, routeFilterName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, routeFilterName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a route filter in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} routeFilterParameters Parameters supplied to the create or - * update route filter operation. - * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. - * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. - * - * @param {string} [routeFilterParameters.id] Resource ID. - * - * @param {string} [routeFilterParameters.location] Resource location. - * - * @param {object} [routeFilterParameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a route filter in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} routeFilterParameters Parameters supplied to the create or - * update route filter operation. - * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. - * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. - * - * @param {string} [routeFilterParameters.id] Resource ID. - * - * @param {string} [routeFilterParameters.location] Resource location. - * - * @param {object} [routeFilterParameters.tags] Resource tags. - * - * @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 {RouteFilter} - 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. - * - * {RouteFilter} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilter} 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. - */ - createOrUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates a route filter in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} routeFilterParameters Parameters supplied to the update - * route filter operation. - * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. - * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. - * - * @param {object} [routeFilterParameters.tags] Resource tags. - * - * @param {string} [routeFilterParameters.id] Resource ID. - * - * @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. - */ - updateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a route filter in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} routeFilterParameters Parameters supplied to the update - * route filter operation. - * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. - * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. - * - * @param {object} [routeFilterParameters.tags] Resource tags. - * - * @param {string} [routeFilterParameters.id] Resource ID. - * - * @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 {RouteFilter} - 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. - * - * {RouteFilter} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilter} 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. - */ - update(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, callback: ServiceCallback): void; - update(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all route filters in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all route filters in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {RouteFilterListResult} - 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. - * - * {RouteFilterListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilterListResult} 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. - */ - listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all route filters in a subscription. - * - * @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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all route filters in a subscription. - * - * @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 {RouteFilterListResult} - 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. - * - * {RouteFilterListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilterListResult} 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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, routeFilterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, routeFilterName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, routeFilterName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a route filter in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} routeFilterParameters Parameters supplied to the create or - * update route filter operation. - * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. - * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. - * - * @param {string} [routeFilterParameters.id] Resource ID. - * - * @param {string} [routeFilterParameters.location] Resource location. - * - * @param {object} [routeFilterParameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a route filter in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} routeFilterParameters Parameters supplied to the create or - * update route filter operation. - * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. - * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. - * - * @param {string} [routeFilterParameters.id] Resource ID. - * - * @param {string} [routeFilterParameters.location] Resource location. - * - * @param {object} [routeFilterParameters.tags] Resource tags. - * - * @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 {RouteFilter} - 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. - * - * {RouteFilter} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilter} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.RouteFilter, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates a route filter in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} routeFilterParameters Parameters supplied to the update - * route filter operation. - * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. - * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. - * - * @param {object} [routeFilterParameters.tags] Resource tags. - * - * @param {string} [routeFilterParameters.id] Resource ID. - * - * @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. - */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a route filter in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} routeFilterParameters Parameters supplied to the update - * route filter operation. - * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. - * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. - * - * @param {object} [routeFilterParameters.tags] Resource tags. - * - * @param {string} [routeFilterParameters.id] Resource ID. - * - * @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 {RouteFilter} - 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. - * - * {RouteFilter} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilter} 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. - */ - beginUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, routeFilterName: string, routeFilterParameters: models.PatchRouteFilter, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all route filters in a resource group. - * - * @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. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all route filters in a resource group. - * - * @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 {RouteFilterListResult} - 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. - * - * {RouteFilterListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilterListResult} 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. - */ - listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all route filters in a subscription. - * - * @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 route filters in a subscription. - * - * @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 {RouteFilterListResult} - 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. - * - * {RouteFilterListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilterListResult} 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 - * RouteFilterRules - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface RouteFilterRules { - - - /** - * Deletes the specified rule from a route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the rule. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified rule from a route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the rule. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, routeFilterName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, routeFilterName: string, ruleName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, routeFilterName: string, ruleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified rule from a route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the rule. - * - * @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, routeFilterName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified rule from a route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the rule. - * - * @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 {RouteFilterRule} - 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. - * - * {RouteFilterRule} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilterRule} 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, routeFilterName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, routeFilterName: string, ruleName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, routeFilterName: string, ruleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a route in the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the route filter rule. - * - * @param {object} routeFilterRuleParameters Parameters supplied to the create - * or update route filter rule operation. - * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' - * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] - * - * @param {string} [routeFilterRuleParameters.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [routeFilterRuleParameters.location] Resource location. - * - * @param {string} [routeFilterRuleParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a route in the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the route filter rule. - * - * @param {object} routeFilterRuleParameters Parameters supplied to the create - * or update route filter rule operation. - * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' - * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] - * - * @param {string} [routeFilterRuleParameters.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [routeFilterRuleParameters.location] Resource location. - * - * @param {string} [routeFilterRuleParameters.id] Resource ID. - * - * @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 {RouteFilterRule} - 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. - * - * {RouteFilterRule} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilterRule} 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. - */ - createOrUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates a route in the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the route filter rule. - * - * @param {object} routeFilterRuleParameters Parameters supplied to the update - * route filter rule operation. - * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' - * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] - * - * @param {string} [routeFilterRuleParameters.id] Resource ID. - * - * @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. - */ - updateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a route in the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the route filter rule. - * - * @param {object} routeFilterRuleParameters Parameters supplied to the update - * route filter rule operation. - * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' - * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] - * - * @param {string} [routeFilterRuleParameters.id] Resource ID. - * - * @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 {RouteFilterRule} - 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. - * - * {RouteFilterRule} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilterRule} 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. - */ - update(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, callback: ServiceCallback): void; - update(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all RouteFilterRules in a route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @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. - */ - listByRouteFilterWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all RouteFilterRules in a route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @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 {RouteFilterRuleListResult} - 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. - * - * {RouteFilterRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilterRuleListResult} 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. - */ - listByRouteFilter(resourceGroupName: string, routeFilterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByRouteFilter(resourceGroupName: string, routeFilterName: string, callback: ServiceCallback): void; - listByRouteFilter(resourceGroupName: string, routeFilterName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified rule from a route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the rule. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified rule from a route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the rule. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, routeFilterName: string, ruleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, routeFilterName: string, ruleName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, routeFilterName: string, ruleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a route in the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the route filter rule. - * - * @param {object} routeFilterRuleParameters Parameters supplied to the create - * or update route filter rule operation. - * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' - * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] - * - * @param {string} [routeFilterRuleParameters.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [routeFilterRuleParameters.location] Resource location. - * - * @param {string} [routeFilterRuleParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a route in the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the route filter rule. - * - * @param {object} routeFilterRuleParameters Parameters supplied to the create - * or update route filter rule operation. - * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' - * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] - * - * @param {string} [routeFilterRuleParameters.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [routeFilterRuleParameters.location] Resource location. - * - * @param {string} [routeFilterRuleParameters.id] Resource ID. - * - * @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 {RouteFilterRule} - 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. - * - * {RouteFilterRule} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilterRule} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.RouteFilterRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates a route in the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the route filter rule. - * - * @param {object} routeFilterRuleParameters Parameters supplied to the update - * route filter rule operation. - * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' - * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] - * - * @param {string} [routeFilterRuleParameters.id] Resource ID. - * - * @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. - */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a route in the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the route filter rule. - * - * @param {object} routeFilterRuleParameters Parameters supplied to the update - * route filter rule operation. - * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' - * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] - * - * @param {string} [routeFilterRuleParameters.id] Resource ID. - * - * @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 {RouteFilterRule} - 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. - * - * {RouteFilterRule} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilterRule} 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. - */ - beginUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, routeFilterName: string, ruleName: string, routeFilterRuleParameters: models.PatchRouteFilterRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all RouteFilterRules in a route filter. - * - * @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. - */ - listByRouteFilterNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all RouteFilterRules in a route filter. - * - * @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 {RouteFilterRuleListResult} - 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. - * - * {RouteFilterRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RouteFilterRuleListResult} 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. - */ - listByRouteFilterNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByRouteFilterNext(nextPageLink: string, callback: ServiceCallback): void; - listByRouteFilterNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * RouteTables - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface RouteTables { - - - /** - * Deletes the specified route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, routeTableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, routeTableName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, routeTableName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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, routeTableName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {RouteTable} - 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. - * - * {RouteTable} [result] - The deserialized result object if an error did not occur. - * See {@link RouteTable} 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, routeTableName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, routeTableName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, routeTableName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Create or updates a route table in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {object} parameters Parameters supplied to the create or update route - * table operation. - * - * @param {array} [parameters.routes] Collection of routes contained within a - * route table. - * - * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets - * whether to disable the routes learned by BGP on that route table. True means - * disable. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Create or updates a route table in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {object} parameters Parameters supplied to the create or update route - * table operation. - * - * @param {array} [parameters.routes] Collection of routes contained within a - * route table. - * - * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets - * whether to disable the routes learned by BGP on that route table. True means - * disable. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {RouteTable} - 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. - * - * {RouteTable} [result] - The deserialized result object if an error did not occur. - * See {@link RouteTable} 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. - */ - createOrUpdate(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates a route table tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {object} parameters Parameters supplied to update route table tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a route table tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {object} parameters Parameters supplied to update route table tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {RouteTable} - 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. - * - * {RouteTable} [result] - The deserialized result object if an error did not occur. - * See {@link RouteTable} 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. - */ - updateTags(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all route tables in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all route tables in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {RouteTableListResult} - 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. - * - * {RouteTableListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RouteTableListResult} 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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all route tables in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all route tables in a subscription. - * - * @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 {RouteTableListResult} - 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. - * - * {RouteTableListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RouteTableListResult} 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. - */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, routeTableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, routeTableName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, routeTableName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Create or updates a route table in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {object} parameters Parameters supplied to the create or update route - * table operation. - * - * @param {array} [parameters.routes] Collection of routes contained within a - * route table. - * - * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets - * whether to disable the routes learned by BGP on that route table. True means - * disable. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Create or updates a route table in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {object} parameters Parameters supplied to the create or update route - * table operation. - * - * @param {array} [parameters.routes] Collection of routes contained within a - * route table. - * - * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets - * whether to disable the routes learned by BGP on that route table. True means - * disable. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {RouteTable} - 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. - * - * {RouteTable} [result] - The deserialized result object if an error did not occur. - * See {@link RouteTable} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, routeTableName: string, parameters: models.RouteTable, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates a route table tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {object} parameters Parameters supplied to update route table tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a route table tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {object} parameters Parameters supplied to update route table tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {RouteTable} - 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. - * - * {RouteTable} [result] - The deserialized result object if an error did not occur. - * See {@link RouteTable} 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. - */ - beginUpdateTags(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, routeTableName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all route tables in a resource group. - * - * @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 route tables in a resource group. - * - * @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 {RouteTableListResult} - 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. - * - * {RouteTableListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RouteTableListResult} 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; - - - /** - * Gets all route tables in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all route tables in a subscription. - * - * @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 {RouteTableListResult} - 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. - * - * {RouteTableListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RouteTableListResult} 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. - */ - listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAllNext(nextPageLink: string, callback: ServiceCallback): void; - listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Routes - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface Routes { - - - /** - * Deletes the specified route from a route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified route from a route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, routeTableName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, routeTableName: string, routeName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, routeTableName: string, routeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified route from a route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @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, routeTableName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified route from a route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @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 {Route} - 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. - * - * {Route} [result] - The deserialized result object if an error did not occur. - * See {@link Route} 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, routeTableName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, routeTableName: string, routeName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, routeTableName: string, routeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a route in the specified route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @param {object} routeParameters Parameters supplied to the create or update - * route operation. - * - * @param {string} [routeParameters.addressPrefix] The destination CIDR to - * which the route applies. - * - * @param {string} routeParameters.nextHopType The type of Azure hop the packet - * should be sent to. Possible values are: 'VirtualNetworkGateway', - * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values - * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', - * 'VirtualAppliance', 'None' - * - * @param {string} [routeParameters.nextHopIpAddress] The IP address packets - * should be forwarded to. Next hop values are only allowed in routes where the - * next hop type is VirtualAppliance. - * - * @param {string} [routeParameters.provisioningState] The provisioning state - * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [routeParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [routeParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [routeParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a route in the specified route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @param {object} routeParameters Parameters supplied to the create or update - * route operation. - * - * @param {string} [routeParameters.addressPrefix] The destination CIDR to - * which the route applies. - * - * @param {string} routeParameters.nextHopType The type of Azure hop the packet - * should be sent to. Possible values are: 'VirtualNetworkGateway', - * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values - * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', - * 'VirtualAppliance', 'None' - * - * @param {string} [routeParameters.nextHopIpAddress] The IP address packets - * should be forwarded to. Next hop values are only allowed in routes where the - * next hop type is VirtualAppliance. - * - * @param {string} [routeParameters.provisioningState] The provisioning state - * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [routeParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [routeParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [routeParameters.id] Resource ID. - * - * @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 {Route} - 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. - * - * {Route} [result] - The deserialized result object if an error did not occur. - * See {@link Route} 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. - */ - createOrUpdate(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all routes in a route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @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, routeTableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all routes in a route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @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 {RouteListResult} - 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. - * - * {RouteListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RouteListResult} 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, routeTableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, routeTableName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, routeTableName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified route from a route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified route from a route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, routeTableName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, routeTableName: string, routeName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, routeTableName: string, routeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a route in the specified route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @param {object} routeParameters Parameters supplied to the create or update - * route operation. - * - * @param {string} [routeParameters.addressPrefix] The destination CIDR to - * which the route applies. - * - * @param {string} routeParameters.nextHopType The type of Azure hop the packet - * should be sent to. Possible values are: 'VirtualNetworkGateway', - * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values - * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', - * 'VirtualAppliance', 'None' - * - * @param {string} [routeParameters.nextHopIpAddress] The IP address packets - * should be forwarded to. Next hop values are only allowed in routes where the - * next hop type is VirtualAppliance. - * - * @param {string} [routeParameters.provisioningState] The provisioning state - * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [routeParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [routeParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [routeParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a route in the specified route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @param {object} routeParameters Parameters supplied to the create or update - * route operation. - * - * @param {string} [routeParameters.addressPrefix] The destination CIDR to - * which the route applies. - * - * @param {string} routeParameters.nextHopType The type of Azure hop the packet - * should be sent to. Possible values are: 'VirtualNetworkGateway', - * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values - * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', - * 'VirtualAppliance', 'None' - * - * @param {string} [routeParameters.nextHopIpAddress] The IP address packets - * should be forwarded to. Next hop values are only allowed in routes where the - * next hop type is VirtualAppliance. - * - * @param {string} [routeParameters.provisioningState] The provisioning state - * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [routeParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [routeParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [routeParameters.id] Resource ID. - * - * @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 {Route} - 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. - * - * {Route} [result] - The deserialized result object if an error did not occur. - * See {@link Route} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, routeTableName: string, routeName: string, routeParameters: models.Route, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all routes in a route table. - * - * @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 routes in a route table. - * - * @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 {RouteListResult} - 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. - * - * {RouteListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RouteListResult} 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 - * BgpServiceCommunities - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface BgpServiceCommunities { - - - /** - * Gets all the available bgp service communities. - * - * @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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the available bgp service communities. - * - * @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 {BgpServiceCommunityListResult} - 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. - * - * {BgpServiceCommunityListResult} [result] - The deserialized result object if an error did not occur. - * See {@link BgpServiceCommunityListResult} 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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the available bgp service communities. - * - * @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 the available bgp service communities. - * - * @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 {BgpServiceCommunityListResult} - 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. - * - * {BgpServiceCommunityListResult} [result] - The deserialized result object if an error did not occur. - * See {@link BgpServiceCommunityListResult} 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 - * ServiceEndpointPolicies - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface ServiceEndpointPolicies { - - - /** - * Deletes the specified service endpoint policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serviceEndpointPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified service endpoint policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, serviceEndpointPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serviceEndpointPolicyName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serviceEndpointPolicyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified service Endpoint Policies in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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, serviceEndpointPolicyName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified service Endpoint Policies in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {ServiceEndpointPolicy} - 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. - * - * {ServiceEndpointPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link ServiceEndpointPolicy} 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, serviceEndpointPolicyName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serviceEndpointPolicyName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serviceEndpointPolicyName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a service Endpoint Policies. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {object} parameters Parameters supplied to the create or update - * service endpoint policy operation. - * - * @param {array} [parameters.serviceEndpointPolicyDefinitions] A collection of - * service endpoint policy definitions of the service endpoint policy. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.ServiceEndpointPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a service Endpoint Policies. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {object} parameters Parameters supplied to the create or update - * service endpoint policy operation. - * - * @param {array} [parameters.serviceEndpointPolicyDefinitions] A collection of - * service endpoint policy definitions of the service endpoint policy. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ServiceEndpointPolicy} - 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. - * - * {ServiceEndpointPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link ServiceEndpointPolicy} 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. - */ - createOrUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.ServiceEndpointPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.ServiceEndpointPolicy, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.ServiceEndpointPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates service Endpoint Policies. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {object} parameters Parameters supplied to update service endpoint - * policy tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateWithHttpOperationResponse(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates service Endpoint Policies. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {object} parameters Parameters supplied to update service endpoint - * policy tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ServiceEndpointPolicy} - 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. - * - * {ServiceEndpointPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link ServiceEndpointPolicy} 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. - */ - update(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - update(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the service endpoint policies in a subscription. - * - * @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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the service endpoint policies in a subscription. - * - * @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 {ServiceEndpointPolicyListResult} - 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. - * - * {ServiceEndpointPolicyListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServiceEndpointPolicyListResult} 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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all service endpoint Policies in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all service endpoint Policies in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {ServiceEndpointPolicyListResult} - 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. - * - * {ServiceEndpointPolicyListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServiceEndpointPolicyListResult} 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. - */ - listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified service endpoint policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serviceEndpointPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified service endpoint policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, serviceEndpointPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, serviceEndpointPolicyName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, serviceEndpointPolicyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a service Endpoint Policies. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {object} parameters Parameters supplied to the create or update - * service endpoint policy operation. - * - * @param {array} [parameters.serviceEndpointPolicyDefinitions] A collection of - * service endpoint policy definitions of the service endpoint policy. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.ServiceEndpointPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a service Endpoint Policies. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {object} parameters Parameters supplied to the create or update - * service endpoint policy operation. - * - * @param {array} [parameters.serviceEndpointPolicyDefinitions] A collection of - * service endpoint policy definitions of the service endpoint policy. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ServiceEndpointPolicy} - 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. - * - * {ServiceEndpointPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link ServiceEndpointPolicy} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.ServiceEndpointPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.ServiceEndpointPolicy, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.ServiceEndpointPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates service Endpoint Policies. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {object} parameters Parameters supplied to update service endpoint - * policy tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates service Endpoint Policies. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {object} parameters Parameters supplied to update service endpoint - * policy tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ServiceEndpointPolicy} - 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. - * - * {ServiceEndpointPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link ServiceEndpointPolicy} 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. - */ - beginUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the service endpoint policies in a subscription. - * - * @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 the service endpoint policies in a subscription. - * - * @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 {ServiceEndpointPolicyListResult} - 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. - * - * {ServiceEndpointPolicyListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServiceEndpointPolicyListResult} 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; - - - /** - * Gets all service endpoint Policies in a resource group. - * - * @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. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all service endpoint Policies in a resource group. - * - * @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 {ServiceEndpointPolicyListResult} - 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. - * - * {ServiceEndpointPolicyListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServiceEndpointPolicyListResult} 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. - */ - listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ServiceEndpointPolicyDefinitions - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface ServiceEndpointPolicyDefinitions { - - - /** - * Deletes the specified ServiceEndpoint policy definitions. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the Service Endpoint - * Policy. - * - * @param {string} serviceEndpointPolicyDefinitionName The name of the service - * endpoint policy definition. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified ServiceEndpoint policy definitions. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the Service Endpoint - * Policy. - * - * @param {string} serviceEndpointPolicyDefinitionName The name of the service - * endpoint policy definition. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get the specified service endpoint policy definitions from service endpoint - * policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy name. - * - * @param {string} serviceEndpointPolicyDefinitionName The name of the service - * endpoint policy definition name. - * - * @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, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get the specified service endpoint policy definitions from service endpoint - * policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy name. - * - * @param {string} serviceEndpointPolicyDefinitionName The name of the service - * endpoint policy definition name. - * - * @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 {ServiceEndpointPolicyDefinition} - 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. - * - * {ServiceEndpointPolicyDefinition} [result] - The deserialized result object if an error did not occur. - * See {@link ServiceEndpointPolicyDefinition} 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, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a service endpoint policy definition in the specified - * service endpoint policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {string} serviceEndpointPolicyDefinitionName The name of the service - * endpoint policy definition name. - * - * @param {object} serviceEndpointPolicyDefinitions Parameters supplied to the - * create or update service endpoint policy operation. - * - * @param {string} [serviceEndpointPolicyDefinitions.description] A description - * for this rule. Restricted to 140 chars. - * - * @param {string} [serviceEndpointPolicyDefinitions.service] service endpoint - * name. - * - * @param {array} [serviceEndpointPolicyDefinitions.serviceResources] A list of - * service resources. - * - * @param {string} [serviceEndpointPolicyDefinitions.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [serviceEndpointPolicyDefinitions.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [serviceEndpointPolicyDefinitions.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, serviceEndpointPolicyDefinitions: models.ServiceEndpointPolicyDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a service endpoint policy definition in the specified - * service endpoint policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {string} serviceEndpointPolicyDefinitionName The name of the service - * endpoint policy definition name. - * - * @param {object} serviceEndpointPolicyDefinitions Parameters supplied to the - * create or update service endpoint policy operation. - * - * @param {string} [serviceEndpointPolicyDefinitions.description] A description - * for this rule. Restricted to 140 chars. - * - * @param {string} [serviceEndpointPolicyDefinitions.service] service endpoint - * name. - * - * @param {array} [serviceEndpointPolicyDefinitions.serviceResources] A list of - * service resources. - * - * @param {string} [serviceEndpointPolicyDefinitions.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [serviceEndpointPolicyDefinitions.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [serviceEndpointPolicyDefinitions.id] Resource ID. - * - * @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 {ServiceEndpointPolicyDefinition} - 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. - * - * {ServiceEndpointPolicyDefinition} [result] - The deserialized result object if an error did not occur. - * See {@link ServiceEndpointPolicyDefinition} 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. - */ - createOrUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, serviceEndpointPolicyDefinitions: models.ServiceEndpointPolicyDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, serviceEndpointPolicyDefinitions: models.ServiceEndpointPolicyDefinition, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, serviceEndpointPolicyDefinitions: models.ServiceEndpointPolicyDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all service endpoint policy definitions in a service end point policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy name. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, serviceEndpointPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all service endpoint policy definitions in a service end point policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy name. - * - * @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 {ServiceEndpointPolicyDefinitionListResult} - 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. - * - * {ServiceEndpointPolicyDefinitionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServiceEndpointPolicyDefinitionListResult} - * 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. - */ - listByResourceGroup(resourceGroupName: string, serviceEndpointPolicyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, serviceEndpointPolicyName: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, serviceEndpointPolicyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified ServiceEndpoint policy definitions. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the Service Endpoint - * Policy. - * - * @param {string} serviceEndpointPolicyDefinitionName The name of the service - * endpoint policy definition. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified ServiceEndpoint policy definitions. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the Service Endpoint - * Policy. - * - * @param {string} serviceEndpointPolicyDefinitionName The name of the service - * endpoint policy definition. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a service endpoint policy definition in the specified - * service endpoint policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {string} serviceEndpointPolicyDefinitionName The name of the service - * endpoint policy definition name. - * - * @param {object} serviceEndpointPolicyDefinitions Parameters supplied to the - * create or update service endpoint policy operation. - * - * @param {string} [serviceEndpointPolicyDefinitions.description] A description - * for this rule. Restricted to 140 chars. - * - * @param {string} [serviceEndpointPolicyDefinitions.service] service endpoint - * name. - * - * @param {array} [serviceEndpointPolicyDefinitions.serviceResources] A list of - * service resources. - * - * @param {string} [serviceEndpointPolicyDefinitions.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [serviceEndpointPolicyDefinitions.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [serviceEndpointPolicyDefinitions.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, serviceEndpointPolicyDefinitions: models.ServiceEndpointPolicyDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a service endpoint policy definition in the specified - * service endpoint policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {string} serviceEndpointPolicyDefinitionName The name of the service - * endpoint policy definition name. - * - * @param {object} serviceEndpointPolicyDefinitions Parameters supplied to the - * create or update service endpoint policy operation. - * - * @param {string} [serviceEndpointPolicyDefinitions.description] A description - * for this rule. Restricted to 140 chars. - * - * @param {string} [serviceEndpointPolicyDefinitions.service] service endpoint - * name. - * - * @param {array} [serviceEndpointPolicyDefinitions.serviceResources] A list of - * service resources. - * - * @param {string} [serviceEndpointPolicyDefinitions.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [serviceEndpointPolicyDefinitions.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [serviceEndpointPolicyDefinitions.id] Resource ID. - * - * @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 {ServiceEndpointPolicyDefinition} - 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. - * - * {ServiceEndpointPolicyDefinition} [result] - The deserialized result object if an error did not occur. - * See {@link ServiceEndpointPolicyDefinition} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, serviceEndpointPolicyDefinitions: models.ServiceEndpointPolicyDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, serviceEndpointPolicyDefinitions: models.ServiceEndpointPolicyDefinition, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serviceEndpointPolicyName: string, serviceEndpointPolicyDefinitionName: string, serviceEndpointPolicyDefinitions: models.ServiceEndpointPolicyDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all service endpoint policy definitions in a service end point policy. - * - * @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. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all service endpoint policy definitions in a service end point policy. - * - * @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 {ServiceEndpointPolicyDefinitionListResult} - 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. - * - * {ServiceEndpointPolicyDefinitionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServiceEndpointPolicyDefinitionListResult} - * 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. - */ - listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Usages - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface Usages { - - - /** - * List network usages for a subscription. - * - * @param {string} location The location where resource usage is queried. - * - * @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(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * List network usages for a subscription. - * - * @param {string} location The location where resource usage is queried. - * - * @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 {UsagesListResult} - 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. - * - * {UsagesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link UsagesListResult} 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(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(location: string, callback: ServiceCallback): void; - list(location: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * List network usages for a subscription. - * - * @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>; - - /** - * List network usages for a subscription. - * - * @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 {UsagesListResult} - 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. - * - * {UsagesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link UsagesListResult} 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 - * VirtualNetworks - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface VirtualNetworks { - - - /** - * Deletes the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, virtualNetworkName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, virtualNetworkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified virtual network by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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, virtualNetworkName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified virtual network by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {VirtualNetwork} - 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. - * - * {VirtualNetwork} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetwork} 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, virtualNetworkName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, virtualNetworkName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, virtualNetworkName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a virtual network in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network operation - * - * @param {object} [parameters.addressSpace] The AddressSpace that contains an - * array of IP address ranges that can be used by subnets. - * - * @param {array} [parameters.addressSpace.addressPrefixes] A list of address - * blocks reserved for this virtual network in CIDR notation. - * - * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an - * array of DNS servers available to VMs deployed in the virtual network. - * - * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers - * IP addresses. - * - * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. - * - * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a - * Virtual Network. - * - * @param {string} [parameters.resourceGuid] The resourceGuid property of the - * Virtual Network resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS - * protection is enabled for all the protected resources in the virtual - * network. It requires a DDoS protection plan associated with the resource. - * - * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection - * is enabled for all the subnets in the virtual network. - * - * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan - * associated with the virtual network. - * - * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a virtual network in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network operation - * - * @param {object} [parameters.addressSpace] The AddressSpace that contains an - * array of IP address ranges that can be used by subnets. - * - * @param {array} [parameters.addressSpace.addressPrefixes] A list of address - * blocks reserved for this virtual network in CIDR notation. - * - * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an - * array of DNS servers available to VMs deployed in the virtual network. - * - * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers - * IP addresses. - * - * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. - * - * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a - * Virtual Network. - * - * @param {string} [parameters.resourceGuid] The resourceGuid property of the - * Virtual Network resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS - * protection is enabled for all the protected resources in the virtual - * network. It requires a DDoS protection plan associated with the resource. - * - * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection - * is enabled for all the subnets in the virtual network. - * - * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan - * associated with the virtual network. - * - * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetwork} - 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. - * - * {VirtualNetwork} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetwork} 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. - */ - createOrUpdate(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates a virtual network tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} parameters Parameters supplied to update virtual network - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a virtual network tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} parameters Parameters supplied to update virtual network - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetwork} - 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. - * - * {VirtualNetwork} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetwork} 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. - */ - updateTags(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all virtual networks in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all virtual networks in a subscription. - * - * @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 {VirtualNetworkListResult} - 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. - * - * {VirtualNetworkListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkListResult} 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. - */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all virtual networks in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all virtual networks in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {VirtualNetworkListResult} - 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. - * - * {VirtualNetworkListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkListResult} 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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Checks whether a private IP address is available for use. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} ipAddress The private IP address to be verified. - * - * @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. - */ - checkIPAddressAvailabilityWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, ipAddress: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Checks whether a private IP address is available for use. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} ipAddress The private IP address to be verified. - * - * @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 {IPAddressAvailabilityResult} - 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. - * - * {IPAddressAvailabilityResult} [result] - The deserialized result object if an error did not occur. - * See {@link IPAddressAvailabilityResult} 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. - */ - checkIPAddressAvailability(resourceGroupName: string, virtualNetworkName: string, ipAddress: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - checkIPAddressAvailability(resourceGroupName: string, virtualNetworkName: string, ipAddress: string, callback: ServiceCallback): void; - checkIPAddressAvailability(resourceGroupName: string, virtualNetworkName: string, ipAddress: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists usage stats. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @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. - */ - listUsageWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists usage stats. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @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 {VirtualNetworkListUsageResult} - 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. - * - * {VirtualNetworkListUsageResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkListUsageResult} 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. - */ - listUsage(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listUsage(resourceGroupName: string, virtualNetworkName: string, callback: ServiceCallback): void; - listUsage(resourceGroupName: string, virtualNetworkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a virtual network in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network operation - * - * @param {object} [parameters.addressSpace] The AddressSpace that contains an - * array of IP address ranges that can be used by subnets. - * - * @param {array} [parameters.addressSpace.addressPrefixes] A list of address - * blocks reserved for this virtual network in CIDR notation. - * - * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an - * array of DNS servers available to VMs deployed in the virtual network. - * - * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers - * IP addresses. - * - * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. - * - * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a - * Virtual Network. - * - * @param {string} [parameters.resourceGuid] The resourceGuid property of the - * Virtual Network resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS - * protection is enabled for all the protected resources in the virtual - * network. It requires a DDoS protection plan associated with the resource. - * - * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection - * is enabled for all the subnets in the virtual network. - * - * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan - * associated with the virtual network. - * - * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a virtual network in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network operation - * - * @param {object} [parameters.addressSpace] The AddressSpace that contains an - * array of IP address ranges that can be used by subnets. - * - * @param {array} [parameters.addressSpace.addressPrefixes] A list of address - * blocks reserved for this virtual network in CIDR notation. - * - * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an - * array of DNS servers available to VMs deployed in the virtual network. - * - * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers - * IP addresses. - * - * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. - * - * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a - * Virtual Network. - * - * @param {string} [parameters.resourceGuid] The resourceGuid property of the - * Virtual Network resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS - * protection is enabled for all the protected resources in the virtual - * network. It requires a DDoS protection plan associated with the resource. - * - * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection - * is enabled for all the subnets in the virtual network. - * - * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan - * associated with the virtual network. - * - * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetwork} - 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. - * - * {VirtualNetwork} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetwork} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, parameters: models.VirtualNetwork, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates a virtual network tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} parameters Parameters supplied to update virtual network - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a virtual network tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} parameters Parameters supplied to update virtual network - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetwork} - 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. - * - * {VirtualNetwork} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetwork} 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. - */ - beginUpdateTags(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, virtualNetworkName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all virtual networks in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all virtual networks in a subscription. - * - * @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 {VirtualNetworkListResult} - 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. - * - * {VirtualNetworkListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkListResult} 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. - */ - listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAllNext(nextPageLink: string, callback: ServiceCallback): void; - listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all virtual networks in a resource group. - * - * @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 virtual networks in a resource group. - * - * @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 {VirtualNetworkListResult} - 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. - * - * {VirtualNetworkListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkListResult} 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; - - - /** - * Lists usage stats. - * - * @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. - */ - listUsageNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists usage stats. - * - * @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 {VirtualNetworkListUsageResult} - 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. - * - * {VirtualNetworkListUsageResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkListUsageResult} 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. - */ - listUsageNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listUsageNext(nextPageLink: string, callback: ServiceCallback): void; - listUsageNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Subnets - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface Subnets { - - - /** - * Deletes the specified subnet. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified subnet. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, virtualNetworkName: string, subnetName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified subnet by virtual network and resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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, virtualNetworkName: string, subnetName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified subnet by virtual network and resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {Subnet} - 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. - * - * {Subnet} [result] - The deserialized result object if an error did not occur. - * See {@link Subnet} 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, virtualNetworkName: string, subnetName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, virtualNetworkName: string, subnetName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a subnet in the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. - * - * @param {object} subnetParameters Parameters supplied to the create or update - * subnet operation. - * - * @param {string} [subnetParameters.addressPrefix] The address prefix for the - * subnet. - * - * @param {array} [subnetParameters.addressPrefixes] List of address prefixes - * for the subnet. - * - * @param {object} [subnetParameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * - * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A - * collection of security rules of the network security group. - * - * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The - * resource GUID property of the network security group resource. - * - * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. - * - * @param {string} [subnetParameters.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. - * - * @param {object} [subnetParameters.routeTable] The reference of the - * RouteTable resource. - * - * @param {array} [subnetParameters.routeTable.routes] Collection of routes - * contained within a route table. - * - * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} [subnetParameters.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [subnetParameters.routeTable.id] Resource ID. - * - * @param {string} [subnetParameters.routeTable.location] Resource location. - * - * @param {object} [subnetParameters.routeTable.tags] Resource tags. - * - * @param {array} [subnetParameters.serviceEndpoints] An array of service - * endpoints. - * - * @param {array} [subnetParameters.serviceEndpointPolicies] An array of - * service endpoint policies. - * - * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * - * @param {array} [subnetParameters.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * - * @param {array} [subnetParameters.delegations] Gets an array of references to - * the delegations on the subnet. - * - * @param {string} [subnetParameters.provisioningState] The provisioning state - * of the resource. - * - * @param {string} [subnetParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [subnetParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [subnetParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a subnet in the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. - * - * @param {object} subnetParameters Parameters supplied to the create or update - * subnet operation. - * - * @param {string} [subnetParameters.addressPrefix] The address prefix for the - * subnet. - * - * @param {array} [subnetParameters.addressPrefixes] List of address prefixes - * for the subnet. - * - * @param {object} [subnetParameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * - * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A - * collection of security rules of the network security group. - * - * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The - * resource GUID property of the network security group resource. - * - * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. - * - * @param {string} [subnetParameters.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. - * - * @param {object} [subnetParameters.routeTable] The reference of the - * RouteTable resource. - * - * @param {array} [subnetParameters.routeTable.routes] Collection of routes - * contained within a route table. - * - * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} [subnetParameters.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [subnetParameters.routeTable.id] Resource ID. - * - * @param {string} [subnetParameters.routeTable.location] Resource location. - * - * @param {object} [subnetParameters.routeTable.tags] Resource tags. - * - * @param {array} [subnetParameters.serviceEndpoints] An array of service - * endpoints. - * - * @param {array} [subnetParameters.serviceEndpointPolicies] An array of - * service endpoint policies. - * - * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * - * @param {array} [subnetParameters.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * - * @param {array} [subnetParameters.delegations] Gets an array of references to - * the delegations on the subnet. - * - * @param {string} [subnetParameters.provisioningState] The provisioning state - * of the resource. - * - * @param {string} [subnetParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [subnetParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [subnetParameters.id] Resource ID. - * - * @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 {Subnet} - 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. - * - * {Subnet} [result] - The deserialized result object if an error did not occur. - * See {@link Subnet} 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. - */ - createOrUpdate(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all subnets in a virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @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, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all subnets in a virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @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 {SubnetListResult} - 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. - * - * {SubnetListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SubnetListResult} 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, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, virtualNetworkName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, virtualNetworkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified subnet. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified subnet. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, subnetName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, subnetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a subnet in the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. - * - * @param {object} subnetParameters Parameters supplied to the create or update - * subnet operation. - * - * @param {string} [subnetParameters.addressPrefix] The address prefix for the - * subnet. - * - * @param {array} [subnetParameters.addressPrefixes] List of address prefixes - * for the subnet. - * - * @param {object} [subnetParameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * - * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A - * collection of security rules of the network security group. - * - * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The - * resource GUID property of the network security group resource. - * - * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. - * - * @param {string} [subnetParameters.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. - * - * @param {object} [subnetParameters.routeTable] The reference of the - * RouteTable resource. - * - * @param {array} [subnetParameters.routeTable.routes] Collection of routes - * contained within a route table. - * - * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} [subnetParameters.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [subnetParameters.routeTable.id] Resource ID. - * - * @param {string} [subnetParameters.routeTable.location] Resource location. - * - * @param {object} [subnetParameters.routeTable.tags] Resource tags. - * - * @param {array} [subnetParameters.serviceEndpoints] An array of service - * endpoints. - * - * @param {array} [subnetParameters.serviceEndpointPolicies] An array of - * service endpoint policies. - * - * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * - * @param {array} [subnetParameters.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * - * @param {array} [subnetParameters.delegations] Gets an array of references to - * the delegations on the subnet. - * - * @param {string} [subnetParameters.provisioningState] The provisioning state - * of the resource. - * - * @param {string} [subnetParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [subnetParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [subnetParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a subnet in the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. - * - * @param {object} subnetParameters Parameters supplied to the create or update - * subnet operation. - * - * @param {string} [subnetParameters.addressPrefix] The address prefix for the - * subnet. - * - * @param {array} [subnetParameters.addressPrefixes] List of address prefixes - * for the subnet. - * - * @param {object} [subnetParameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * - * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A - * collection of security rules of the network security group. - * - * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The - * resource GUID property of the network security group resource. - * - * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. - * - * @param {string} [subnetParameters.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. - * - * @param {object} [subnetParameters.routeTable] The reference of the - * RouteTable resource. - * - * @param {array} [subnetParameters.routeTable.routes] Collection of routes - * contained within a route table. - * - * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} [subnetParameters.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [subnetParameters.routeTable.id] Resource ID. - * - * @param {string} [subnetParameters.routeTable.location] Resource location. - * - * @param {object} [subnetParameters.routeTable.tags] Resource tags. - * - * @param {array} [subnetParameters.serviceEndpoints] An array of service - * endpoints. - * - * @param {array} [subnetParameters.serviceEndpointPolicies] An array of - * service endpoint policies. - * - * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * - * @param {array} [subnetParameters.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * - * @param {array} [subnetParameters.delegations] Gets an array of references to - * the delegations on the subnet. - * - * @param {string} [subnetParameters.provisioningState] The provisioning state - * of the resource. - * - * @param {string} [subnetParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [subnetParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [subnetParameters.id] Resource ID. - * - * @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 {Subnet} - 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. - * - * {Subnet} [result] - The deserialized result object if an error did not occur. - * See {@link Subnet} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, subnetName: string, subnetParameters: models.Subnet, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all subnets in a virtual network. - * - * @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 subnets in a virtual network. - * - * @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 {SubnetListResult} - 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. - * - * {SubnetListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SubnetListResult} 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 - * VirtualNetworkPeerings - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface VirtualNetworkPeerings { - - - /** - * Deletes the specified virtual network peering. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} virtualNetworkPeeringName The name of the virtual network - * 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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified virtual network peering. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} virtualNetworkPeeringName The name of the virtual network - * 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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified virtual network peering. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} virtualNetworkPeeringName The name of the virtual network - * 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. - */ - getWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified virtual network peering. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} virtualNetworkPeeringName The name of the virtual network - * 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 {VirtualNetworkPeering} - 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. - * - * {VirtualNetworkPeering} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkPeering} 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, virtualNetworkName: string, virtualNetworkPeeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a peering in the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} virtualNetworkPeeringName The name of the peering. - * - * @param {object} virtualNetworkPeeringParameters Parameters supplied to the - * create or update virtual network peering operation. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] - * Whether the VMs in the linked virtual network space would be able to access - * all the VMs in local Virtual network space. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] - * Whether the forwarded traffic from the VMs in the remote virtual network - * will be allowed/disallowed. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If - * gateway links can be used in remote virtual networking to link to this - * virtual network. - * - * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If - * remote gateways can be used on this virtual network. If the flag is set to - * true, and allowGatewayTransit on remote peering is also true, virtual - * network will use gateways of remote virtual network for transit. Only one - * peering can have this flag set to true. This flag cannot be set if virtual - * network already has a gateway. - * - * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The - * reference of the remote virtual network. The remote virtual network can be - * in the same or different region (preview). See here to register for the - * preview and learn more - * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). - * - * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] - * Resource ID. - * - * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The - * reference of the remote virtual network address space. - * - * @param {array} - * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of - * the virtual network peering. Possible values are 'Initiated', 'Connected', - * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', - * 'Disconnected' - * - * @param {string} [virtualNetworkPeeringParameters.provisioningState] The - * provisioning state of the resource. - * - * @param {string} [virtualNetworkPeeringParameters.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a peering in the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} virtualNetworkPeeringName The name of the peering. - * - * @param {object} virtualNetworkPeeringParameters Parameters supplied to the - * create or update virtual network peering operation. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] - * Whether the VMs in the linked virtual network space would be able to access - * all the VMs in local Virtual network space. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] - * Whether the forwarded traffic from the VMs in the remote virtual network - * will be allowed/disallowed. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If - * gateway links can be used in remote virtual networking to link to this - * virtual network. - * - * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If - * remote gateways can be used on this virtual network. If the flag is set to - * true, and allowGatewayTransit on remote peering is also true, virtual - * network will use gateways of remote virtual network for transit. Only one - * peering can have this flag set to true. This flag cannot be set if virtual - * network already has a gateway. - * - * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The - * reference of the remote virtual network. The remote virtual network can be - * in the same or different region (preview). See here to register for the - * preview and learn more - * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). - * - * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] - * Resource ID. - * - * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The - * reference of the remote virtual network address space. - * - * @param {array} - * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of - * the virtual network peering. Possible values are 'Initiated', 'Connected', - * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', - * 'Disconnected' - * - * @param {string} [virtualNetworkPeeringParameters.provisioningState] The - * provisioning state of the resource. - * - * @param {string} [virtualNetworkPeeringParameters.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. - * - * @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 {VirtualNetworkPeering} - 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. - * - * {VirtualNetworkPeering} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkPeering} 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. - */ - createOrUpdate(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all virtual network peerings in a virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @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, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all virtual network peerings in a virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @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 {VirtualNetworkPeeringListResult} - 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. - * - * {VirtualNetworkPeeringListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkPeeringListResult} 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, virtualNetworkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, virtualNetworkName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, virtualNetworkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified virtual network peering. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} virtualNetworkPeeringName The name of the virtual network - * 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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified virtual network peering. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} virtualNetworkPeeringName The name of the virtual network - * 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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a peering in the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} virtualNetworkPeeringName The name of the peering. - * - * @param {object} virtualNetworkPeeringParameters Parameters supplied to the - * create or update virtual network peering operation. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] - * Whether the VMs in the linked virtual network space would be able to access - * all the VMs in local Virtual network space. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] - * Whether the forwarded traffic from the VMs in the remote virtual network - * will be allowed/disallowed. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If - * gateway links can be used in remote virtual networking to link to this - * virtual network. - * - * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If - * remote gateways can be used on this virtual network. If the flag is set to - * true, and allowGatewayTransit on remote peering is also true, virtual - * network will use gateways of remote virtual network for transit. Only one - * peering can have this flag set to true. This flag cannot be set if virtual - * network already has a gateway. - * - * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The - * reference of the remote virtual network. The remote virtual network can be - * in the same or different region (preview). See here to register for the - * preview and learn more - * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). - * - * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] - * Resource ID. - * - * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The - * reference of the remote virtual network address space. - * - * @param {array} - * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of - * the virtual network peering. Possible values are 'Initiated', 'Connected', - * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', - * 'Disconnected' - * - * @param {string} [virtualNetworkPeeringParameters.provisioningState] The - * provisioning state of the resource. - * - * @param {string} [virtualNetworkPeeringParameters.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a peering in the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} virtualNetworkPeeringName The name of the peering. - * - * @param {object} virtualNetworkPeeringParameters Parameters supplied to the - * create or update virtual network peering operation. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] - * Whether the VMs in the linked virtual network space would be able to access - * all the VMs in local Virtual network space. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] - * Whether the forwarded traffic from the VMs in the remote virtual network - * will be allowed/disallowed. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If - * gateway links can be used in remote virtual networking to link to this - * virtual network. - * - * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If - * remote gateways can be used on this virtual network. If the flag is set to - * true, and allowGatewayTransit on remote peering is also true, virtual - * network will use gateways of remote virtual network for transit. Only one - * peering can have this flag set to true. This flag cannot be set if virtual - * network already has a gateway. - * - * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The - * reference of the remote virtual network. The remote virtual network can be - * in the same or different region (preview). See here to register for the - * preview and learn more - * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). - * - * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] - * Resource ID. - * - * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The - * reference of the remote virtual network address space. - * - * @param {array} - * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of - * the virtual network peering. Possible values are 'Initiated', 'Connected', - * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', - * 'Disconnected' - * - * @param {string} [virtualNetworkPeeringParameters.provisioningState] The - * provisioning state of the resource. - * - * @param {string} [virtualNetworkPeeringParameters.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. - * - * @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 {VirtualNetworkPeering} - 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. - * - * {VirtualNetworkPeering} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkPeering} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkName: string, virtualNetworkPeeringName: string, virtualNetworkPeeringParameters: models.VirtualNetworkPeering, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all virtual network peerings in a virtual network. - * - * @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 virtual network peerings in a virtual network. - * - * @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 {VirtualNetworkPeeringListResult} - 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. - * - * {VirtualNetworkPeeringListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkPeeringListResult} 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 - * VirtualNetworkGateways - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface VirtualNetworkGateways { - - - /** - * Creates or updates a virtual network gateway in the specified resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to create or update virtual - * network gateway operation. - * - * @param {array} [parameters.ipConfigurations] IP configurations for virtual - * network gateway. - * - * @param {string} [parameters.gatewayType] The type of this virtual network - * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values - * include: 'Vpn', 'ExpressRoute' - * - * @param {string} [parameters.vpnType] The type of this virtual network - * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible - * values include: 'PolicyBased', 'RouteBased' - * - * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this - * virtual network gateway or not. - * - * @param {boolean} [parameters.activeActive] ActiveActive flag - * - * @param {object} [parameters.gatewayDefaultSite] The reference of the - * LocalNetworkGateway resource which represents local network site having - * default routes. Assign Null value in case of removing existing default site - * setting. - * - * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. - * - * @param {object} [parameters.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. - * - * @param {string} [parameters.sku.name] Gateway SKU name. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * - * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * - * @param {number} [parameters.sku.capacity] The capacity. - * - * @param {object} [parameters.vpnClientConfiguration] The reference of the - * VpnClientConfiguration resource which represents the P2S VpnClient - * configurations. - * - * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The - * reference of the address space resource which represents Address space for - * P2S VpnClient. - * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. - * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. - * - * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The - * radius server address property of the VirtualNetworkGateway resource for vpn - * client connection. - * - * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The - * radius secret property of the VirtualNetworkGateway resource for vpn client - * connection. - * - * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP - * speaker settings. - * - * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. - * - * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.bgpSettings.peerWeight] The weight added to - * routes learned from this BGP speaker. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGateway resource. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a virtual network gateway in the specified resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to create or update virtual - * network gateway operation. - * - * @param {array} [parameters.ipConfigurations] IP configurations for virtual - * network gateway. - * - * @param {string} [parameters.gatewayType] The type of this virtual network - * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values - * include: 'Vpn', 'ExpressRoute' - * - * @param {string} [parameters.vpnType] The type of this virtual network - * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible - * values include: 'PolicyBased', 'RouteBased' - * - * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this - * virtual network gateway or not. - * - * @param {boolean} [parameters.activeActive] ActiveActive flag - * - * @param {object} [parameters.gatewayDefaultSite] The reference of the - * LocalNetworkGateway resource which represents local network site having - * default routes. Assign Null value in case of removing existing default site - * setting. - * - * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. - * - * @param {object} [parameters.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. - * - * @param {string} [parameters.sku.name] Gateway SKU name. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * - * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * - * @param {number} [parameters.sku.capacity] The capacity. - * - * @param {object} [parameters.vpnClientConfiguration] The reference of the - * VpnClientConfiguration resource which represents the P2S VpnClient - * configurations. - * - * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The - * reference of the address space resource which represents Address space for - * P2S VpnClient. - * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. - * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. - * - * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The - * radius server address property of the VirtualNetworkGateway resource for vpn - * client connection. - * - * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The - * radius secret property of the VirtualNetworkGateway resource for vpn client - * connection. - * - * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP - * speaker settings. - * - * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. - * - * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.bgpSettings.peerWeight] The weight added to - * routes learned from this BGP speaker. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGateway resource. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetworkGateway} - 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. - * - * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGateway} 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. - */ - createOrUpdate(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified virtual network gateway by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified virtual network gateway by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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 {VirtualNetworkGateway} - 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. - * - * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGateway} 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, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified virtual network gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified virtual network gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates a virtual network gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to update virtual network - * gateway tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a virtual network gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to update virtual network - * gateway tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetworkGateway} - 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. - * - * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGateway} 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. - */ - updateTags(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all virtual network gateways by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all virtual network gateways by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {VirtualNetworkGatewayListResult} - 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. - * - * {VirtualNetworkGatewayListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGatewayListResult} 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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the connections in a virtual network gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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. - */ - listConnectionsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the connections in a virtual network gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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 {VirtualNetworkGatewayListConnectionsResult} - 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. - * - * {VirtualNetworkGatewayListConnectionsResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGatewayListConnectionsResult} - * 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. - */ - listConnections(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listConnections(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - listConnections(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Resets the primary of the virtual network gateway in the specified resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.gatewayVip] Virtual network gateway vip address - * supplied to the begin reset of the active-active feature enabled gateway. - * - * @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. - */ - resetWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { gatewayVip? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Resets the primary of the virtual network gateway in the specified resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.gatewayVip] Virtual network gateway vip address - * supplied to the begin reset of the active-active feature enabled gateway. - * - * @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 {VirtualNetworkGateway} - 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. - * - * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGateway} 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. - */ - reset(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { gatewayVip? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - reset(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - reset(resourceGroupName: string, virtualNetworkGatewayName: string, options: { gatewayVip? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Resets the VPN client shared key of the virtual network gateway in the - * specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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. - */ - resetVpnClientSharedKeyWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Resets the VPN client shared key of the virtual network gateway in the - * specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - resetVpnClientSharedKey(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - resetVpnClientSharedKey(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - resetVpnClientSharedKey(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Generates VPN client package for P2S client of the virtual network gateway - * in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. - * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. - * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. - * - * @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. - */ - generatevpnclientpackageWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Generates VPN client package for P2S client of the virtual network gateway - * in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. - * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. - * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. - * - * @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 {String} - 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. - * - * {String} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - generatevpnclientpackage(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - generatevpnclientpackage(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, callback: ServiceCallback): void; - generatevpnclientpackage(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the - * specified resource group. Used for IKEV2 and radius based authentication. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. - * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. - * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. - * - * @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. - */ - generateVpnProfileWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the - * specified resource group. Used for IKEV2 and radius based authentication. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. - * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. - * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. - * - * @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 {String} - 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. - * - * {String} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - generateVpnProfile(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - generateVpnProfile(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, callback: ServiceCallback): void; - generateVpnProfile(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway - * in the specified resource group. The profile needs to be generated first - * using generateVpnProfile. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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. - */ - getVpnProfilePackageUrlWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway - * in the specified resource group. The profile needs to be generated first - * using generateVpnProfile. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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 {String} - 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. - * - * {String} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - getVpnProfilePackageUrl(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getVpnProfilePackageUrl(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - getVpnProfilePackageUrl(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.peer] The IP address of the peer to retrieve the - * status of. - * - * @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. - */ - getBgpPeerStatusWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { peer? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.peer] The IP address of the peer to retrieve the - * status of. - * - * @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 {BgpPeerStatusListResult} - 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. - * - * {BgpPeerStatusListResult} [result] - The deserialized result object if an error did not occur. - * See {@link BgpPeerStatusListResult} 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. - */ - getBgpPeerStatus(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { peer? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - getBgpPeerStatus(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - getBgpPeerStatus(resourceGroupName: string, virtualNetworkGatewayName: string, options: { peer? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets a xml format representation for supported vpn devices. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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. - */ - supportedVpnDevicesWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a xml format representation for supported vpn devices. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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 {String} - 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. - * - * {String} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - supportedVpnDevices(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - supportedVpnDevices(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - supportedVpnDevices(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * This operation retrieves a list of routes the virtual network gateway has - * learned, including routes learned from BGP peers. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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. - */ - getLearnedRoutesWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * This operation retrieves a list of routes the virtual network gateway has - * learned, including routes learned from BGP peers. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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 {GatewayRouteListResult} - 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. - * - * {GatewayRouteListResult} [result] - The deserialized result object if an error did not occur. - * See {@link GatewayRouteListResult} 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. - */ - getLearnedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getLearnedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - getLearnedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * This operation retrieves a list of routes the virtual network gateway is - * advertising to the specified peer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {string} peer The IP address of the peer - * - * @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. - */ - getAdvertisedRoutesWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * This operation retrieves a list of routes the virtual network gateway is - * advertising to the specified peer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {string} peer The IP address of the peer - * - * @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 {GatewayRouteListResult} - 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. - * - * {GatewayRouteListResult} [result] - The deserialized result object if an error did not occur. - * See {@link GatewayRouteListResult} 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. - */ - getAdvertisedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getAdvertisedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, callback: ServiceCallback): void; - getAdvertisedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy - * for P2S client of virtual network gateway in the specified resource group - * through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set - * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation - * through Network resource provider. - * - * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for - * P2S client. - * - * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) payload size in KB for - * P2S client.. - * - * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption - * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', - * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' - * - * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity - * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'GCMAES128', 'GCMAES192', 'GCMAES256' - * - * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption - * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', - * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' - * - * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity - * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'SHA384', 'GCMAES256', 'GCMAES128' - * - * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase - * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', - * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' - * - * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE - * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', - * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' - * - * @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. - */ - setVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy - * for P2S client of virtual network gateway in the specified resource group - * through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set - * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation - * through Network resource provider. - * - * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for - * P2S client. - * - * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) payload size in KB for - * P2S client.. - * - * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption - * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', - * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' - * - * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity - * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'GCMAES128', 'GCMAES192', 'GCMAES256' - * - * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption - * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', - * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' - * - * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity - * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'SHA384', 'GCMAES256', 'GCMAES128' - * - * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase - * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', - * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' - * - * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE - * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', - * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' - * - * @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 {VpnClientIPsecParameters} - 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. - * - * {VpnClientIPsecParameters} [result] - The deserialized result object if an error did not occur. - * See {@link VpnClientIPsecParameters} 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. - */ - setVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - setVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, callback: ServiceCallback): void; - setVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * The Get VpnclientIpsecParameters operation retrieves information about the - * vpnclient ipsec policy for P2S client of virtual network gateway in the - * specified resource group through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The virtual network gateway name. - * - * @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. - */ - getVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * The Get VpnclientIpsecParameters operation retrieves information about the - * vpnclient ipsec policy for P2S client of virtual network gateway in the - * specified resource group through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The virtual network gateway name. - * - * @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 {VpnClientIPsecParameters} - 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. - * - * {VpnClientIPsecParameters} [result] - The deserialized result object if an error did not occur. - * See {@link VpnClientIPsecParameters} 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. - */ - getVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - getVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets a xml format representation for vpn device configuration script. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection for which the configuration script is generated. - * - * @param {object} parameters Parameters supplied to the generate vpn device - * script operation. - * - * @param {string} [parameters.vendor] The vendor for the vpn device. - * - * @param {string} [parameters.deviceFamily] The device family for the vpn - * device. - * - * @param {string} [parameters.firmwareVersion] The firmware version for the - * vpn device. - * - * @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. - */ - vpnDeviceConfigurationScriptWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VpnDeviceScriptParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a xml format representation for vpn device configuration script. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection for which the configuration script is generated. - * - * @param {object} parameters Parameters supplied to the generate vpn device - * script operation. - * - * @param {string} [parameters.vendor] The vendor for the vpn device. - * - * @param {string} [parameters.deviceFamily] The device family for the vpn - * device. - * - * @param {string} [parameters.firmwareVersion] The firmware version for the - * vpn device. - * - * @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 {String} - 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. - * - * {String} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - vpnDeviceConfigurationScript(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VpnDeviceScriptParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - vpnDeviceConfigurationScript(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VpnDeviceScriptParameters, callback: ServiceCallback): void; - vpnDeviceConfigurationScript(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VpnDeviceScriptParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a virtual network gateway in the specified resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to create or update virtual - * network gateway operation. - * - * @param {array} [parameters.ipConfigurations] IP configurations for virtual - * network gateway. - * - * @param {string} [parameters.gatewayType] The type of this virtual network - * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values - * include: 'Vpn', 'ExpressRoute' - * - * @param {string} [parameters.vpnType] The type of this virtual network - * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible - * values include: 'PolicyBased', 'RouteBased' - * - * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this - * virtual network gateway or not. - * - * @param {boolean} [parameters.activeActive] ActiveActive flag - * - * @param {object} [parameters.gatewayDefaultSite] The reference of the - * LocalNetworkGateway resource which represents local network site having - * default routes. Assign Null value in case of removing existing default site - * setting. - * - * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. - * - * @param {object} [parameters.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. - * - * @param {string} [parameters.sku.name] Gateway SKU name. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * - * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * - * @param {number} [parameters.sku.capacity] The capacity. - * - * @param {object} [parameters.vpnClientConfiguration] The reference of the - * VpnClientConfiguration resource which represents the P2S VpnClient - * configurations. - * - * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The - * reference of the address space resource which represents Address space for - * P2S VpnClient. - * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. - * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. - * - * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The - * radius server address property of the VirtualNetworkGateway resource for vpn - * client connection. - * - * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The - * radius secret property of the VirtualNetworkGateway resource for vpn client - * connection. - * - * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP - * speaker settings. - * - * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. - * - * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.bgpSettings.peerWeight] The weight added to - * routes learned from this BGP speaker. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGateway resource. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a virtual network gateway in the specified resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to create or update virtual - * network gateway operation. - * - * @param {array} [parameters.ipConfigurations] IP configurations for virtual - * network gateway. - * - * @param {string} [parameters.gatewayType] The type of this virtual network - * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values - * include: 'Vpn', 'ExpressRoute' - * - * @param {string} [parameters.vpnType] The type of this virtual network - * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible - * values include: 'PolicyBased', 'RouteBased' - * - * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this - * virtual network gateway or not. - * - * @param {boolean} [parameters.activeActive] ActiveActive flag - * - * @param {object} [parameters.gatewayDefaultSite] The reference of the - * LocalNetworkGateway resource which represents local network site having - * default routes. Assign Null value in case of removing existing default site - * setting. - * - * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. - * - * @param {object} [parameters.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. - * - * @param {string} [parameters.sku.name] Gateway SKU name. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * - * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * - * @param {number} [parameters.sku.capacity] The capacity. - * - * @param {object} [parameters.vpnClientConfiguration] The reference of the - * VpnClientConfiguration resource which represents the P2S VpnClient - * configurations. - * - * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The - * reference of the address space resource which represents Address space for - * P2S VpnClient. - * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. - * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. - * - * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The - * radius server address property of the VirtualNetworkGateway resource for vpn - * client connection. - * - * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The - * radius secret property of the VirtualNetworkGateway resource for vpn client - * connection. - * - * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP - * speaker settings. - * - * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. - * - * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.bgpSettings.peerWeight] The weight added to - * routes learned from this BGP speaker. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGateway resource. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetworkGateway} - 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. - * - * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGateway} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VirtualNetworkGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified virtual network gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified virtual network gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates a virtual network gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to update virtual network - * gateway tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a virtual network gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to update virtual network - * gateway tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetworkGateway} - 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. - * - * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGateway} 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. - */ - beginUpdateTags(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Resets the primary of the virtual network gateway in the specified resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.gatewayVip] Virtual network gateway vip address - * supplied to the begin reset of the active-active feature enabled gateway. - * - * @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. - */ - beginResetWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { gatewayVip? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Resets the primary of the virtual network gateway in the specified resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.gatewayVip] Virtual network gateway vip address - * supplied to the begin reset of the active-active feature enabled gateway. - * - * @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 {VirtualNetworkGateway} - 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. - * - * {VirtualNetworkGateway} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGateway} 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. - */ - beginReset(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { gatewayVip? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - beginReset(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - beginReset(resourceGroupName: string, virtualNetworkGatewayName: string, options: { gatewayVip? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Resets the VPN client shared key of the virtual network gateway in the - * specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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. - */ - beginResetVpnClientSharedKeyWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Resets the VPN client shared key of the virtual network gateway in the - * specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginResetVpnClientSharedKey(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginResetVpnClientSharedKey(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - beginResetVpnClientSharedKey(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Generates VPN client package for P2S client of the virtual network gateway - * in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. - * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. - * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. - * - * @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. - */ - beginGeneratevpnclientpackageWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Generates VPN client package for P2S client of the virtual network gateway - * in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. - * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. - * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. - * - * @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 {String} - 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. - * - * {String} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginGeneratevpnclientpackage(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGeneratevpnclientpackage(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, callback: ServiceCallback): void; - beginGeneratevpnclientpackage(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the - * specified resource group. Used for IKEV2 and radius based authentication. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. - * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. - * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. - * - * @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. - */ - beginGenerateVpnProfileWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the - * specified resource group. Used for IKEV2 and radius based authentication. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. - * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. - * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. - * - * @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 {String} - 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. - * - * {String} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginGenerateVpnProfile(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGenerateVpnProfile(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, callback: ServiceCallback): void; - beginGenerateVpnProfile(resourceGroupName: string, virtualNetworkGatewayName: string, parameters: models.VpnClientParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway - * in the specified resource group. The profile needs to be generated first - * using generateVpnProfile. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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. - */ - beginGetVpnProfilePackageUrlWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway - * in the specified resource group. The profile needs to be generated first - * using generateVpnProfile. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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 {String} - 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. - * - * {String} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginGetVpnProfilePackageUrl(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGetVpnProfilePackageUrl(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - beginGetVpnProfilePackageUrl(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.peer] The IP address of the peer to retrieve the - * status of. - * - * @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. - */ - beginGetBgpPeerStatusWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { peer? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.peer] The IP address of the peer to retrieve the - * status of. - * - * @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 {BgpPeerStatusListResult} - 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. - * - * {BgpPeerStatusListResult} [result] - The deserialized result object if an error did not occur. - * See {@link BgpPeerStatusListResult} 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. - */ - beginGetBgpPeerStatus(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { peer? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - beginGetBgpPeerStatus(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - beginGetBgpPeerStatus(resourceGroupName: string, virtualNetworkGatewayName: string, options: { peer? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * This operation retrieves a list of routes the virtual network gateway has - * learned, including routes learned from BGP peers. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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. - */ - beginGetLearnedRoutesWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * This operation retrieves a list of routes the virtual network gateway has - * learned, including routes learned from BGP peers. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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 {GatewayRouteListResult} - 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. - * - * {GatewayRouteListResult} [result] - The deserialized result object if an error did not occur. - * See {@link GatewayRouteListResult} 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. - */ - beginGetLearnedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGetLearnedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - beginGetLearnedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * This operation retrieves a list of routes the virtual network gateway is - * advertising to the specified peer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {string} peer The IP address of the peer - * - * @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. - */ - beginGetAdvertisedRoutesWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * This operation retrieves a list of routes the virtual network gateway is - * advertising to the specified peer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {string} peer The IP address of the peer - * - * @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 {GatewayRouteListResult} - 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. - * - * {GatewayRouteListResult} [result] - The deserialized result object if an error did not occur. - * See {@link GatewayRouteListResult} 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. - */ - beginGetAdvertisedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGetAdvertisedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, callback: ServiceCallback): void; - beginGetAdvertisedRoutes(resourceGroupName: string, virtualNetworkGatewayName: string, peer: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy - * for P2S client of virtual network gateway in the specified resource group - * through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set - * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation - * through Network resource provider. - * - * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for - * P2S client. - * - * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) payload size in KB for - * P2S client.. - * - * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption - * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', - * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' - * - * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity - * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'GCMAES128', 'GCMAES192', 'GCMAES256' - * - * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption - * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', - * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' - * - * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity - * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'SHA384', 'GCMAES256', 'GCMAES128' - * - * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase - * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', - * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' - * - * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE - * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', - * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' - * - * @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. - */ - beginSetVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy - * for P2S client of virtual network gateway in the specified resource group - * through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set - * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation - * through Network resource provider. - * - * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for - * P2S client. - * - * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) payload size in KB for - * P2S client.. - * - * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption - * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', - * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' - * - * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity - * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'GCMAES128', 'GCMAES192', 'GCMAES256' - * - * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption - * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', - * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' - * - * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity - * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'SHA384', 'GCMAES256', 'GCMAES128' - * - * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase - * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', - * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' - * - * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE - * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', - * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' - * - * @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 {VpnClientIPsecParameters} - 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. - * - * {VpnClientIPsecParameters} [result] - The deserialized result object if an error did not occur. - * See {@link VpnClientIPsecParameters} 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. - */ - beginSetVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginSetVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, callback: ServiceCallback): void; - beginSetVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, vpnclientIpsecParams: models.VpnClientIPsecParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * The Get VpnclientIpsecParameters operation retrieves information about the - * vpnclient ipsec policy for P2S client of virtual network gateway in the - * specified resource group through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The virtual network gateway name. - * - * @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. - */ - beginGetVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * The Get VpnclientIpsecParameters operation retrieves information about the - * vpnclient ipsec policy for P2S client of virtual network gateway in the - * specified resource group through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The virtual network gateway name. - * - * @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 {VpnClientIPsecParameters} - 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. - * - * {VpnClientIPsecParameters} [result] - The deserialized result object if an error did not occur. - * See {@link VpnClientIPsecParameters} 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. - */ - beginGetVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGetVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, callback: ServiceCallback): void; - beginGetVpnclientIpsecParameters(resourceGroupName: string, virtualNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all virtual network gateways by resource group. - * - * @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 virtual network gateways by resource group. - * - * @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 {VirtualNetworkGatewayListResult} - 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. - * - * {VirtualNetworkGatewayListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGatewayListResult} 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; - - - /** - * Gets all the connections in a virtual network gateway. - * - * @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. - */ - listConnectionsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the connections in a virtual network gateway. - * - * @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 {VirtualNetworkGatewayListConnectionsResult} - 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. - * - * {VirtualNetworkGatewayListConnectionsResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGatewayListConnectionsResult} - * 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. - */ - listConnectionsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listConnectionsNext(nextPageLink: string, callback: ServiceCallback): void; - listConnectionsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * VirtualNetworkGatewayConnections - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface VirtualNetworkGatewayConnections { - - - /** - * Creates or updates a virtual network gateway connection in the specified - * resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network gateway connection operation. - * - * @param {string} [parameters.authorizationKey] The authorizationKey. - * - * @param {object} parameters.virtualNetworkGateway1 The reference to virtual - * network gateway resource. - * - * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual - * network gateway resource. - * - * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP - * configurations for virtual network gateway. - * - * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of - * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. - * Possible values include: 'Vpn', 'ExpressRoute' - * - * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this - * virtual network gateway. Possible values are: 'PolicyBased' and - * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' - * - * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP - * is enabled for this virtual network gateway or not. - * - * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] - * ActiveActive flag - * - * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The - * reference of the LocalNetworkGateway resource which represents local network - * site having default routes. Assign Null value in case of removing existing - * default site setting. - * - * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. - * - * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU - * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * - * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU - * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * - * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The - * capacity. - * - * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] - * The reference of the VpnClientConfiguration resource which represents the - * P2S VpnClient configurations. - * - * @param {object} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] - * The reference of the address space resource which represents Address space - * for P2S VpnClient. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. - * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] - * The radius server address property of the VirtualNetworkGateway resource for - * vpn client connection. - * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] - * The radius secret property of the VirtualNetworkGateway resource for vpn - * client connection. - * - * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual - * network gateway's BGP speaker settings. - * - * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The - * resource GUID property of the VirtualNetworkGateway resource. - * - * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. - * - * @param {string} [parameters.virtualNetworkGateway2.location] Resource - * location. - * - * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. - * - * @param {object} [parameters.localNetworkGateway2] The reference to local - * network gateway resource. - * - * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] - * Local network site address space. - * - * @param {array} - * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP - * address of local network gateway. - * - * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network - * gateway's BGP speaker settings. - * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP - * speaker's ASN. - * - * @param {string} - * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The - * weight added to routes learned from this BGP speaker. - * - * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource - * GUID property of the LocalNetworkGateway resource. - * - * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.localNetworkGateway2.id] Resource ID. - * - * @param {string} [parameters.localNetworkGateway2.location] Resource - * location. - * - * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. - * - * @param {string} parameters.connectionType Gateway connection type. Possible - * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible - * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' - * - * @param {string} [parameters.connectionProtocol] Connection protocol used for - * this connection. Possible values include: 'IKEv2', 'IKEv1' - * - * @param {number} [parameters.routingWeight] The routing weight. - * - * @param {string} [parameters.sharedKey] The IPSec shared key. - * - * @param {object} [parameters.peer] The reference to peerings resource. - * - * @param {string} [parameters.peer.id] Resource ID. - * - * @param {boolean} [parameters.enableBgp] EnableBgp flag - * - * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable - * policy-based traffic selectors. - * - * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be - * considered by this connection. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGatewayConnection resource. - * - * @param {boolean} [parameters.expressRouteGatewayBypass] Bypass ExpressRoute - * Gateway for data forwarding - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a virtual network gateway connection in the specified - * resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network gateway connection operation. - * - * @param {string} [parameters.authorizationKey] The authorizationKey. - * - * @param {object} parameters.virtualNetworkGateway1 The reference to virtual - * network gateway resource. - * - * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual - * network gateway resource. - * - * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP - * configurations for virtual network gateway. - * - * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of - * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. - * Possible values include: 'Vpn', 'ExpressRoute' - * - * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this - * virtual network gateway. Possible values are: 'PolicyBased' and - * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' - * - * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP - * is enabled for this virtual network gateway or not. - * - * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] - * ActiveActive flag - * - * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The - * reference of the LocalNetworkGateway resource which represents local network - * site having default routes. Assign Null value in case of removing existing - * default site setting. - * - * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. - * - * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU - * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * - * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU - * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * - * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The - * capacity. - * - * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] - * The reference of the VpnClientConfiguration resource which represents the - * P2S VpnClient configurations. - * - * @param {object} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] - * The reference of the address space resource which represents Address space - * for P2S VpnClient. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. - * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] - * The radius server address property of the VirtualNetworkGateway resource for - * vpn client connection. - * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] - * The radius secret property of the VirtualNetworkGateway resource for vpn - * client connection. - * - * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual - * network gateway's BGP speaker settings. - * - * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The - * resource GUID property of the VirtualNetworkGateway resource. - * - * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. - * - * @param {string} [parameters.virtualNetworkGateway2.location] Resource - * location. - * - * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. - * - * @param {object} [parameters.localNetworkGateway2] The reference to local - * network gateway resource. - * - * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] - * Local network site address space. - * - * @param {array} - * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP - * address of local network gateway. - * - * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network - * gateway's BGP speaker settings. - * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP - * speaker's ASN. - * - * @param {string} - * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The - * weight added to routes learned from this BGP speaker. - * - * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource - * GUID property of the LocalNetworkGateway resource. - * - * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.localNetworkGateway2.id] Resource ID. - * - * @param {string} [parameters.localNetworkGateway2.location] Resource - * location. - * - * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. - * - * @param {string} parameters.connectionType Gateway connection type. Possible - * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible - * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' - * - * @param {string} [parameters.connectionProtocol] Connection protocol used for - * this connection. Possible values include: 'IKEv2', 'IKEv1' - * - * @param {number} [parameters.routingWeight] The routing weight. - * - * @param {string} [parameters.sharedKey] The IPSec shared key. - * - * @param {object} [parameters.peer] The reference to peerings resource. - * - * @param {string} [parameters.peer.id] Resource ID. - * - * @param {boolean} [parameters.enableBgp] EnableBgp flag - * - * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable - * policy-based traffic selectors. - * - * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be - * considered by this connection. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGatewayConnection resource. - * - * @param {boolean} [parameters.expressRouteGatewayBypass] Bypass ExpressRoute - * Gateway for data forwarding - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetworkGatewayConnection} - 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. - * - * {VirtualNetworkGatewayConnection} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGatewayConnection} 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. - */ - createOrUpdate(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified virtual network gateway connection by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway 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, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified virtual network gateway connection by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway 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 {VirtualNetworkGatewayConnection} - 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. - * - * {VirtualNetworkGatewayConnection} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGatewayConnection} 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, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified virtual network Gateway connection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway 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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified virtual network Gateway connection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway 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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates a virtual network gateway connection tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. - * - * @param {object} parameters Parameters supplied to update virtual network - * gateway connection tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a virtual network gateway connection tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. - * - * @param {object} parameters Parameters supplied to update virtual network - * gateway connection tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetworkGatewayConnection} - 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. - * - * {VirtualNetworkGatewayConnection} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGatewayConnection} 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. - */ - updateTags(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual - * network gateway connection shared key for passed virtual network gateway - * connection in the specified resource group through Network resource - * provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection name. - * - * @param {object} parameters Parameters supplied to the Begin Set Virtual - * Network Gateway connection Shared key operation throughNetwork resource - * provider. - * - * @param {string} parameters.value The virtual network connection shared key - * value. - * - * @param {string} [parameters.id] Resource ID. - * - * @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. - */ - setSharedKeyWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual - * network gateway connection shared key for passed virtual network gateway - * connection in the specified resource group through Network resource - * provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection name. - * - * @param {object} parameters Parameters supplied to the Begin Set Virtual - * Network Gateway connection Shared key operation throughNetwork resource - * provider. - * - * @param {string} parameters.value The virtual network connection shared key - * value. - * - * @param {string} [parameters.id] Resource ID. - * - * @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 {ConnectionSharedKey} - 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. - * - * {ConnectionSharedKey} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectionSharedKey} 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. - */ - setSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - setSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, callback: ServiceCallback): void; - setSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves - * information about the specified virtual network gateway connection shared - * key through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection shared key name. - * - * @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. - */ - getSharedKeyWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves - * information about the specified virtual network gateway connection shared - * key through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection shared key name. - * - * @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 {ConnectionSharedKey} - 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. - * - * {ConnectionSharedKey} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectionSharedKey} 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. - */ - getSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, callback: ServiceCallback): void; - getSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * The List VirtualNetworkGatewayConnections operation retrieves all the - * virtual network gateways connections created. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * The List VirtualNetworkGatewayConnections operation retrieves all the - * virtual network gateways connections created. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {VirtualNetworkGatewayConnectionListResult} - 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. - * - * {VirtualNetworkGatewayConnectionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGatewayConnectionListResult} - * 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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the - * virtual network gateway connection shared key for passed virtual network - * gateway connection in the specified resource group through Network resource - * provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection reset shared key Name. - * - * @param {object} parameters Parameters supplied to the begin reset virtual - * network gateway connection shared key operation through network resource - * provider. - * - * @param {number} parameters.keyLength The virtual network connection reset - * shared key length, should between 1 and 128. - * - * @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. - */ - resetSharedKeyWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the - * virtual network gateway connection shared key for passed virtual network - * gateway connection in the specified resource group through Network resource - * provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection reset shared key Name. - * - * @param {object} parameters Parameters supplied to the begin reset virtual - * network gateway connection shared key operation through network resource - * provider. - * - * @param {number} parameters.keyLength The virtual network connection reset - * shared key length, should between 1 and 128. - * - * @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 {ConnectionResetSharedKey} - 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. - * - * {ConnectionResetSharedKey} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectionResetSharedKey} 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. - */ - resetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - resetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, callback: ServiceCallback): void; - resetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a virtual network gateway connection in the specified - * resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network gateway connection operation. - * - * @param {string} [parameters.authorizationKey] The authorizationKey. - * - * @param {object} parameters.virtualNetworkGateway1 The reference to virtual - * network gateway resource. - * - * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual - * network gateway resource. - * - * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP - * configurations for virtual network gateway. - * - * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of - * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. - * Possible values include: 'Vpn', 'ExpressRoute' - * - * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this - * virtual network gateway. Possible values are: 'PolicyBased' and - * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' - * - * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP - * is enabled for this virtual network gateway or not. - * - * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] - * ActiveActive flag - * - * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The - * reference of the LocalNetworkGateway resource which represents local network - * site having default routes. Assign Null value in case of removing existing - * default site setting. - * - * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. - * - * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU - * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * - * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU - * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * - * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The - * capacity. - * - * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] - * The reference of the VpnClientConfiguration resource which represents the - * P2S VpnClient configurations. - * - * @param {object} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] - * The reference of the address space resource which represents Address space - * for P2S VpnClient. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. - * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] - * The radius server address property of the VirtualNetworkGateway resource for - * vpn client connection. - * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] - * The radius secret property of the VirtualNetworkGateway resource for vpn - * client connection. - * - * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual - * network gateway's BGP speaker settings. - * - * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The - * resource GUID property of the VirtualNetworkGateway resource. - * - * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. - * - * @param {string} [parameters.virtualNetworkGateway2.location] Resource - * location. - * - * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. - * - * @param {object} [parameters.localNetworkGateway2] The reference to local - * network gateway resource. - * - * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] - * Local network site address space. - * - * @param {array} - * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP - * address of local network gateway. - * - * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network - * gateway's BGP speaker settings. - * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP - * speaker's ASN. - * - * @param {string} - * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The - * weight added to routes learned from this BGP speaker. - * - * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource - * GUID property of the LocalNetworkGateway resource. - * - * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.localNetworkGateway2.id] Resource ID. - * - * @param {string} [parameters.localNetworkGateway2.location] Resource - * location. - * - * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. - * - * @param {string} parameters.connectionType Gateway connection type. Possible - * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible - * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' - * - * @param {string} [parameters.connectionProtocol] Connection protocol used for - * this connection. Possible values include: 'IKEv2', 'IKEv1' - * - * @param {number} [parameters.routingWeight] The routing weight. - * - * @param {string} [parameters.sharedKey] The IPSec shared key. - * - * @param {object} [parameters.peer] The reference to peerings resource. - * - * @param {string} [parameters.peer.id] Resource ID. - * - * @param {boolean} [parameters.enableBgp] EnableBgp flag - * - * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable - * policy-based traffic selectors. - * - * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be - * considered by this connection. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGatewayConnection resource. - * - * @param {boolean} [parameters.expressRouteGatewayBypass] Bypass ExpressRoute - * Gateway for data forwarding - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a virtual network gateway connection in the specified - * resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network gateway connection operation. - * - * @param {string} [parameters.authorizationKey] The authorizationKey. - * - * @param {object} parameters.virtualNetworkGateway1 The reference to virtual - * network gateway resource. - * - * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual - * network gateway resource. - * - * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP - * configurations for virtual network gateway. - * - * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of - * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. - * Possible values include: 'Vpn', 'ExpressRoute' - * - * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this - * virtual network gateway. Possible values are: 'PolicyBased' and - * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' - * - * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP - * is enabled for this virtual network gateway or not. - * - * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] - * ActiveActive flag - * - * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The - * reference of the LocalNetworkGateway resource which represents local network - * site having default routes. Assign Null value in case of removing existing - * default site setting. - * - * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. - * - * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU - * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * - * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU - * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * - * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The - * capacity. - * - * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] - * The reference of the VpnClientConfiguration resource which represents the - * P2S VpnClient configurations. - * - * @param {object} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] - * The reference of the address space resource which represents Address space - * for P2S VpnClient. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. - * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] - * The radius server address property of the VirtualNetworkGateway resource for - * vpn client connection. - * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] - * The radius secret property of the VirtualNetworkGateway resource for vpn - * client connection. - * - * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual - * network gateway's BGP speaker settings. - * - * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The - * resource GUID property of the VirtualNetworkGateway resource. - * - * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. - * - * @param {string} [parameters.virtualNetworkGateway2.location] Resource - * location. - * - * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. - * - * @param {object} [parameters.localNetworkGateway2] The reference to local - * network gateway resource. - * - * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] - * Local network site address space. - * - * @param {array} - * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP - * address of local network gateway. - * - * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network - * gateway's BGP speaker settings. - * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP - * speaker's ASN. - * - * @param {string} - * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The - * weight added to routes learned from this BGP speaker. - * - * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource - * GUID property of the LocalNetworkGateway resource. - * - * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.localNetworkGateway2.id] Resource ID. - * - * @param {string} [parameters.localNetworkGateway2.location] Resource - * location. - * - * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. - * - * @param {string} parameters.connectionType Gateway connection type. Possible - * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible - * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' - * - * @param {string} [parameters.connectionProtocol] Connection protocol used for - * this connection. Possible values include: 'IKEv2', 'IKEv1' - * - * @param {number} [parameters.routingWeight] The routing weight. - * - * @param {string} [parameters.sharedKey] The IPSec shared key. - * - * @param {object} [parameters.peer] The reference to peerings resource. - * - * @param {string} [parameters.peer.id] Resource ID. - * - * @param {boolean} [parameters.enableBgp] EnableBgp flag - * - * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable - * policy-based traffic selectors. - * - * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be - * considered by this connection. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGatewayConnection resource. - * - * @param {boolean} [parameters.expressRouteGatewayBypass] Bypass ExpressRoute - * Gateway for data forwarding - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetworkGatewayConnection} - 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. - * - * {VirtualNetworkGatewayConnection} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGatewayConnection} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.VirtualNetworkGatewayConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified virtual network Gateway connection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway 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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified virtual network Gateway connection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway 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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates a virtual network gateway connection tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. - * - * @param {object} parameters Parameters supplied to update virtual network - * gateway connection tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a virtual network gateway connection tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. - * - * @param {object} parameters Parameters supplied to update virtual network - * gateway connection tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetworkGatewayConnection} - 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. - * - * {VirtualNetworkGatewayConnection} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGatewayConnection} 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. - */ - beginUpdateTags(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual - * network gateway connection shared key for passed virtual network gateway - * connection in the specified resource group through Network resource - * provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection name. - * - * @param {object} parameters Parameters supplied to the Begin Set Virtual - * Network Gateway connection Shared key operation throughNetwork resource - * provider. - * - * @param {string} parameters.value The virtual network connection shared key - * value. - * - * @param {string} [parameters.id] Resource ID. - * - * @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. - */ - beginSetSharedKeyWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual - * network gateway connection shared key for passed virtual network gateway - * connection in the specified resource group through Network resource - * provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection name. - * - * @param {object} parameters Parameters supplied to the Begin Set Virtual - * Network Gateway connection Shared key operation throughNetwork resource - * provider. - * - * @param {string} parameters.value The virtual network connection shared key - * value. - * - * @param {string} [parameters.id] Resource ID. - * - * @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 {ConnectionSharedKey} - 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. - * - * {ConnectionSharedKey} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectionSharedKey} 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. - */ - beginSetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginSetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, callback: ServiceCallback): void; - beginSetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionSharedKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the - * virtual network gateway connection shared key for passed virtual network - * gateway connection in the specified resource group through Network resource - * provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection reset shared key Name. - * - * @param {object} parameters Parameters supplied to the begin reset virtual - * network gateway connection shared key operation through network resource - * provider. - * - * @param {number} parameters.keyLength The virtual network connection reset - * shared key length, should between 1 and 128. - * - * @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. - */ - beginResetSharedKeyWithHttpOperationResponse(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the - * virtual network gateway connection shared key for passed virtual network - * gateway connection in the specified resource group through Network resource - * provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection reset shared key Name. - * - * @param {object} parameters Parameters supplied to the begin reset virtual - * network gateway connection shared key operation through network resource - * provider. - * - * @param {number} parameters.keyLength The virtual network connection reset - * shared key length, should between 1 and 128. - * - * @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 {ConnectionResetSharedKey} - 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. - * - * {ConnectionResetSharedKey} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectionResetSharedKey} 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. - */ - beginResetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginResetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, callback: ServiceCallback): void; - beginResetSharedKey(resourceGroupName: string, virtualNetworkGatewayConnectionName: string, parameters: models.ConnectionResetSharedKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * The List VirtualNetworkGatewayConnections operation retrieves all the - * virtual network gateways connections created. - * - * @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>; - - /** - * The List VirtualNetworkGatewayConnections operation retrieves all the - * virtual network gateways connections created. - * - * @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 {VirtualNetworkGatewayConnectionListResult} - 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. - * - * {VirtualNetworkGatewayConnectionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkGatewayConnectionListResult} - * 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 - * LocalNetworkGateways - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface LocalNetworkGateways { - - - /** - * Creates or updates a local network gateway in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @param {object} parameters Parameters supplied to the create or update local - * network gateway operation. - * - * @param {object} [parameters.localNetworkAddressSpace] Local network site - * address space. - * - * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [parameters.gatewayIpAddress] IP address of local network - * gateway. - * - * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker - * settings. - * - * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. - * - * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.bgpSettings.peerWeight] The weight added to - * routes learned from this BGP speaker. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * LocalNetworkGateway resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a local network gateway in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @param {object} parameters Parameters supplied to the create or update local - * network gateway operation. - * - * @param {object} [parameters.localNetworkAddressSpace] Local network site - * address space. - * - * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [parameters.gatewayIpAddress] IP address of local network - * gateway. - * - * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker - * settings. - * - * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. - * - * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.bgpSettings.peerWeight] The weight added to - * routes learned from this BGP speaker. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * LocalNetworkGateway resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {LocalNetworkGateway} - 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. - * - * {LocalNetworkGateway} [result] - The deserialized result object if an error did not occur. - * See {@link LocalNetworkGateway} 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. - */ - createOrUpdate(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the specified local network gateway in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @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, localNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the specified local network gateway in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @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 {LocalNetworkGateway} - 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. - * - * {LocalNetworkGateway} [result] - The deserialized result object if an error did not occur. - * See {@link LocalNetworkGateway} 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, localNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, localNetworkGatewayName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, localNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified local network gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, localNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified local network gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, localNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, localNetworkGatewayName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, localNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates a local network gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @param {object} parameters Parameters supplied to update local network - * gateway tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a local network gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @param {object} parameters Parameters supplied to update local network - * gateway tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {LocalNetworkGateway} - 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. - * - * {LocalNetworkGateway} [result] - The deserialized result object if an error did not occur. - * See {@link LocalNetworkGateway} 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. - */ - updateTags(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the local network gateways in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the local network gateways in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {LocalNetworkGatewayListResult} - 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. - * - * {LocalNetworkGatewayListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LocalNetworkGatewayListResult} 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, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a local network gateway in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @param {object} parameters Parameters supplied to the create or update local - * network gateway operation. - * - * @param {object} [parameters.localNetworkAddressSpace] Local network site - * address space. - * - * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [parameters.gatewayIpAddress] IP address of local network - * gateway. - * - * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker - * settings. - * - * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. - * - * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.bgpSettings.peerWeight] The weight added to - * routes learned from this BGP speaker. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * LocalNetworkGateway resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a local network gateway in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @param {object} parameters Parameters supplied to the create or update local - * network gateway operation. - * - * @param {object} [parameters.localNetworkAddressSpace] Local network site - * address space. - * - * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [parameters.gatewayIpAddress] IP address of local network - * gateway. - * - * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker - * settings. - * - * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. - * - * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.bgpSettings.peerWeight] The weight added to - * routes learned from this BGP speaker. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * LocalNetworkGateway resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {LocalNetworkGateway} - 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. - * - * {LocalNetworkGateway} [result] - The deserialized result object if an error did not occur. - * See {@link LocalNetworkGateway} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.LocalNetworkGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified local network gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, localNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified local network gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, localNetworkGatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, localNetworkGatewayName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, localNetworkGatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates a local network gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @param {object} parameters Parameters supplied to update local network - * gateway tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a local network gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @param {object} parameters Parameters supplied to update local network - * gateway tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {LocalNetworkGateway} - 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. - * - * {LocalNetworkGateway} [result] - The deserialized result object if an error did not occur. - * See {@link LocalNetworkGateway} 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. - */ - beginUpdateTags(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, localNetworkGatewayName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the local network gateways in a resource group. - * - * @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 the local network gateways in a resource group. - * - * @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 {LocalNetworkGatewayListResult} - 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. - * - * {LocalNetworkGatewayListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LocalNetworkGatewayListResult} 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 - * VirtualNetworkTaps - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface VirtualNetworkTaps { - - - /** - * Deletes the specified virtual network tap. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the virtual network tap. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, tapName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified virtual network tap. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the virtual network tap. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, tapName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, tapName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, tapName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets information about the specified virtual network tap. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of virtual network tap. - * - * @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, tapName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets information about the specified virtual network tap. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of virtual network tap. - * - * @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 {VirtualNetworkTap} - 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. - * - * {VirtualNetworkTap} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkTap} 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, tapName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, tapName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, tapName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a Virtual Network Tap. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the virtual network tap. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network tap operation. - * - * @param {object} [parameters.destinationNetworkInterfaceIPConfiguration] The - * reference to the private IP Address of the collector nic that will receive - * the tap - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.virtualNetworkTaps] - * The reference to Virtual Network Taps. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.applicationGatewayBackendAddressPools] - * The reference of ApplicationGatewayBackendAddressPool resource. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.loadBalancerBackendAddressPools] - * The reference of LoadBalancerBackendAddressPool resource. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.loadBalancerInboundNatRules] - * A list of references of LoadBalancerInboundNatRules. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAddress] - * Private IP address of the IP configuration. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAllocationMethod] - * Defines how a private IP address is assigned. Possible values are: 'Static' - * and 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAddressVersion] - * Available from Api-Version 2016-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * - * @param {object} - * [parameters.destinationNetworkInterfaceIPConfiguration.subnet] Subnet bound - * to the IP configuration. - * - * @param {boolean} - * [parameters.destinationNetworkInterfaceIPConfiguration.primary] Gets whether - * this is a primary customer address on the network interface. - * - * @param {object} - * [parameters.destinationNetworkInterfaceIPConfiguration.publicIPAddress] - * Public IP address bound to the IP configuration. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.applicationSecurityGroups] - * Application security groups in which the IP configuration is included. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.provisioningState] - * The provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.id] - * Resource ID. - * - * @param {object} [parameters.destinationLoadBalancerFrontEndIPConfiguration] - * The reference to the private IP address on the internal Load Balancer that - * will receive the tap - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.privateIPAllocationMethod] - * The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet] The - * reference of the subnet resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.tags] - * Resource tags. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * - * @param {boolean} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.tags] - * Resource tags. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.name] The - * name of the resource that is unique within a resource group. This name can - * be used to access the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.etag] A - * unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.id] - * Resource ID. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress] - * The reference of the Public IP resource. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku] - * The public IP address SKU. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku.name] - * Name of a public IP address SKU. Possible values include: 'Basic', - * 'Standard' - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is specified, - * an A DNS record is created for the public IP in the Microsoft Azure DNS - * system. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and the - * regionalized DNS zone. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipTags] - * The list of tags associated with the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipAddress] - * The IP address associated with the public IP address resource. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * - * @param {number} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.tags] - * Resource tags. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix] - * The reference of the Public IP Prefix resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.name] The name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.zones] A list of - * availability zones denoting the IP allocated for the resource needs to come - * from. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.id] Resource ID. - * - * @param {number} [parameters.destinationPort] The VXLAN destination port that - * will receive the tapped traffic. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, tapName: string, parameters: models.VirtualNetworkTap, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a Virtual Network Tap. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the virtual network tap. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network tap operation. - * - * @param {object} [parameters.destinationNetworkInterfaceIPConfiguration] The - * reference to the private IP Address of the collector nic that will receive - * the tap - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.virtualNetworkTaps] - * The reference to Virtual Network Taps. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.applicationGatewayBackendAddressPools] - * The reference of ApplicationGatewayBackendAddressPool resource. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.loadBalancerBackendAddressPools] - * The reference of LoadBalancerBackendAddressPool resource. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.loadBalancerInboundNatRules] - * A list of references of LoadBalancerInboundNatRules. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAddress] - * Private IP address of the IP configuration. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAllocationMethod] - * Defines how a private IP address is assigned. Possible values are: 'Static' - * and 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAddressVersion] - * Available from Api-Version 2016-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * - * @param {object} - * [parameters.destinationNetworkInterfaceIPConfiguration.subnet] Subnet bound - * to the IP configuration. - * - * @param {boolean} - * [parameters.destinationNetworkInterfaceIPConfiguration.primary] Gets whether - * this is a primary customer address on the network interface. - * - * @param {object} - * [parameters.destinationNetworkInterfaceIPConfiguration.publicIPAddress] - * Public IP address bound to the IP configuration. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.applicationSecurityGroups] - * Application security groups in which the IP configuration is included. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.provisioningState] - * The provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.id] - * Resource ID. - * - * @param {object} [parameters.destinationLoadBalancerFrontEndIPConfiguration] - * The reference to the private IP address on the internal Load Balancer that - * will receive the tap - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.privateIPAllocationMethod] - * The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet] The - * reference of the subnet resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.tags] - * Resource tags. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * - * @param {boolean} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.tags] - * Resource tags. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.name] The - * name of the resource that is unique within a resource group. This name can - * be used to access the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.etag] A - * unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.id] - * Resource ID. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress] - * The reference of the Public IP resource. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku] - * The public IP address SKU. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku.name] - * Name of a public IP address SKU. Possible values include: 'Basic', - * 'Standard' - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is specified, - * an A DNS record is created for the public IP in the Microsoft Azure DNS - * system. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and the - * regionalized DNS zone. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipTags] - * The list of tags associated with the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipAddress] - * The IP address associated with the public IP address resource. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * - * @param {number} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.tags] - * Resource tags. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix] - * The reference of the Public IP Prefix resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.name] The name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.zones] A list of - * availability zones denoting the IP allocated for the resource needs to come - * from. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.id] Resource ID. - * - * @param {number} [parameters.destinationPort] The VXLAN destination port that - * will receive the tapped traffic. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetworkTap} - 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. - * - * {VirtualNetworkTap} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkTap} 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. - */ - createOrUpdate(resourceGroupName: string, tapName: string, parameters: models.VirtualNetworkTap, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, tapName: string, parameters: models.VirtualNetworkTap, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, tapName: string, parameters: models.VirtualNetworkTap, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates an VirtualNetworkTap tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the tap. - * - * @param {object} tapParameters Parameters supplied to update - * VirtualNetworkTap tags. - * - * @param {object} [tapParameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, tapName: string, tapParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates an VirtualNetworkTap tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the tap. - * - * @param {object} tapParameters Parameters supplied to update - * VirtualNetworkTap tags. - * - * @param {object} [tapParameters.tags] Resource tags. - * - * @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 {VirtualNetworkTap} - 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. - * - * {VirtualNetworkTap} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkTap} 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. - */ - updateTags(resourceGroupName: string, tapName: string, tapParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, tapName: string, tapParameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, tapName: string, tapParameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @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 {VirtualNetworkTapListResult} - 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. - * - * {VirtualNetworkTapListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkTapListResult} 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. - */ - listAll(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAll(callback: ServiceCallback): void; - listAll(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {VirtualNetworkTapListResult} - 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. - * - * {VirtualNetworkTapListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkTapListResult} 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. - */ - listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the specified virtual network tap. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the virtual network tap. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, tapName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the specified virtual network tap. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the virtual network tap. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, tapName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, tapName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, tapName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates a Virtual Network Tap. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the virtual network tap. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network tap operation. - * - * @param {object} [parameters.destinationNetworkInterfaceIPConfiguration] The - * reference to the private IP Address of the collector nic that will receive - * the tap - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.virtualNetworkTaps] - * The reference to Virtual Network Taps. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.applicationGatewayBackendAddressPools] - * The reference of ApplicationGatewayBackendAddressPool resource. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.loadBalancerBackendAddressPools] - * The reference of LoadBalancerBackendAddressPool resource. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.loadBalancerInboundNatRules] - * A list of references of LoadBalancerInboundNatRules. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAddress] - * Private IP address of the IP configuration. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAllocationMethod] - * Defines how a private IP address is assigned. Possible values are: 'Static' - * and 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAddressVersion] - * Available from Api-Version 2016-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * - * @param {object} - * [parameters.destinationNetworkInterfaceIPConfiguration.subnet] Subnet bound - * to the IP configuration. - * - * @param {boolean} - * [parameters.destinationNetworkInterfaceIPConfiguration.primary] Gets whether - * this is a primary customer address on the network interface. - * - * @param {object} - * [parameters.destinationNetworkInterfaceIPConfiguration.publicIPAddress] - * Public IP address bound to the IP configuration. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.applicationSecurityGroups] - * Application security groups in which the IP configuration is included. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.provisioningState] - * The provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.id] - * Resource ID. - * - * @param {object} [parameters.destinationLoadBalancerFrontEndIPConfiguration] - * The reference to the private IP address on the internal Load Balancer that - * will receive the tap - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.privateIPAllocationMethod] - * The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet] The - * reference of the subnet resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.tags] - * Resource tags. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * - * @param {boolean} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.tags] - * Resource tags. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.name] The - * name of the resource that is unique within a resource group. This name can - * be used to access the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.etag] A - * unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.id] - * Resource ID. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress] - * The reference of the Public IP resource. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku] - * The public IP address SKU. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku.name] - * Name of a public IP address SKU. Possible values include: 'Basic', - * 'Standard' - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is specified, - * an A DNS record is created for the public IP in the Microsoft Azure DNS - * system. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and the - * regionalized DNS zone. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipTags] - * The list of tags associated with the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipAddress] - * The IP address associated with the public IP address resource. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * - * @param {number} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.tags] - * Resource tags. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix] - * The reference of the Public IP Prefix resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.name] The name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.zones] A list of - * availability zones denoting the IP allocated for the resource needs to come - * from. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.id] Resource ID. - * - * @param {number} [parameters.destinationPort] The VXLAN destination port that - * will receive the tapped traffic. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, tapName: string, parameters: models.VirtualNetworkTap, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a Virtual Network Tap. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the virtual network tap. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network tap operation. - * - * @param {object} [parameters.destinationNetworkInterfaceIPConfiguration] The - * reference to the private IP Address of the collector nic that will receive - * the tap - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.virtualNetworkTaps] - * The reference to Virtual Network Taps. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.applicationGatewayBackendAddressPools] - * The reference of ApplicationGatewayBackendAddressPool resource. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.loadBalancerBackendAddressPools] - * The reference of LoadBalancerBackendAddressPool resource. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.loadBalancerInboundNatRules] - * A list of references of LoadBalancerInboundNatRules. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAddress] - * Private IP address of the IP configuration. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAllocationMethod] - * Defines how a private IP address is assigned. Possible values are: 'Static' - * and 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAddressVersion] - * Available from Api-Version 2016-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * - * @param {object} - * [parameters.destinationNetworkInterfaceIPConfiguration.subnet] Subnet bound - * to the IP configuration. - * - * @param {boolean} - * [parameters.destinationNetworkInterfaceIPConfiguration.primary] Gets whether - * this is a primary customer address on the network interface. - * - * @param {object} - * [parameters.destinationNetworkInterfaceIPConfiguration.publicIPAddress] - * Public IP address bound to the IP configuration. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.applicationSecurityGroups] - * Application security groups in which the IP configuration is included. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.provisioningState] - * The provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.id] - * Resource ID. - * - * @param {object} [parameters.destinationLoadBalancerFrontEndIPConfiguration] - * The reference to the private IP address on the internal Load Balancer that - * will receive the tap - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.privateIPAllocationMethod] - * The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet] The - * reference of the subnet resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.tags] - * Resource tags. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * - * @param {boolean} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.tags] - * Resource tags. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.name] The - * name of the resource that is unique within a resource group. This name can - * be used to access the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.etag] A - * unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.id] - * Resource ID. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress] - * The reference of the Public IP resource. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku] - * The public IP address SKU. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku.name] - * Name of a public IP address SKU. Possible values include: 'Basic', - * 'Standard' - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is specified, - * an A DNS record is created for the public IP in the Microsoft Azure DNS - * system. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and the - * regionalized DNS zone. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipTags] - * The list of tags associated with the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipAddress] - * The IP address associated with the public IP address resource. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * - * @param {number} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.tags] - * Resource tags. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix] - * The reference of the Public IP Prefix resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.name] The name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.zones] A list of - * availability zones denoting the IP allocated for the resource needs to come - * from. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.id] Resource ID. - * - * @param {number} [parameters.destinationPort] The VXLAN destination port that - * will receive the tapped traffic. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetworkTap} - 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. - * - * {VirtualNetworkTap} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkTap} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, tapName: string, parameters: models.VirtualNetworkTap, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, tapName: string, parameters: models.VirtualNetworkTap, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, tapName: string, parameters: models.VirtualNetworkTap, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates an VirtualNetworkTap tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the tap. - * - * @param {object} tapParameters Parameters supplied to update - * VirtualNetworkTap tags. - * - * @param {object} [tapParameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, tapName: string, tapParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates an VirtualNetworkTap tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the tap. - * - * @param {object} tapParameters Parameters supplied to update - * VirtualNetworkTap tags. - * - * @param {object} [tapParameters.tags] Resource tags. - * - * @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 {VirtualNetworkTap} - 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. - * - * {VirtualNetworkTap} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkTap} 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. - */ - beginUpdateTags(resourceGroupName: string, tapName: string, tapParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, tapName: string, tapParameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, tapName: string, tapParameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @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 {VirtualNetworkTapListResult} - 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. - * - * {VirtualNetworkTapListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkTapListResult} 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. - */ - listAllNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listAllNext(nextPageLink: string, callback: ServiceCallback): void; - listAllNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @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. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @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 {VirtualNetworkTapListResult} - 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. - * - * {VirtualNetworkTapListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkTapListResult} 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. - */ - listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * VirtualWans - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface VirtualWans { - - - /** - * Retrieves the details of a VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being retrieved. - * - * @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, virtualWANName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves the details of a VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being retrieved. - * - * @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 {VirtualWAN} - 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. - * - * {VirtualWAN} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualWAN} 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, virtualWANName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, virtualWANName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, virtualWANName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing - * VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being created or - * updated. - * - * @param {object} wANParameters Parameters supplied to create or update - * VirtualWAN. - * - * @param {boolean} [wANParameters.disableVpnEncryption] Vpn encryption to be - * disabled or not. - * - * @param {string} [wANParameters.securityProviderName] The Security Provider - * name. - * - * @param {boolean} [wANParameters.allowBranchToBranchTraffic] True if branch - * to branch traffic is allowed. - * - * @param {boolean} [wANParameters.allowVnetToVnetTraffic] True if Vnet to Vnet - * traffic is allowed. - * - * @param {string} [wANParameters.office365LocalBreakoutCategory] The office - * local breakout category. Possible values include: 'Optimize', - * 'OptimizeAndAllow', 'All', 'None' - * - * @param {array} [wANParameters.p2SVpnServerConfigurations] list of all - * P2SVpnServerConfigurations associated with the virtual wan. - * - * @param {string} [wANParameters.provisioningState] The provisioning state of - * the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * - * @param {string} [wANParameters.id] Resource ID. - * - * @param {string} [wANParameters.location] Resource location. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, wANParameters: models.VirtualWAN, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing - * VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being created or - * updated. - * - * @param {object} wANParameters Parameters supplied to create or update - * VirtualWAN. - * - * @param {boolean} [wANParameters.disableVpnEncryption] Vpn encryption to be - * disabled or not. - * - * @param {string} [wANParameters.securityProviderName] The Security Provider - * name. - * - * @param {boolean} [wANParameters.allowBranchToBranchTraffic] True if branch - * to branch traffic is allowed. - * - * @param {boolean} [wANParameters.allowVnetToVnetTraffic] True if Vnet to Vnet - * traffic is allowed. - * - * @param {string} [wANParameters.office365LocalBreakoutCategory] The office - * local breakout category. Possible values include: 'Optimize', - * 'OptimizeAndAllow', 'All', 'None' - * - * @param {array} [wANParameters.p2SVpnServerConfigurations] list of all - * P2SVpnServerConfigurations associated with the virtual wan. - * - * @param {string} [wANParameters.provisioningState] The provisioning state of - * the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * - * @param {string} [wANParameters.id] Resource ID. - * - * @param {string} [wANParameters.location] Resource location. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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 {VirtualWAN} - 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. - * - * {VirtualWAN} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualWAN} 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. - */ - createOrUpdate(resourceGroupName: string, virtualWANName: string, wANParameters: models.VirtualWAN, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, virtualWANName: string, wANParameters: models.VirtualWAN, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, virtualWANName: string, wANParameters: models.VirtualWAN, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates a VirtualWAN tags. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being updated. - * - * @param {object} wANParameters Parameters supplied to Update VirtualWAN tags. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, wANParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a VirtualWAN tags. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being updated. - * - * @param {object} wANParameters Parameters supplied to Update VirtualWAN tags. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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 {VirtualWAN} - 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. - * - * {VirtualWAN} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualWAN} 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. - */ - updateTags(resourceGroupName: string, virtualWANName: string, wANParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, virtualWANName: string, wANParameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, virtualWANName: string, wANParameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes a VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being deleted. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes a VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being deleted. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, virtualWANName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, virtualWANName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, virtualWANName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all the VirtualWANs in a resource group. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all the VirtualWANs in a resource group. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @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 {ListVirtualWANsResult} - 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. - * - * {ListVirtualWANsResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListVirtualWANsResult} 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. - */ - listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all the VirtualWANs in a subscription. - * - * @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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all the VirtualWANs in a subscription. - * - * @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 {ListVirtualWANsResult} - 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. - * - * {ListVirtualWANsResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListVirtualWANsResult} 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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing - * VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being created or - * updated. - * - * @param {object} wANParameters Parameters supplied to create or update - * VirtualWAN. - * - * @param {boolean} [wANParameters.disableVpnEncryption] Vpn encryption to be - * disabled or not. - * - * @param {string} [wANParameters.securityProviderName] The Security Provider - * name. - * - * @param {boolean} [wANParameters.allowBranchToBranchTraffic] True if branch - * to branch traffic is allowed. - * - * @param {boolean} [wANParameters.allowVnetToVnetTraffic] True if Vnet to Vnet - * traffic is allowed. - * - * @param {string} [wANParameters.office365LocalBreakoutCategory] The office - * local breakout category. Possible values include: 'Optimize', - * 'OptimizeAndAllow', 'All', 'None' - * - * @param {array} [wANParameters.p2SVpnServerConfigurations] list of all - * P2SVpnServerConfigurations associated with the virtual wan. - * - * @param {string} [wANParameters.provisioningState] The provisioning state of - * the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * - * @param {string} [wANParameters.id] Resource ID. - * - * @param {string} [wANParameters.location] Resource location. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, wANParameters: models.VirtualWAN, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing - * VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being created or - * updated. - * - * @param {object} wANParameters Parameters supplied to create or update - * VirtualWAN. - * - * @param {boolean} [wANParameters.disableVpnEncryption] Vpn encryption to be - * disabled or not. - * - * @param {string} [wANParameters.securityProviderName] The Security Provider - * name. - * - * @param {boolean} [wANParameters.allowBranchToBranchTraffic] True if branch - * to branch traffic is allowed. - * - * @param {boolean} [wANParameters.allowVnetToVnetTraffic] True if Vnet to Vnet - * traffic is allowed. - * - * @param {string} [wANParameters.office365LocalBreakoutCategory] The office - * local breakout category. Possible values include: 'Optimize', - * 'OptimizeAndAllow', 'All', 'None' - * - * @param {array} [wANParameters.p2SVpnServerConfigurations] list of all - * P2SVpnServerConfigurations associated with the virtual wan. - * - * @param {string} [wANParameters.provisioningState] The provisioning state of - * the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * - * @param {string} [wANParameters.id] Resource ID. - * - * @param {string} [wANParameters.location] Resource location. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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 {VirtualWAN} - 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. - * - * {VirtualWAN} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualWAN} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, virtualWANName: string, wANParameters: models.VirtualWAN, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, virtualWANName: string, wANParameters: models.VirtualWAN, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, virtualWANName: string, wANParameters: models.VirtualWAN, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates a VirtualWAN tags. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being updated. - * - * @param {object} wANParameters Parameters supplied to Update VirtualWAN tags. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, wANParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a VirtualWAN tags. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being updated. - * - * @param {object} wANParameters Parameters supplied to Update VirtualWAN tags. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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 {VirtualWAN} - 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. - * - * {VirtualWAN} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualWAN} 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. - */ - beginUpdateTags(resourceGroupName: string, virtualWANName: string, wANParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, virtualWANName: string, wANParameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, virtualWANName: string, wANParameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes a VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being deleted. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes a VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being deleted. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, virtualWANName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, virtualWANName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, virtualWANName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all the VirtualWANs in a resource group. - * - * @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. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all the VirtualWANs in a resource group. - * - * @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 {ListVirtualWANsResult} - 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. - * - * {ListVirtualWANsResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListVirtualWANsResult} 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. - */ - listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all the VirtualWANs in a subscription. - * - * @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>; - - /** - * Lists all the VirtualWANs in a subscription. - * - * @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 {ListVirtualWANsResult} - 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. - * - * {ListVirtualWANsResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListVirtualWANsResult} 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 - * VpnSites - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface VpnSites { - - - /** - * Retrieves the details of a VPNsite. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being retrieved. - * - * @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, vpnSiteName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves the details of a VPNsite. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being retrieved. - * - * @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 {VpnSite} - 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. - * - * {VpnSite} [result] - The deserialized result object if an error did not occur. - * See {@link VpnSite} 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, vpnSiteName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, vpnSiteName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, vpnSiteName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates a VpnSite resource if it doesn't exist else updates the existing - * VpnSite. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being created or - * updated. - * - * @param {object} vpnSiteParameters Parameters supplied to create or update - * VpnSite. - * - * @param {object} [vpnSiteParameters.virtualWan] The VirtualWAN to which the - * vpnSite belongs - * - * @param {string} [vpnSiteParameters.virtualWan.id] Resource ID. - * - * @param {object} [vpnSiteParameters.deviceProperties] The device properties - * - * @param {string} [vpnSiteParameters.deviceProperties.deviceVendor] Name of - * the device Vendor. - * - * @param {string} [vpnSiteParameters.deviceProperties.deviceModel] Model of - * the device. - * - * @param {number} [vpnSiteParameters.deviceProperties.linkSpeedInMbps] Link - * speed. - * - * @param {string} [vpnSiteParameters.ipAddress] The ip-address for the - * vpn-site. - * - * @param {string} [vpnSiteParameters.siteKey] The key for vpn-site that can be - * used for connections. - * - * @param {object} [vpnSiteParameters.addressSpace] The AddressSpace that - * contains an array of IP address ranges. - * - * @param {array} [vpnSiteParameters.addressSpace.addressPrefixes] A list of - * address blocks reserved for this virtual network in CIDR notation. - * - * @param {object} [vpnSiteParameters.bgpProperties] The set of bgp properties. - * - * @param {number} [vpnSiteParameters.bgpProperties.asn] The BGP speaker's ASN. - * - * @param {string} [vpnSiteParameters.bgpProperties.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [vpnSiteParameters.bgpProperties.peerWeight] The weight - * added to routes learned from this BGP speaker. - * - * @param {string} [vpnSiteParameters.provisioningState] The provisioning state - * of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {boolean} [vpnSiteParameters.isSecuritySite] IsSecuritySite flag - * - * @param {string} [vpnSiteParameters.id] Resource ID. - * - * @param {string} [vpnSiteParameters.location] Resource location. - * - * @param {object} [vpnSiteParameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.VpnSite, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates a VpnSite resource if it doesn't exist else updates the existing - * VpnSite. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being created or - * updated. - * - * @param {object} vpnSiteParameters Parameters supplied to create or update - * VpnSite. - * - * @param {object} [vpnSiteParameters.virtualWan] The VirtualWAN to which the - * vpnSite belongs - * - * @param {string} [vpnSiteParameters.virtualWan.id] Resource ID. - * - * @param {object} [vpnSiteParameters.deviceProperties] The device properties - * - * @param {string} [vpnSiteParameters.deviceProperties.deviceVendor] Name of - * the device Vendor. - * - * @param {string} [vpnSiteParameters.deviceProperties.deviceModel] Model of - * the device. - * - * @param {number} [vpnSiteParameters.deviceProperties.linkSpeedInMbps] Link - * speed. - * - * @param {string} [vpnSiteParameters.ipAddress] The ip-address for the - * vpn-site. - * - * @param {string} [vpnSiteParameters.siteKey] The key for vpn-site that can be - * used for connections. - * - * @param {object} [vpnSiteParameters.addressSpace] The AddressSpace that - * contains an array of IP address ranges. - * - * @param {array} [vpnSiteParameters.addressSpace.addressPrefixes] A list of - * address blocks reserved for this virtual network in CIDR notation. - * - * @param {object} [vpnSiteParameters.bgpProperties] The set of bgp properties. - * - * @param {number} [vpnSiteParameters.bgpProperties.asn] The BGP speaker's ASN. - * - * @param {string} [vpnSiteParameters.bgpProperties.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [vpnSiteParameters.bgpProperties.peerWeight] The weight - * added to routes learned from this BGP speaker. - * - * @param {string} [vpnSiteParameters.provisioningState] The provisioning state - * of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {boolean} [vpnSiteParameters.isSecuritySite] IsSecuritySite flag - * - * @param {string} [vpnSiteParameters.id] Resource ID. - * - * @param {string} [vpnSiteParameters.location] Resource location. - * - * @param {object} [vpnSiteParameters.tags] Resource tags. - * - * @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 {VpnSite} - 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. - * - * {VpnSite} [result] - The deserialized result object if an error did not occur. - * See {@link VpnSite} 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. - */ - createOrUpdate(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.VpnSite, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.VpnSite, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.VpnSite, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates VpnSite tags. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being updated. - * - * @param {object} vpnSiteParameters Parameters supplied to update VpnSite - * tags. - * - * @param {object} [vpnSiteParameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates VpnSite tags. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being updated. - * - * @param {object} vpnSiteParameters Parameters supplied to update VpnSite - * tags. - * - * @param {object} [vpnSiteParameters.tags] Resource tags. - * - * @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 {VpnSite} - 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. - * - * {VpnSite} [result] - The deserialized result object if an error did not occur. - * See {@link VpnSite} 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. - */ - updateTags(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes a VpnSite. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being deleted. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, vpnSiteName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes a VpnSite. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being deleted. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, vpnSiteName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, vpnSiteName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, vpnSiteName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all the vpnSites in a resource group. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all the vpnSites in a resource group. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @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 {ListVpnSitesResult} - 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. - * - * {ListVpnSitesResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListVpnSitesResult} 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. - */ - listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all the VpnSites in a subscription. - * - * @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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all the VpnSites in a subscription. - * - * @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 {ListVpnSitesResult} - 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. - * - * {ListVpnSitesResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListVpnSitesResult} 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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates a VpnSite resource if it doesn't exist else updates the existing - * VpnSite. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being created or - * updated. - * - * @param {object} vpnSiteParameters Parameters supplied to create or update - * VpnSite. - * - * @param {object} [vpnSiteParameters.virtualWan] The VirtualWAN to which the - * vpnSite belongs - * - * @param {string} [vpnSiteParameters.virtualWan.id] Resource ID. - * - * @param {object} [vpnSiteParameters.deviceProperties] The device properties - * - * @param {string} [vpnSiteParameters.deviceProperties.deviceVendor] Name of - * the device Vendor. - * - * @param {string} [vpnSiteParameters.deviceProperties.deviceModel] Model of - * the device. - * - * @param {number} [vpnSiteParameters.deviceProperties.linkSpeedInMbps] Link - * speed. - * - * @param {string} [vpnSiteParameters.ipAddress] The ip-address for the - * vpn-site. - * - * @param {string} [vpnSiteParameters.siteKey] The key for vpn-site that can be - * used for connections. - * - * @param {object} [vpnSiteParameters.addressSpace] The AddressSpace that - * contains an array of IP address ranges. - * - * @param {array} [vpnSiteParameters.addressSpace.addressPrefixes] A list of - * address blocks reserved for this virtual network in CIDR notation. - * - * @param {object} [vpnSiteParameters.bgpProperties] The set of bgp properties. - * - * @param {number} [vpnSiteParameters.bgpProperties.asn] The BGP speaker's ASN. - * - * @param {string} [vpnSiteParameters.bgpProperties.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [vpnSiteParameters.bgpProperties.peerWeight] The weight - * added to routes learned from this BGP speaker. - * - * @param {string} [vpnSiteParameters.provisioningState] The provisioning state - * of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {boolean} [vpnSiteParameters.isSecuritySite] IsSecuritySite flag - * - * @param {string} [vpnSiteParameters.id] Resource ID. - * - * @param {string} [vpnSiteParameters.location] Resource location. - * - * @param {object} [vpnSiteParameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.VpnSite, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates a VpnSite resource if it doesn't exist else updates the existing - * VpnSite. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being created or - * updated. - * - * @param {object} vpnSiteParameters Parameters supplied to create or update - * VpnSite. - * - * @param {object} [vpnSiteParameters.virtualWan] The VirtualWAN to which the - * vpnSite belongs - * - * @param {string} [vpnSiteParameters.virtualWan.id] Resource ID. - * - * @param {object} [vpnSiteParameters.deviceProperties] The device properties - * - * @param {string} [vpnSiteParameters.deviceProperties.deviceVendor] Name of - * the device Vendor. - * - * @param {string} [vpnSiteParameters.deviceProperties.deviceModel] Model of - * the device. - * - * @param {number} [vpnSiteParameters.deviceProperties.linkSpeedInMbps] Link - * speed. - * - * @param {string} [vpnSiteParameters.ipAddress] The ip-address for the - * vpn-site. - * - * @param {string} [vpnSiteParameters.siteKey] The key for vpn-site that can be - * used for connections. - * - * @param {object} [vpnSiteParameters.addressSpace] The AddressSpace that - * contains an array of IP address ranges. - * - * @param {array} [vpnSiteParameters.addressSpace.addressPrefixes] A list of - * address blocks reserved for this virtual network in CIDR notation. - * - * @param {object} [vpnSiteParameters.bgpProperties] The set of bgp properties. - * - * @param {number} [vpnSiteParameters.bgpProperties.asn] The BGP speaker's ASN. - * - * @param {string} [vpnSiteParameters.bgpProperties.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [vpnSiteParameters.bgpProperties.peerWeight] The weight - * added to routes learned from this BGP speaker. - * - * @param {string} [vpnSiteParameters.provisioningState] The provisioning state - * of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {boolean} [vpnSiteParameters.isSecuritySite] IsSecuritySite flag - * - * @param {string} [vpnSiteParameters.id] Resource ID. - * - * @param {string} [vpnSiteParameters.location] Resource location. - * - * @param {object} [vpnSiteParameters.tags] Resource tags. - * - * @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 {VpnSite} - 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. - * - * {VpnSite} [result] - The deserialized result object if an error did not occur. - * See {@link VpnSite} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.VpnSite, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.VpnSite, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.VpnSite, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates VpnSite tags. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being updated. - * - * @param {object} vpnSiteParameters Parameters supplied to update VpnSite - * tags. - * - * @param {object} [vpnSiteParameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates VpnSite tags. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being updated. - * - * @param {object} vpnSiteParameters Parameters supplied to update VpnSite - * tags. - * - * @param {object} [vpnSiteParameters.tags] Resource tags. - * - * @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 {VpnSite} - 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. - * - * {VpnSite} [result] - The deserialized result object if an error did not occur. - * See {@link VpnSite} 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. - */ - beginUpdateTags(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, vpnSiteName: string, vpnSiteParameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes a VpnSite. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being deleted. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, vpnSiteName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes a VpnSite. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being deleted. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, vpnSiteName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, vpnSiteName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, vpnSiteName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all the vpnSites in a resource group. - * - * @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. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all the vpnSites in a resource group. - * - * @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 {ListVpnSitesResult} - 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. - * - * {ListVpnSitesResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListVpnSitesResult} 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. - */ - listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all the VpnSites in a subscription. - * - * @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>; - - /** - * Lists all the VpnSites in a subscription. - * - * @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 {ListVpnSitesResult} - 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. - * - * {ListVpnSitesResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListVpnSitesResult} 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 - * VpnSitesConfiguration - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface VpnSitesConfiguration { - - - /** - * Gives the sas-url to download the configurations for vpn-sites in a resource - * group. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} virtualWANName The name of the VirtualWAN for which - * configuration of all vpn-sites is needed. - * - * @param {object} request Parameters supplied to download vpn-sites - * configuration. - * - * @param {array} [request.vpnSites] List of resource-ids of the vpn-sites for - * which config is to be downloaded. - * - * @param {string} [request.outputBlobSasUrl] The sas-url to download the - * configurations for vpn-sites - * - * @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. - */ - downloadWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, request: models.GetVpnSitesConfigurationRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gives the sas-url to download the configurations for vpn-sites in a resource - * group. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} virtualWANName The name of the VirtualWAN for which - * configuration of all vpn-sites is needed. - * - * @param {object} request Parameters supplied to download vpn-sites - * configuration. - * - * @param {array} [request.vpnSites] List of resource-ids of the vpn-sites for - * which config is to be downloaded. - * - * @param {string} [request.outputBlobSasUrl] The sas-url to download the - * configurations for vpn-sites - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - download(resourceGroupName: string, virtualWANName: string, request: models.GetVpnSitesConfigurationRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - download(resourceGroupName: string, virtualWANName: string, request: models.GetVpnSitesConfigurationRequest, callback: ServiceCallback): void; - download(resourceGroupName: string, virtualWANName: string, request: models.GetVpnSitesConfigurationRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gives the sas-url to download the configurations for vpn-sites in a resource - * group. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} virtualWANName The name of the VirtualWAN for which - * configuration of all vpn-sites is needed. - * - * @param {object} request Parameters supplied to download vpn-sites - * configuration. - * - * @param {array} [request.vpnSites] List of resource-ids of the vpn-sites for - * which config is to be downloaded. - * - * @param {string} [request.outputBlobSasUrl] The sas-url to download the - * configurations for vpn-sites - * - * @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. - */ - beginDownloadWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, request: models.GetVpnSitesConfigurationRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gives the sas-url to download the configurations for vpn-sites in a resource - * group. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} virtualWANName The name of the VirtualWAN for which - * configuration of all vpn-sites is needed. - * - * @param {object} request Parameters supplied to download vpn-sites - * configuration. - * - * @param {array} [request.vpnSites] List of resource-ids of the vpn-sites for - * which config is to be downloaded. - * - * @param {string} [request.outputBlobSasUrl] The sas-url to download the - * configurations for vpn-sites - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDownload(resourceGroupName: string, virtualWANName: string, request: models.GetVpnSitesConfigurationRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDownload(resourceGroupName: string, virtualWANName: string, request: models.GetVpnSitesConfigurationRequest, callback: ServiceCallback): void; - beginDownload(resourceGroupName: string, virtualWANName: string, request: models.GetVpnSitesConfigurationRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * VirtualHubs - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface VirtualHubs { - - - /** - * Retrieves the details of a VirtualHub. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @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, virtualHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves the details of a VirtualHub. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @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 {VirtualHub} - 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. - * - * {VirtualHub} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualHub} 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, virtualHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, virtualHubName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, virtualHubName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates a VirtualHub resource if it doesn't exist else updates the existing - * VirtualHub. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @param {object} virtualHubParameters Parameters supplied to create or update - * VirtualHub. - * - * @param {object} [virtualHubParameters.virtualWan] The VirtualWAN to which - * the VirtualHub belongs - * - * @param {object} [virtualHubParameters.vpnGateway] The VpnGateway associated - * with this VirtualHub - * - * @param {object} [virtualHubParameters.p2SVpnGateway] The P2SVpnGateway - * associated with this VirtualHub - * - * @param {object} [virtualHubParameters.expressRouteGateway] The - * expressRouteGateway associated with this VirtualHub - * - * @param {string} [virtualHubParameters.expressRouteGateway.id] Resource ID. - * - * @param {array} [virtualHubParameters.virtualNetworkConnections] list of all - * vnet connections with this VirtualHub. - * - * @param {string} [virtualHubParameters.addressPrefix] Address-prefix for this - * VirtualHub. - * - * @param {object} [virtualHubParameters.routeTable] The routeTable associated - * with this virtual hub. - * - * @param {array} [virtualHubParameters.routeTable.routes] list of all routes. - * - * @param {string} [virtualHubParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {string} [virtualHubParameters.id] Resource ID. - * - * @param {string} [virtualHubParameters.location] Resource location. - * - * @param {object} [virtualHubParameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.VirtualHub, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates a VirtualHub resource if it doesn't exist else updates the existing - * VirtualHub. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @param {object} virtualHubParameters Parameters supplied to create or update - * VirtualHub. - * - * @param {object} [virtualHubParameters.virtualWan] The VirtualWAN to which - * the VirtualHub belongs - * - * @param {object} [virtualHubParameters.vpnGateway] The VpnGateway associated - * with this VirtualHub - * - * @param {object} [virtualHubParameters.p2SVpnGateway] The P2SVpnGateway - * associated with this VirtualHub - * - * @param {object} [virtualHubParameters.expressRouteGateway] The - * expressRouteGateway associated with this VirtualHub - * - * @param {string} [virtualHubParameters.expressRouteGateway.id] Resource ID. - * - * @param {array} [virtualHubParameters.virtualNetworkConnections] list of all - * vnet connections with this VirtualHub. - * - * @param {string} [virtualHubParameters.addressPrefix] Address-prefix for this - * VirtualHub. - * - * @param {object} [virtualHubParameters.routeTable] The routeTable associated - * with this virtual hub. - * - * @param {array} [virtualHubParameters.routeTable.routes] list of all routes. - * - * @param {string} [virtualHubParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {string} [virtualHubParameters.id] Resource ID. - * - * @param {string} [virtualHubParameters.location] Resource location. - * - * @param {object} [virtualHubParameters.tags] Resource tags. - * - * @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 {VirtualHub} - 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. - * - * {VirtualHub} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualHub} 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. - */ - createOrUpdate(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.VirtualHub, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.VirtualHub, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.VirtualHub, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates VirtualHub tags. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @param {object} virtualHubParameters Parameters supplied to update - * VirtualHub tags. - * - * @param {object} [virtualHubParameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates VirtualHub tags. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @param {object} virtualHubParameters Parameters supplied to update - * VirtualHub tags. - * - * @param {object} [virtualHubParameters.tags] Resource tags. - * - * @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 {VirtualHub} - 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. - * - * {VirtualHub} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualHub} 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. - */ - updateTags(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes a VirtualHub. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes a VirtualHub. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, virtualHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, virtualHubName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, virtualHubName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all the VirtualHubs in a resource group. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all the VirtualHubs in a resource group. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @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 {ListVirtualHubsResult} - 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. - * - * {ListVirtualHubsResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListVirtualHubsResult} 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. - */ - listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all the VirtualHubs in a subscription. - * - * @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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all the VirtualHubs in a subscription. - * - * @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 {ListVirtualHubsResult} - 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. - * - * {ListVirtualHubsResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListVirtualHubsResult} 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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates a VirtualHub resource if it doesn't exist else updates the existing - * VirtualHub. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @param {object} virtualHubParameters Parameters supplied to create or update - * VirtualHub. - * - * @param {object} [virtualHubParameters.virtualWan] The VirtualWAN to which - * the VirtualHub belongs - * - * @param {object} [virtualHubParameters.vpnGateway] The VpnGateway associated - * with this VirtualHub - * - * @param {object} [virtualHubParameters.p2SVpnGateway] The P2SVpnGateway - * associated with this VirtualHub - * - * @param {object} [virtualHubParameters.expressRouteGateway] The - * expressRouteGateway associated with this VirtualHub - * - * @param {string} [virtualHubParameters.expressRouteGateway.id] Resource ID. - * - * @param {array} [virtualHubParameters.virtualNetworkConnections] list of all - * vnet connections with this VirtualHub. - * - * @param {string} [virtualHubParameters.addressPrefix] Address-prefix for this - * VirtualHub. - * - * @param {object} [virtualHubParameters.routeTable] The routeTable associated - * with this virtual hub. - * - * @param {array} [virtualHubParameters.routeTable.routes] list of all routes. - * - * @param {string} [virtualHubParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {string} [virtualHubParameters.id] Resource ID. - * - * @param {string} [virtualHubParameters.location] Resource location. - * - * @param {object} [virtualHubParameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.VirtualHub, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates a VirtualHub resource if it doesn't exist else updates the existing - * VirtualHub. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @param {object} virtualHubParameters Parameters supplied to create or update - * VirtualHub. - * - * @param {object} [virtualHubParameters.virtualWan] The VirtualWAN to which - * the VirtualHub belongs - * - * @param {object} [virtualHubParameters.vpnGateway] The VpnGateway associated - * with this VirtualHub - * - * @param {object} [virtualHubParameters.p2SVpnGateway] The P2SVpnGateway - * associated with this VirtualHub - * - * @param {object} [virtualHubParameters.expressRouteGateway] The - * expressRouteGateway associated with this VirtualHub - * - * @param {string} [virtualHubParameters.expressRouteGateway.id] Resource ID. - * - * @param {array} [virtualHubParameters.virtualNetworkConnections] list of all - * vnet connections with this VirtualHub. - * - * @param {string} [virtualHubParameters.addressPrefix] Address-prefix for this - * VirtualHub. - * - * @param {object} [virtualHubParameters.routeTable] The routeTable associated - * with this virtual hub. - * - * @param {array} [virtualHubParameters.routeTable.routes] list of all routes. - * - * @param {string} [virtualHubParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {string} [virtualHubParameters.id] Resource ID. - * - * @param {string} [virtualHubParameters.location] Resource location. - * - * @param {object} [virtualHubParameters.tags] Resource tags. - * - * @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 {VirtualHub} - 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. - * - * {VirtualHub} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualHub} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.VirtualHub, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.VirtualHub, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.VirtualHub, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates VirtualHub tags. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @param {object} virtualHubParameters Parameters supplied to update - * VirtualHub tags. - * - * @param {object} [virtualHubParameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates VirtualHub tags. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @param {object} virtualHubParameters Parameters supplied to update - * VirtualHub tags. - * - * @param {object} [virtualHubParameters.tags] Resource tags. - * - * @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 {VirtualHub} - 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. - * - * {VirtualHub} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualHub} 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. - */ - beginUpdateTags(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, virtualHubName: string, virtualHubParameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes a VirtualHub. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes a VirtualHub. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, virtualHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, virtualHubName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, virtualHubName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all the VirtualHubs in a resource group. - * - * @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. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all the VirtualHubs in a resource group. - * - * @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 {ListVirtualHubsResult} - 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. - * - * {ListVirtualHubsResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListVirtualHubsResult} 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. - */ - listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all the VirtualHubs in a subscription. - * - * @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>; - - /** - * Lists all the VirtualHubs in a subscription. - * - * @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 {ListVirtualHubsResult} - 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. - * - * {ListVirtualHubsResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListVirtualHubsResult} 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 - * HubVirtualNetworkConnections - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface HubVirtualNetworkConnections { - - - /** - * Retrieves the details of a HubVirtualNetworkConnection. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @param {string} connectionName The name of the vpn 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, virtualHubName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves the details of a HubVirtualNetworkConnection. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @param {string} connectionName The name of the vpn 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 {HubVirtualNetworkConnection} - 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. - * - * {HubVirtualNetworkConnection} [result] - The deserialized result object if an error did not occur. - * See {@link HubVirtualNetworkConnection} 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, virtualHubName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, virtualHubName: string, connectionName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, virtualHubName: string, connectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves the details of all HubVirtualNetworkConnections. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @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, virtualHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves the details of all HubVirtualNetworkConnections. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @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 {ListHubVirtualNetworkConnectionsResult} - 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. - * - * {ListHubVirtualNetworkConnectionsResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListHubVirtualNetworkConnectionsResult} 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, virtualHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, virtualHubName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, virtualHubName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves the details of all HubVirtualNetworkConnections. - * - * @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>; - - /** - * Retrieves the details of all HubVirtualNetworkConnections. - * - * @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 {ListHubVirtualNetworkConnectionsResult} - 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. - * - * {ListHubVirtualNetworkConnectionsResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListHubVirtualNetworkConnectionsResult} 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 - * VpnGateways - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface VpnGateways { - - - /** - * Retrieves the details of a virtual wan vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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, gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves the details of a virtual wan vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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 {VpnGateway} - 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. - * - * {VpnGateway} [result] - The deserialized result object if an error did not occur. - * See {@link VpnGateway} 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, gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, gatewayName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, gatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates a virtual wan vpn gateway if it doesn't exist else updates the - * existing gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} vpnGatewayParameters Parameters supplied to create or Update - * a virtual wan vpn gateway. - * - * @param {object} [vpnGatewayParameters.virtualHub] The VirtualHub to which - * the gateway belongs - * - * @param {string} [vpnGatewayParameters.virtualHub.id] Resource ID. - * - * @param {array} [vpnGatewayParameters.connections] list of all vpn - * connections to the gateway. - * - * @param {object} [vpnGatewayParameters.bgpSettings] Local network gateway's - * BGP speaker settings. - * - * @param {number} [vpnGatewayParameters.bgpSettings.asn] The BGP speaker's - * ASN. - * - * @param {string} [vpnGatewayParameters.bgpSettings.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [vpnGatewayParameters.bgpSettings.peerWeight] The weight - * added to routes learned from this BGP speaker. - * - * @param {string} [vpnGatewayParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {number} [vpnGatewayParameters.vpnGatewayScaleUnit] The scale unit - * for this vpn gateway. - * - * @param {string} [vpnGatewayParameters.id] Resource ID. - * - * @param {string} [vpnGatewayParameters.location] Resource location. - * - * @param {object} [vpnGatewayParameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.VpnGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates a virtual wan vpn gateway if it doesn't exist else updates the - * existing gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} vpnGatewayParameters Parameters supplied to create or Update - * a virtual wan vpn gateway. - * - * @param {object} [vpnGatewayParameters.virtualHub] The VirtualHub to which - * the gateway belongs - * - * @param {string} [vpnGatewayParameters.virtualHub.id] Resource ID. - * - * @param {array} [vpnGatewayParameters.connections] list of all vpn - * connections to the gateway. - * - * @param {object} [vpnGatewayParameters.bgpSettings] Local network gateway's - * BGP speaker settings. - * - * @param {number} [vpnGatewayParameters.bgpSettings.asn] The BGP speaker's - * ASN. - * - * @param {string} [vpnGatewayParameters.bgpSettings.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [vpnGatewayParameters.bgpSettings.peerWeight] The weight - * added to routes learned from this BGP speaker. - * - * @param {string} [vpnGatewayParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {number} [vpnGatewayParameters.vpnGatewayScaleUnit] The scale unit - * for this vpn gateway. - * - * @param {string} [vpnGatewayParameters.id] Resource ID. - * - * @param {string} [vpnGatewayParameters.location] Resource location. - * - * @param {object} [vpnGatewayParameters.tags] Resource tags. - * - * @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 {VpnGateway} - 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. - * - * {VpnGateway} [result] - The deserialized result object if an error did not occur. - * See {@link VpnGateway} 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. - */ - createOrUpdate(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.VpnGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.VpnGateway, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.VpnGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates virtual wan vpn gateway tags. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} vpnGatewayParameters Parameters supplied to update a virtual - * wan vpn gateway tags. - * - * @param {object} [vpnGatewayParameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates virtual wan vpn gateway tags. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} vpnGatewayParameters Parameters supplied to update a virtual - * wan vpn gateway tags. - * - * @param {object} [vpnGatewayParameters.tags] Resource tags. - * - * @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 {VpnGateway} - 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. - * - * {VpnGateway} [result] - The deserialized result object if an error did not occur. - * See {@link VpnGateway} 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. - */ - updateTags(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes a virtual wan vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes a virtual wan vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, gatewayName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, gatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all the VpnGateways in a resource group. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all the VpnGateways in a resource group. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @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 {ListVpnGatewaysResult} - 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. - * - * {ListVpnGatewaysResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListVpnGatewaysResult} 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. - */ - listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all the VpnGateways in a subscription. - * - * @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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all the VpnGateways in a subscription. - * - * @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 {ListVpnGatewaysResult} - 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. - * - * {ListVpnGatewaysResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListVpnGatewaysResult} 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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates a virtual wan vpn gateway if it doesn't exist else updates the - * existing gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} vpnGatewayParameters Parameters supplied to create or Update - * a virtual wan vpn gateway. - * - * @param {object} [vpnGatewayParameters.virtualHub] The VirtualHub to which - * the gateway belongs - * - * @param {string} [vpnGatewayParameters.virtualHub.id] Resource ID. - * - * @param {array} [vpnGatewayParameters.connections] list of all vpn - * connections to the gateway. - * - * @param {object} [vpnGatewayParameters.bgpSettings] Local network gateway's - * BGP speaker settings. - * - * @param {number} [vpnGatewayParameters.bgpSettings.asn] The BGP speaker's - * ASN. - * - * @param {string} [vpnGatewayParameters.bgpSettings.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [vpnGatewayParameters.bgpSettings.peerWeight] The weight - * added to routes learned from this BGP speaker. - * - * @param {string} [vpnGatewayParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {number} [vpnGatewayParameters.vpnGatewayScaleUnit] The scale unit - * for this vpn gateway. - * - * @param {string} [vpnGatewayParameters.id] Resource ID. - * - * @param {string} [vpnGatewayParameters.location] Resource location. - * - * @param {object} [vpnGatewayParameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.VpnGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates a virtual wan vpn gateway if it doesn't exist else updates the - * existing gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} vpnGatewayParameters Parameters supplied to create or Update - * a virtual wan vpn gateway. - * - * @param {object} [vpnGatewayParameters.virtualHub] The VirtualHub to which - * the gateway belongs - * - * @param {string} [vpnGatewayParameters.virtualHub.id] Resource ID. - * - * @param {array} [vpnGatewayParameters.connections] list of all vpn - * connections to the gateway. - * - * @param {object} [vpnGatewayParameters.bgpSettings] Local network gateway's - * BGP speaker settings. - * - * @param {number} [vpnGatewayParameters.bgpSettings.asn] The BGP speaker's - * ASN. - * - * @param {string} [vpnGatewayParameters.bgpSettings.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [vpnGatewayParameters.bgpSettings.peerWeight] The weight - * added to routes learned from this BGP speaker. - * - * @param {string} [vpnGatewayParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {number} [vpnGatewayParameters.vpnGatewayScaleUnit] The scale unit - * for this vpn gateway. - * - * @param {string} [vpnGatewayParameters.id] Resource ID. - * - * @param {string} [vpnGatewayParameters.location] Resource location. - * - * @param {object} [vpnGatewayParameters.tags] Resource tags. - * - * @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 {VpnGateway} - 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. - * - * {VpnGateway} [result] - The deserialized result object if an error did not occur. - * See {@link VpnGateway} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.VpnGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.VpnGateway, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.VpnGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates virtual wan vpn gateway tags. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} vpnGatewayParameters Parameters supplied to update a virtual - * wan vpn gateway tags. - * - * @param {object} [vpnGatewayParameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates virtual wan vpn gateway tags. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} vpnGatewayParameters Parameters supplied to update a virtual - * wan vpn gateway tags. - * - * @param {object} [vpnGatewayParameters.tags] Resource tags. - * - * @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 {VpnGateway} - 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. - * - * {VpnGateway} [result] - The deserialized result object if an error did not occur. - * See {@link VpnGateway} 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. - */ - beginUpdateTags(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, gatewayName: string, vpnGatewayParameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes a virtual wan vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes a virtual wan vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, gatewayName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, gatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all the VpnGateways in a resource group. - * - * @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. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all the VpnGateways in a resource group. - * - * @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 {ListVpnGatewaysResult} - 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. - * - * {ListVpnGatewaysResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListVpnGatewaysResult} 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. - */ - listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all the VpnGateways in a subscription. - * - * @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>; - - /** - * Lists all the VpnGateways in a subscription. - * - * @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 {ListVpnGatewaysResult} - 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. - * - * {ListVpnGatewaysResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListVpnGatewaysResult} 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 - * VpnConnections - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface VpnConnections { - - - /** - * Retrieves the details of a vpn connection. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {string} connectionName The name of the vpn 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, gatewayName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves the details of a vpn connection. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {string} connectionName The name of the vpn 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 {VpnConnection} - 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. - * - * {VpnConnection} [result] - The deserialized result object if an error did not occur. - * See {@link VpnConnection} 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, gatewayName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, gatewayName: string, connectionName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, gatewayName: string, connectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else - * updates the existing connection. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {string} connectionName The name of the connection. - * - * @param {object} vpnConnectionParameters Parameters supplied to create or - * Update a VPN Connection. - * - * @param {object} [vpnConnectionParameters.remoteVpnSite] Id of the connected - * vpn site. - * - * @param {string} [vpnConnectionParameters.remoteVpnSite.id] Resource ID. - * - * @param {number} [vpnConnectionParameters.routingWeight] routing weight for - * vpn connection. - * - * @param {string} [vpnConnectionParameters.connectionStatus] The connection - * status. Possible values include: 'Unknown', 'Connecting', 'Connected', - * 'NotConnected' - * - * @param {string} [vpnConnectionParameters.vpnConnectionProtocolType] - * Connection protocol used for this connection. Possible values include: - * 'IKEv2', 'IKEv1' - * - * @param {number} [vpnConnectionParameters.connectionBandwidth] Expected - * bandwidth in MBPS. - * - * @param {string} [vpnConnectionParameters.sharedKey] SharedKey for the vpn - * connection. - * - * @param {boolean} [vpnConnectionParameters.enableBgp] EnableBgp flag - * - * @param {array} [vpnConnectionParameters.ipsecPolicies] The IPSec Policies to - * be considered by this connection. - * - * @param {boolean} [vpnConnectionParameters.enableRateLimiting] EnableBgp flag - * - * @param {boolean} [vpnConnectionParameters.enableInternetSecurity] Enable - * internet security - * - * @param {string} [vpnConnectionParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {string} [vpnConnectionParameters.name] The name of the resource that - * is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [vpnConnectionParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, connectionName: string, vpnConnectionParameters: models.VpnConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else - * updates the existing connection. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {string} connectionName The name of the connection. - * - * @param {object} vpnConnectionParameters Parameters supplied to create or - * Update a VPN Connection. - * - * @param {object} [vpnConnectionParameters.remoteVpnSite] Id of the connected - * vpn site. - * - * @param {string} [vpnConnectionParameters.remoteVpnSite.id] Resource ID. - * - * @param {number} [vpnConnectionParameters.routingWeight] routing weight for - * vpn connection. - * - * @param {string} [vpnConnectionParameters.connectionStatus] The connection - * status. Possible values include: 'Unknown', 'Connecting', 'Connected', - * 'NotConnected' - * - * @param {string} [vpnConnectionParameters.vpnConnectionProtocolType] - * Connection protocol used for this connection. Possible values include: - * 'IKEv2', 'IKEv1' - * - * @param {number} [vpnConnectionParameters.connectionBandwidth] Expected - * bandwidth in MBPS. - * - * @param {string} [vpnConnectionParameters.sharedKey] SharedKey for the vpn - * connection. - * - * @param {boolean} [vpnConnectionParameters.enableBgp] EnableBgp flag - * - * @param {array} [vpnConnectionParameters.ipsecPolicies] The IPSec Policies to - * be considered by this connection. - * - * @param {boolean} [vpnConnectionParameters.enableRateLimiting] EnableBgp flag - * - * @param {boolean} [vpnConnectionParameters.enableInternetSecurity] Enable - * internet security - * - * @param {string} [vpnConnectionParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {string} [vpnConnectionParameters.name] The name of the resource that - * is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [vpnConnectionParameters.id] Resource ID. - * - * @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 {VpnConnection} - 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. - * - * {VpnConnection} [result] - The deserialized result object if an error did not occur. - * See {@link VpnConnection} 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. - */ - createOrUpdate(resourceGroupName: string, gatewayName: string, connectionName: string, vpnConnectionParameters: models.VpnConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, gatewayName: string, connectionName: string, vpnConnectionParameters: models.VpnConnection, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, gatewayName: string, connectionName: string, vpnConnectionParameters: models.VpnConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes a vpn connection. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {string} connectionName The name of the 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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes a vpn connection. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {string} connectionName The name of the 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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, gatewayName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, gatewayName: string, connectionName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, gatewayName: string, connectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves all vpn connections for a particular virtual wan vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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. - */ - listByVpnGatewayWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all vpn connections for a particular virtual wan vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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 {ListVpnConnectionsResult} - 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. - * - * {ListVpnConnectionsResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListVpnConnectionsResult} 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. - */ - listByVpnGateway(resourceGroupName: string, gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByVpnGateway(resourceGroupName: string, gatewayName: string, callback: ServiceCallback): void; - listByVpnGateway(resourceGroupName: string, gatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else - * updates the existing connection. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {string} connectionName The name of the connection. - * - * @param {object} vpnConnectionParameters Parameters supplied to create or - * Update a VPN Connection. - * - * @param {object} [vpnConnectionParameters.remoteVpnSite] Id of the connected - * vpn site. - * - * @param {string} [vpnConnectionParameters.remoteVpnSite.id] Resource ID. - * - * @param {number} [vpnConnectionParameters.routingWeight] routing weight for - * vpn connection. - * - * @param {string} [vpnConnectionParameters.connectionStatus] The connection - * status. Possible values include: 'Unknown', 'Connecting', 'Connected', - * 'NotConnected' - * - * @param {string} [vpnConnectionParameters.vpnConnectionProtocolType] - * Connection protocol used for this connection. Possible values include: - * 'IKEv2', 'IKEv1' - * - * @param {number} [vpnConnectionParameters.connectionBandwidth] Expected - * bandwidth in MBPS. - * - * @param {string} [vpnConnectionParameters.sharedKey] SharedKey for the vpn - * connection. - * - * @param {boolean} [vpnConnectionParameters.enableBgp] EnableBgp flag - * - * @param {array} [vpnConnectionParameters.ipsecPolicies] The IPSec Policies to - * be considered by this connection. - * - * @param {boolean} [vpnConnectionParameters.enableRateLimiting] EnableBgp flag - * - * @param {boolean} [vpnConnectionParameters.enableInternetSecurity] Enable - * internet security - * - * @param {string} [vpnConnectionParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {string} [vpnConnectionParameters.name] The name of the resource that - * is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [vpnConnectionParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, connectionName: string, vpnConnectionParameters: models.VpnConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else - * updates the existing connection. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {string} connectionName The name of the connection. - * - * @param {object} vpnConnectionParameters Parameters supplied to create or - * Update a VPN Connection. - * - * @param {object} [vpnConnectionParameters.remoteVpnSite] Id of the connected - * vpn site. - * - * @param {string} [vpnConnectionParameters.remoteVpnSite.id] Resource ID. - * - * @param {number} [vpnConnectionParameters.routingWeight] routing weight for - * vpn connection. - * - * @param {string} [vpnConnectionParameters.connectionStatus] The connection - * status. Possible values include: 'Unknown', 'Connecting', 'Connected', - * 'NotConnected' - * - * @param {string} [vpnConnectionParameters.vpnConnectionProtocolType] - * Connection protocol used for this connection. Possible values include: - * 'IKEv2', 'IKEv1' - * - * @param {number} [vpnConnectionParameters.connectionBandwidth] Expected - * bandwidth in MBPS. - * - * @param {string} [vpnConnectionParameters.sharedKey] SharedKey for the vpn - * connection. - * - * @param {boolean} [vpnConnectionParameters.enableBgp] EnableBgp flag - * - * @param {array} [vpnConnectionParameters.ipsecPolicies] The IPSec Policies to - * be considered by this connection. - * - * @param {boolean} [vpnConnectionParameters.enableRateLimiting] EnableBgp flag - * - * @param {boolean} [vpnConnectionParameters.enableInternetSecurity] Enable - * internet security - * - * @param {string} [vpnConnectionParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {string} [vpnConnectionParameters.name] The name of the resource that - * is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [vpnConnectionParameters.id] Resource ID. - * - * @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 {VpnConnection} - 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. - * - * {VpnConnection} [result] - The deserialized result object if an error did not occur. - * See {@link VpnConnection} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, gatewayName: string, connectionName: string, vpnConnectionParameters: models.VpnConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, gatewayName: string, connectionName: string, vpnConnectionParameters: models.VpnConnection, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, gatewayName: string, connectionName: string, vpnConnectionParameters: models.VpnConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes a vpn connection. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {string} connectionName The name of the 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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes a vpn connection. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {string} connectionName The name of the 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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, gatewayName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, gatewayName: string, connectionName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, gatewayName: string, connectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves all vpn connections for a particular virtual wan vpn gateway. - * - * @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. - */ - listByVpnGatewayNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all vpn connections for a particular virtual wan vpn gateway. - * - * @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 {ListVpnConnectionsResult} - 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. - * - * {ListVpnConnectionsResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListVpnConnectionsResult} 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. - */ - listByVpnGatewayNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByVpnGatewayNext(nextPageLink: string, callback: ServiceCallback): void; - listByVpnGatewayNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * P2sVpnServerConfigurations - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface P2sVpnServerConfigurations { - - - /** - * Retrieves the details of a P2SVpnServerConfiguration. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnServerConfiguration. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @param {string} p2SVpnServerConfigurationName The name of the - * P2SVpnServerConfiguration. - * - * @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, virtualWanName: string, p2SVpnServerConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves the details of a P2SVpnServerConfiguration. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnServerConfiguration. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @param {string} p2SVpnServerConfigurationName The name of the - * P2SVpnServerConfiguration. - * - * @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 {P2SVpnServerConfiguration} - 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. - * - * {P2SVpnServerConfiguration} [result] - The deserialized result object if an error did not occur. - * See {@link P2SVpnServerConfiguration} 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, virtualWanName: string, p2SVpnServerConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, virtualWanName: string, p2SVpnServerConfigurationName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, virtualWanName: string, p2SVpnServerConfigurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it - * doesn't exist else updates the existing P2SVpnServerConfiguration. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @param {string} p2SVpnServerConfigurationName The name of the - * P2SVpnServerConfiguration. - * - * @param {object} p2SVpnServerConfigurationParameters Parameters supplied to - * create or Update a P2SVpnServerConfiguration. - * - * @param {string} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigurationPropertiesName] - * The name of the P2SVpnServerConfiguration that is unique within a VirtualWan - * in a resource group. This name can be used to access the resource along with - * Paren VirtualWan resource name. - * - * @param {array} [p2SVpnServerConfigurationParameters.vpnProtocols] - * vpnProtocols for the P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigVpnClientRootCertificates] - * VPN client root certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigVpnClientRevokedCertificates] - * VPN client revoked certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigRadiusServerRootCertificates] - * Radius Server root certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigRadiusClientRootCertificates] - * Radius client root certificate of P2SVpnServerConfiguration. - * - * @param {array} [p2SVpnServerConfigurationParameters.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for P2SVpnServerConfiguration. - * - * @param {string} [p2SVpnServerConfigurationParameters.radiusServerAddress] - * The radius server address property of the P2SVpnServerConfiguration resource - * for point to site client connection. - * - * @param {string} [p2SVpnServerConfigurationParameters.radiusServerSecret] The - * radius secret property of the P2SVpnServerConfiguration resource for for - * point to site client connection. - * - * @param {string} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigurationPropertiesEtag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} [p2SVpnServerConfigurationParameters.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [p2SVpnServerConfigurationParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualWanName: string, p2SVpnServerConfigurationName: string, p2SVpnServerConfigurationParameters: models.P2SVpnServerConfiguration, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it - * doesn't exist else updates the existing P2SVpnServerConfiguration. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @param {string} p2SVpnServerConfigurationName The name of the - * P2SVpnServerConfiguration. - * - * @param {object} p2SVpnServerConfigurationParameters Parameters supplied to - * create or Update a P2SVpnServerConfiguration. - * - * @param {string} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigurationPropertiesName] - * The name of the P2SVpnServerConfiguration that is unique within a VirtualWan - * in a resource group. This name can be used to access the resource along with - * Paren VirtualWan resource name. - * - * @param {array} [p2SVpnServerConfigurationParameters.vpnProtocols] - * vpnProtocols for the P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigVpnClientRootCertificates] - * VPN client root certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigVpnClientRevokedCertificates] - * VPN client revoked certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigRadiusServerRootCertificates] - * Radius Server root certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigRadiusClientRootCertificates] - * Radius client root certificate of P2SVpnServerConfiguration. - * - * @param {array} [p2SVpnServerConfigurationParameters.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for P2SVpnServerConfiguration. - * - * @param {string} [p2SVpnServerConfigurationParameters.radiusServerAddress] - * The radius server address property of the P2SVpnServerConfiguration resource - * for point to site client connection. - * - * @param {string} [p2SVpnServerConfigurationParameters.radiusServerSecret] The - * radius secret property of the P2SVpnServerConfiguration resource for for - * point to site client connection. - * - * @param {string} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigurationPropertiesEtag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} [p2SVpnServerConfigurationParameters.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [p2SVpnServerConfigurationParameters.id] Resource ID. - * - * @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 {P2SVpnServerConfiguration} - 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. - * - * {P2SVpnServerConfiguration} [result] - The deserialized result object if an error did not occur. - * See {@link P2SVpnServerConfiguration} 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. - */ - createOrUpdate(resourceGroupName: string, virtualWanName: string, p2SVpnServerConfigurationName: string, p2SVpnServerConfigurationParameters: models.P2SVpnServerConfiguration, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, virtualWanName: string, p2SVpnServerConfigurationName: string, p2SVpnServerConfigurationParameters: models.P2SVpnServerConfiguration, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, virtualWanName: string, p2SVpnServerConfigurationName: string, p2SVpnServerConfigurationParameters: models.P2SVpnServerConfiguration, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes a P2SVpnServerConfiguration. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnServerConfiguration. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @param {string} p2SVpnServerConfigurationName The name of the - * P2SVpnServerConfiguration. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualWanName: string, p2SVpnServerConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes a P2SVpnServerConfiguration. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnServerConfiguration. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @param {string} p2SVpnServerConfigurationName The name of the - * P2SVpnServerConfiguration. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, virtualWanName: string, p2SVpnServerConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, virtualWanName: string, p2SVpnServerConfigurationName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, virtualWanName: string, p2SVpnServerConfigurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @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. - */ - listByVirtualWanWithHttpOperationResponse(resourceGroupName: string, virtualWanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @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 {ListP2SVpnServerConfigurationsResult} - 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. - * - * {ListP2SVpnServerConfigurationsResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListP2SVpnServerConfigurationsResult} 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. - */ - listByVirtualWan(resourceGroupName: string, virtualWanName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByVirtualWan(resourceGroupName: string, virtualWanName: string, callback: ServiceCallback): void; - listByVirtualWan(resourceGroupName: string, virtualWanName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it - * doesn't exist else updates the existing P2SVpnServerConfiguration. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @param {string} p2SVpnServerConfigurationName The name of the - * P2SVpnServerConfiguration. - * - * @param {object} p2SVpnServerConfigurationParameters Parameters supplied to - * create or Update a P2SVpnServerConfiguration. - * - * @param {string} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigurationPropertiesName] - * The name of the P2SVpnServerConfiguration that is unique within a VirtualWan - * in a resource group. This name can be used to access the resource along with - * Paren VirtualWan resource name. - * - * @param {array} [p2SVpnServerConfigurationParameters.vpnProtocols] - * vpnProtocols for the P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigVpnClientRootCertificates] - * VPN client root certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigVpnClientRevokedCertificates] - * VPN client revoked certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigRadiusServerRootCertificates] - * Radius Server root certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigRadiusClientRootCertificates] - * Radius client root certificate of P2SVpnServerConfiguration. - * - * @param {array} [p2SVpnServerConfigurationParameters.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for P2SVpnServerConfiguration. - * - * @param {string} [p2SVpnServerConfigurationParameters.radiusServerAddress] - * The radius server address property of the P2SVpnServerConfiguration resource - * for point to site client connection. - * - * @param {string} [p2SVpnServerConfigurationParameters.radiusServerSecret] The - * radius secret property of the P2SVpnServerConfiguration resource for for - * point to site client connection. - * - * @param {string} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigurationPropertiesEtag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} [p2SVpnServerConfigurationParameters.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [p2SVpnServerConfigurationParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, virtualWanName: string, p2SVpnServerConfigurationName: string, p2SVpnServerConfigurationParameters: models.P2SVpnServerConfiguration, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it - * doesn't exist else updates the existing P2SVpnServerConfiguration. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @param {string} p2SVpnServerConfigurationName The name of the - * P2SVpnServerConfiguration. - * - * @param {object} p2SVpnServerConfigurationParameters Parameters supplied to - * create or Update a P2SVpnServerConfiguration. - * - * @param {string} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigurationPropertiesName] - * The name of the P2SVpnServerConfiguration that is unique within a VirtualWan - * in a resource group. This name can be used to access the resource along with - * Paren VirtualWan resource name. - * - * @param {array} [p2SVpnServerConfigurationParameters.vpnProtocols] - * vpnProtocols for the P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigVpnClientRootCertificates] - * VPN client root certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigVpnClientRevokedCertificates] - * VPN client revoked certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigRadiusServerRootCertificates] - * Radius Server root certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigRadiusClientRootCertificates] - * Radius client root certificate of P2SVpnServerConfiguration. - * - * @param {array} [p2SVpnServerConfigurationParameters.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for P2SVpnServerConfiguration. - * - * @param {string} [p2SVpnServerConfigurationParameters.radiusServerAddress] - * The radius server address property of the P2SVpnServerConfiguration resource - * for point to site client connection. - * - * @param {string} [p2SVpnServerConfigurationParameters.radiusServerSecret] The - * radius secret property of the P2SVpnServerConfiguration resource for for - * point to site client connection. - * - * @param {string} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigurationPropertiesEtag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} [p2SVpnServerConfigurationParameters.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [p2SVpnServerConfigurationParameters.id] Resource ID. - * - * @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 {P2SVpnServerConfiguration} - 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. - * - * {P2SVpnServerConfiguration} [result] - The deserialized result object if an error did not occur. - * See {@link P2SVpnServerConfiguration} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, virtualWanName: string, p2SVpnServerConfigurationName: string, p2SVpnServerConfigurationParameters: models.P2SVpnServerConfiguration, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, virtualWanName: string, p2SVpnServerConfigurationName: string, p2SVpnServerConfigurationParameters: models.P2SVpnServerConfiguration, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, virtualWanName: string, p2SVpnServerConfigurationName: string, p2SVpnServerConfigurationParameters: models.P2SVpnServerConfiguration, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes a P2SVpnServerConfiguration. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnServerConfiguration. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @param {string} p2SVpnServerConfigurationName The name of the - * P2SVpnServerConfiguration. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, virtualWanName: string, p2SVpnServerConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes a P2SVpnServerConfiguration. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnServerConfiguration. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @param {string} p2SVpnServerConfigurationName The name of the - * P2SVpnServerConfiguration. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, virtualWanName: string, p2SVpnServerConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, virtualWanName: string, p2SVpnServerConfigurationName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, virtualWanName: string, p2SVpnServerConfigurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. - * - * @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. - */ - listByVirtualWanNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. - * - * @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 {ListP2SVpnServerConfigurationsResult} - 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. - * - * {ListP2SVpnServerConfigurationsResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListP2SVpnServerConfigurationsResult} 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. - */ - listByVirtualWanNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByVirtualWanNext(nextPageLink: string, callback: ServiceCallback): void; - listByVirtualWanNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * P2sVpnGateways - * __NOTE__: An instance of this class is automatically created for an - * instance of the NetworkManagementClient. - */ -export interface P2sVpnGateways { - - - /** - * Retrieves the details of a virtual wan p2s vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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, gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves the details of a virtual wan p2s vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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 {P2SVpnGateway} - 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. - * - * {P2SVpnGateway} [result] - The deserialized result object if an error did not occur. - * See {@link P2SVpnGateway} 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, gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, gatewayName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, gatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the - * existing gateway. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} p2SVpnGatewayParameters Parameters supplied to create or - * Update a virtual wan p2s vpn gateway. - * - * @param {object} [p2SVpnGatewayParameters.virtualHub] The VirtualHub to which - * the gateway belongs - * - * @param {string} [p2SVpnGatewayParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {number} [p2SVpnGatewayParameters.vpnGatewayScaleUnit] The scale unit - * for this p2s vpn gateway. - * - * @param {object} [p2SVpnGatewayParameters.p2SVpnServerConfiguration] The - * P2SVpnServerConfiguration to which the p2sVpnGateway is attached to. - * - * @param {string} [p2SVpnGatewayParameters.p2SVpnServerConfiguration.id] - * Resource ID. - * - * @param {object} [p2SVpnGatewayParameters.vpnClientAddressPool] The reference - * of the address space resource which represents Address space for P2S - * VpnClient. - * - * @param {array} - * [p2SVpnGatewayParameters.vpnClientAddressPool.addressPrefixes] A list of - * address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [p2SVpnGatewayParameters.id] Resource ID. - * - * @param {string} [p2SVpnGatewayParameters.location] Resource location. - * - * @param {object} [p2SVpnGatewayParameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, p2SVpnGatewayParameters: models.P2SVpnGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the - * existing gateway. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} p2SVpnGatewayParameters Parameters supplied to create or - * Update a virtual wan p2s vpn gateway. - * - * @param {object} [p2SVpnGatewayParameters.virtualHub] The VirtualHub to which - * the gateway belongs - * - * @param {string} [p2SVpnGatewayParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {number} [p2SVpnGatewayParameters.vpnGatewayScaleUnit] The scale unit - * for this p2s vpn gateway. - * - * @param {object} [p2SVpnGatewayParameters.p2SVpnServerConfiguration] The - * P2SVpnServerConfiguration to which the p2sVpnGateway is attached to. - * - * @param {string} [p2SVpnGatewayParameters.p2SVpnServerConfiguration.id] - * Resource ID. - * - * @param {object} [p2SVpnGatewayParameters.vpnClientAddressPool] The reference - * of the address space resource which represents Address space for P2S - * VpnClient. - * - * @param {array} - * [p2SVpnGatewayParameters.vpnClientAddressPool.addressPrefixes] A list of - * address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [p2SVpnGatewayParameters.id] Resource ID. - * - * @param {string} [p2SVpnGatewayParameters.location] Resource location. - * - * @param {object} [p2SVpnGatewayParameters.tags] Resource tags. - * - * @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 {P2SVpnGateway} - 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. - * - * {P2SVpnGateway} [result] - The deserialized result object if an error did not occur. - * See {@link P2SVpnGateway} 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. - */ - createOrUpdate(resourceGroupName: string, gatewayName: string, p2SVpnGatewayParameters: models.P2SVpnGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, gatewayName: string, p2SVpnGatewayParameters: models.P2SVpnGateway, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, gatewayName: string, p2SVpnGatewayParameters: models.P2SVpnGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates virtual wan p2s vpn gateway tags. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} p2SVpnGatewayParameters Parameters supplied to update a - * virtual wan p2s vpn gateway tags. - * - * @param {object} [p2SVpnGatewayParameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, p2SVpnGatewayParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates virtual wan p2s vpn gateway tags. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} p2SVpnGatewayParameters Parameters supplied to update a - * virtual wan p2s vpn gateway tags. - * - * @param {object} [p2SVpnGatewayParameters.tags] Resource tags. - * - * @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 {P2SVpnGateway} - 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. - * - * {P2SVpnGateway} [result] - The deserialized result object if an error did not occur. - * See {@link P2SVpnGateway} 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. - */ - updateTags(resourceGroupName: string, gatewayName: string, p2SVpnGatewayParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateTags(resourceGroupName: string, gatewayName: string, p2SVpnGatewayParameters: models.TagsObject, callback: ServiceCallback): void; - updateTags(resourceGroupName: string, gatewayName: string, p2SVpnGatewayParameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes a virtual wan p2s vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes a virtual wan p2s vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - deleteMethod(resourceGroupName: string, gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, gatewayName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, gatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all the P2SVpnGateways in a resource group. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all the P2SVpnGateways in a resource group. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @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 {ListP2SVpnGatewaysResult} - 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. - * - * {ListP2SVpnGatewaysResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListP2SVpnGatewaysResult} 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. - */ - listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all the P2SVpnGateways in a subscription. - * - * @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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all the P2SVpnGateways in a subscription. - * - * @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 {ListP2SVpnGatewaysResult} - 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. - * - * {ListP2SVpnGatewaysResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListP2SVpnGatewaysResult} 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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Generates VPN profile for P2S client of the P2SVpnGateway in the specified - * resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} gatewayName The name of the P2SVpnGateway. - * - * @param {object} parameters Parameters supplied to the generate P2SVpnGateway - * VPN client package operation. - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @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. - */ - generateVpnProfileWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, parameters: models.P2SVpnProfileParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Generates VPN profile for P2S client of the P2SVpnGateway in the specified - * resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} gatewayName The name of the P2SVpnGateway. - * - * @param {object} parameters Parameters supplied to the generate P2SVpnGateway - * VPN client package operation. - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @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 {VpnProfileResponse} - 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. - * - * {VpnProfileResponse} [result] - The deserialized result object if an error did not occur. - * See {@link VpnProfileResponse} 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. - */ - generateVpnProfile(resourceGroupName: string, gatewayName: string, parameters: models.P2SVpnProfileParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - generateVpnProfile(resourceGroupName: string, gatewayName: string, parameters: models.P2SVpnProfileParameters, callback: ServiceCallback): void; - generateVpnProfile(resourceGroupName: string, gatewayName: string, parameters: models.P2SVpnProfileParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the - * existing gateway. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} p2SVpnGatewayParameters Parameters supplied to create or - * Update a virtual wan p2s vpn gateway. - * - * @param {object} [p2SVpnGatewayParameters.virtualHub] The VirtualHub to which - * the gateway belongs - * - * @param {string} [p2SVpnGatewayParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {number} [p2SVpnGatewayParameters.vpnGatewayScaleUnit] The scale unit - * for this p2s vpn gateway. - * - * @param {object} [p2SVpnGatewayParameters.p2SVpnServerConfiguration] The - * P2SVpnServerConfiguration to which the p2sVpnGateway is attached to. - * - * @param {string} [p2SVpnGatewayParameters.p2SVpnServerConfiguration.id] - * Resource ID. - * - * @param {object} [p2SVpnGatewayParameters.vpnClientAddressPool] The reference - * of the address space resource which represents Address space for P2S - * VpnClient. - * - * @param {array} - * [p2SVpnGatewayParameters.vpnClientAddressPool.addressPrefixes] A list of - * address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [p2SVpnGatewayParameters.id] Resource ID. - * - * @param {string} [p2SVpnGatewayParameters.location] Resource location. - * - * @param {object} [p2SVpnGatewayParameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, p2SVpnGatewayParameters: models.P2SVpnGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the - * existing gateway. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} p2SVpnGatewayParameters Parameters supplied to create or - * Update a virtual wan p2s vpn gateway. - * - * @param {object} [p2SVpnGatewayParameters.virtualHub] The VirtualHub to which - * the gateway belongs - * - * @param {string} [p2SVpnGatewayParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {number} [p2SVpnGatewayParameters.vpnGatewayScaleUnit] The scale unit - * for this p2s vpn gateway. - * - * @param {object} [p2SVpnGatewayParameters.p2SVpnServerConfiguration] The - * P2SVpnServerConfiguration to which the p2sVpnGateway is attached to. - * - * @param {string} [p2SVpnGatewayParameters.p2SVpnServerConfiguration.id] - * Resource ID. - * - * @param {object} [p2SVpnGatewayParameters.vpnClientAddressPool] The reference - * of the address space resource which represents Address space for P2S - * VpnClient. - * - * @param {array} - * [p2SVpnGatewayParameters.vpnClientAddressPool.addressPrefixes] A list of - * address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [p2SVpnGatewayParameters.id] Resource ID. - * - * @param {string} [p2SVpnGatewayParameters.location] Resource location. - * - * @param {object} [p2SVpnGatewayParameters.tags] Resource tags. - * - * @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 {P2SVpnGateway} - 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. - * - * {P2SVpnGateway} [result] - The deserialized result object if an error did not occur. - * See {@link P2SVpnGateway} 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. - */ - beginCreateOrUpdate(resourceGroupName: string, gatewayName: string, p2SVpnGatewayParameters: models.P2SVpnGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, gatewayName: string, p2SVpnGatewayParameters: models.P2SVpnGateway, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, gatewayName: string, p2SVpnGatewayParameters: models.P2SVpnGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates virtual wan p2s vpn gateway tags. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} p2SVpnGatewayParameters Parameters supplied to update a - * virtual wan p2s vpn gateway tags. - * - * @param {object} [p2SVpnGatewayParameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, p2SVpnGatewayParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates virtual wan p2s vpn gateway tags. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} p2SVpnGatewayParameters Parameters supplied to update a - * virtual wan p2s vpn gateway tags. - * - * @param {object} [p2SVpnGatewayParameters.tags] Resource tags. - * - * @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 {P2SVpnGateway} - 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. - * - * {P2SVpnGateway} [result] - The deserialized result object if an error did not occur. - * See {@link P2SVpnGateway} 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. - */ - beginUpdateTags(resourceGroupName: string, gatewayName: string, p2SVpnGatewayParameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdateTags(resourceGroupName: string, gatewayName: string, p2SVpnGatewayParameters: models.TagsObject, callback: ServiceCallback): void; - beginUpdateTags(resourceGroupName: string, gatewayName: string, p2SVpnGatewayParameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes a virtual wan p2s vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes a virtual wan p2s vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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. - */ - beginDeleteMethod(resourceGroupName: string, gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, gatewayName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, gatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Generates VPN profile for P2S client of the P2SVpnGateway in the specified - * resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} gatewayName The name of the P2SVpnGateway. - * - * @param {object} parameters Parameters supplied to the generate P2SVpnGateway - * VPN client package operation. - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @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. - */ - beginGenerateVpnProfileWithHttpOperationResponse(resourceGroupName: string, gatewayName: string, parameters: models.P2SVpnProfileParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Generates VPN profile for P2S client of the P2SVpnGateway in the specified - * resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} gatewayName The name of the P2SVpnGateway. - * - * @param {object} parameters Parameters supplied to the generate P2SVpnGateway - * VPN client package operation. - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @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 {VpnProfileResponse} - 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. - * - * {VpnProfileResponse} [result] - The deserialized result object if an error did not occur. - * See {@link VpnProfileResponse} 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. - */ - beginGenerateVpnProfile(resourceGroupName: string, gatewayName: string, parameters: models.P2SVpnProfileParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginGenerateVpnProfile(resourceGroupName: string, gatewayName: string, parameters: models.P2SVpnProfileParameters, callback: ServiceCallback): void; - beginGenerateVpnProfile(resourceGroupName: string, gatewayName: string, parameters: models.P2SVpnProfileParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all the P2SVpnGateways in a resource group. - * - * @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. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all the P2SVpnGateways in a resource group. - * - * @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 {ListP2SVpnGatewaysResult} - 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. - * - * {ListP2SVpnGatewaysResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListP2SVpnGatewaysResult} 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. - */ - listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists all the P2SVpnGateways in a subscription. - * - * @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>; - - /** - * Lists all the P2SVpnGateways in a subscription. - * - * @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 {ListP2SVpnGatewaysResult} - 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. - * - * {ListP2SVpnGatewaysResult} [result] - The deserialized result object if an error did not occur. - * See {@link ListP2SVpnGatewaysResult} 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; -} diff --git a/lib/services/networkManagement2/lib/operations/index.js b/lib/services/networkManagement2/lib/operations/index.js deleted file mode 100644 index 75d648518..000000000 --- a/lib/services/networkManagement2/lib/operations/index.js +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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. - */ - -/* jshint latedef:false */ -/* jshint forin:false */ -/* jshint noempty:false */ - -'use strict'; - -exports.ApplicationGateways = require('./applicationGateways'); -exports.ApplicationSecurityGroups = require('./applicationSecurityGroups'); -exports.AvailableDelegations = require('./availableDelegations'); -exports.AvailableResourceGroupDelegations = require('./availableResourceGroupDelegations'); -exports.AzureFirewalls = require('./azureFirewalls'); -exports.AzureFirewallFqdnTags = require('./azureFirewallFqdnTags'); -exports.DdosProtectionPlans = require('./ddosProtectionPlans'); -exports.AvailableEndpointServices = require('./availableEndpointServices'); -exports.ExpressRouteCircuitAuthorizations = require('./expressRouteCircuitAuthorizations'); -exports.ExpressRouteCircuitPeerings = require('./expressRouteCircuitPeerings'); -exports.ExpressRouteCircuitConnections = require('./expressRouteCircuitConnections'); -exports.ExpressRouteCircuits = require('./expressRouteCircuits'); -exports.ExpressRouteServiceProviders = require('./expressRouteServiceProviders'); -exports.ExpressRouteCrossConnections = require('./expressRouteCrossConnections'); -exports.ExpressRouteCrossConnectionPeerings = require('./expressRouteCrossConnectionPeerings'); -exports.ExpressRouteGateways = require('./expressRouteGateways'); -exports.ExpressRouteConnections = require('./expressRouteConnections'); -exports.ExpressRoutePortsLocations = require('./expressRoutePortsLocations'); -exports.ExpressRoutePorts = require('./expressRoutePorts'); -exports.ExpressRouteLinks = require('./expressRouteLinks'); -exports.InterfaceEndpoints = require('./interfaceEndpoints'); -exports.LoadBalancers = require('./loadBalancers'); -exports.LoadBalancerBackendAddressPools = require('./loadBalancerBackendAddressPools'); -exports.LoadBalancerFrontendIPConfigurations = require('./loadBalancerFrontendIPConfigurations'); -exports.InboundNatRules = require('./inboundNatRules'); -exports.LoadBalancerLoadBalancingRules = require('./loadBalancerLoadBalancingRules'); -exports.LoadBalancerOutboundRules = require('./loadBalancerOutboundRules'); -exports.LoadBalancerNetworkInterfaces = require('./loadBalancerNetworkInterfaces'); -exports.LoadBalancerProbes = require('./loadBalancerProbes'); -exports.NetworkInterfaces = require('./networkInterfaces'); -exports.NetworkInterfaceIPConfigurations = require('./networkInterfaceIPConfigurations'); -exports.NetworkInterfaceLoadBalancers = require('./networkInterfaceLoadBalancers'); -exports.NetworkInterfaceTapConfigurations = require('./networkInterfaceTapConfigurations'); -exports.NetworkProfiles = require('./networkProfiles'); -exports.NetworkSecurityGroups = require('./networkSecurityGroups'); -exports.SecurityRules = require('./securityRules'); -exports.DefaultSecurityRules = require('./defaultSecurityRules'); -exports.NetworkWatchers = require('./networkWatchers'); -exports.PacketCaptures = require('./packetCaptures'); -exports.ConnectionMonitors = require('./connectionMonitors'); -exports.Operations = require('./operations'); -exports.PublicIPAddresses = require('./publicIPAddresses'); -exports.PublicIPPrefixes = require('./publicIPPrefixes'); -exports.RouteFilters = require('./routeFilters'); -exports.RouteFilterRules = require('./routeFilterRules'); -exports.RouteTables = require('./routeTables'); -exports.Routes = require('./routes'); -exports.BgpServiceCommunities = require('./bgpServiceCommunities'); -exports.ServiceEndpointPolicies = require('./serviceEndpointPolicies'); -exports.ServiceEndpointPolicyDefinitions = require('./serviceEndpointPolicyDefinitions'); -exports.Usages = require('./usages'); -exports.VirtualNetworks = require('./virtualNetworks'); -exports.Subnets = require('./subnets'); -exports.VirtualNetworkPeerings = require('./virtualNetworkPeerings'); -exports.VirtualNetworkGateways = require('./virtualNetworkGateways'); -exports.VirtualNetworkGatewayConnections = require('./virtualNetworkGatewayConnections'); -exports.LocalNetworkGateways = require('./localNetworkGateways'); -exports.VirtualNetworkTaps = require('./virtualNetworkTaps'); -exports.VirtualWans = require('./virtualWans'); -exports.VpnSites = require('./vpnSites'); -exports.VpnSitesConfiguration = require('./vpnSitesConfiguration'); -exports.VirtualHubs = require('./virtualHubs'); -exports.HubVirtualNetworkConnections = require('./hubVirtualNetworkConnections'); -exports.VpnGateways = require('./vpnGateways'); -exports.VpnConnections = require('./vpnConnections'); -exports.P2sVpnServerConfigurations = require('./p2sVpnServerConfigurations'); -exports.P2sVpnGateways = require('./p2sVpnGateways'); diff --git a/lib/services/networkManagement2/lib/operations/interfaceEndpoints.js b/lib/services/networkManagement2/lib/operations/interfaceEndpoints.js deleted file mode 100644 index b0ee50b96..000000000 --- a/lib/services/networkManagement2/lib/operations/interfaceEndpoints.js +++ /dev/null @@ -1,2559 +0,0 @@ -/* - * 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; - - -/** - * Deletes the specified interface endpoint. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} interfaceEndpointName The name of the interface endpoint. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, interfaceEndpointName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, interfaceEndpointName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets the specified interface endpoint by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} interfaceEndpointName The name of the interface endpoint. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 InterfaceEndpoint} 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, interfaceEndpointName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2018-10-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 (interfaceEndpointName === null || interfaceEndpointName === undefined || typeof interfaceEndpointName.valueOf() !== 'string') { - throw new Error('interfaceEndpointName 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 (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand 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/interfaceEndpoints/{interfaceEndpointName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{interfaceEndpointName}', encodeURIComponent(interfaceEndpointName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } - 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['InterfaceEndpoint']().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); - }); -} - - -/** - * Creates or updates an interface endpoint in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} interfaceEndpointName The name of the interface endpoint. - * - * @param {object} parameters Parameters supplied to the create or update - * interface endpoint operation - * - * @param {string} [parameters.fqdn] A first-party service's FQDN that is - * mapped to the private IP allocated via this interface endpoint. - * - * @param {object} [parameters.endpointService] A reference to the service - * being brought into the virtual network. - * - * @param {string} [parameters.endpointService.id] A unique identifier of the - * service being referenced by the interface endpoint. - * - * @param {object} [parameters.subnet] The ID of the subnet from which the - * private IP will be allocated. - * - * @param {string} [parameters.subnet.addressPrefix] The address prefix for the - * subnet. - * - * @param {array} [parameters.subnet.addressPrefixes] List of address prefixes - * for the subnet. - * - * @param {object} [parameters.subnet.networkSecurityGroup] The reference of - * the NetworkSecurityGroup resource. - * - * @param {array} [parameters.subnet.networkSecurityGroup.securityRules] A - * collection of security rules of the network security group. - * - * @param {array} [parameters.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} [parameters.subnet.networkSecurityGroup.resourceGuid] The - * resource GUID property of the network security group resource. - * - * @param {string} [parameters.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.subnet.networkSecurityGroup.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.networkSecurityGroup.id] Resource ID. - * - * @param {string} [parameters.subnet.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [parameters.subnet.networkSecurityGroup.tags] Resource tags. - * - * @param {object} [parameters.subnet.routeTable] The reference of the - * RouteTable resource. - * - * @param {array} [parameters.subnet.routeTable.routes] Collection of routes - * contained within a route table. - * - * @param {boolean} [parameters.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} [parameters.subnet.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [parameters.subnet.routeTable.etag] Gets a unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.routeTable.id] Resource ID. - * - * @param {string} [parameters.subnet.routeTable.location] Resource location. - * - * @param {object} [parameters.subnet.routeTable.tags] Resource tags. - * - * @param {array} [parameters.subnet.serviceEndpoints] An array of service - * endpoints. - * - * @param {array} [parameters.subnet.serviceEndpointPolicies] An array of - * service endpoint policies. - * - * @param {array} [parameters.subnet.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * - * @param {array} [parameters.subnet.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * - * @param {array} [parameters.subnet.delegations] Gets an array of references - * to the delegations on the subnet. - * - * @param {string} [parameters.subnet.provisioningState] The provisioning state - * of the resource. - * - * @param {string} [parameters.subnet.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [parameters.subnet.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.id] Resource ID. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 InterfaceEndpoint} 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 _createOrUpdate(resourceGroupName, interfaceEndpointName, parameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, interfaceEndpointName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['InterfaceEndpoint']().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 interface endpoints in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 InterfaceEndpointListResult} 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, 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-10-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 (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/interfaceEndpoints'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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['InterfaceEndpointListResult']().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 interface endpoints in a subscription. - * - * @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 InterfaceEndpointListResult} 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 _listBySubscription(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/interfaceEndpoints'; - 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['InterfaceEndpointListResult']().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); - }); -} - -/** - * Deletes the specified interface endpoint. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} interfaceEndpointName The name of the interface endpoint. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, interfaceEndpointName, 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-10-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 (interfaceEndpointName === null || interfaceEndpointName === undefined || typeof interfaceEndpointName.valueOf() !== 'string') { - throw new Error('interfaceEndpointName 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/interfaceEndpoints/{interfaceEndpointName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{interfaceEndpointName}', encodeURIComponent(interfaceEndpointName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates an interface endpoint in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} interfaceEndpointName The name of the interface endpoint. - * - * @param {object} parameters Parameters supplied to the create or update - * interface endpoint operation - * - * @param {string} [parameters.fqdn] A first-party service's FQDN that is - * mapped to the private IP allocated via this interface endpoint. - * - * @param {object} [parameters.endpointService] A reference to the service - * being brought into the virtual network. - * - * @param {string} [parameters.endpointService.id] A unique identifier of the - * service being referenced by the interface endpoint. - * - * @param {object} [parameters.subnet] The ID of the subnet from which the - * private IP will be allocated. - * - * @param {string} [parameters.subnet.addressPrefix] The address prefix for the - * subnet. - * - * @param {array} [parameters.subnet.addressPrefixes] List of address prefixes - * for the subnet. - * - * @param {object} [parameters.subnet.networkSecurityGroup] The reference of - * the NetworkSecurityGroup resource. - * - * @param {array} [parameters.subnet.networkSecurityGroup.securityRules] A - * collection of security rules of the network security group. - * - * @param {array} [parameters.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} [parameters.subnet.networkSecurityGroup.resourceGuid] The - * resource GUID property of the network security group resource. - * - * @param {string} [parameters.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.subnet.networkSecurityGroup.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.networkSecurityGroup.id] Resource ID. - * - * @param {string} [parameters.subnet.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [parameters.subnet.networkSecurityGroup.tags] Resource tags. - * - * @param {object} [parameters.subnet.routeTable] The reference of the - * RouteTable resource. - * - * @param {array} [parameters.subnet.routeTable.routes] Collection of routes - * contained within a route table. - * - * @param {boolean} [parameters.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} [parameters.subnet.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [parameters.subnet.routeTable.etag] Gets a unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.routeTable.id] Resource ID. - * - * @param {string} [parameters.subnet.routeTable.location] Resource location. - * - * @param {object} [parameters.subnet.routeTable.tags] Resource tags. - * - * @param {array} [parameters.subnet.serviceEndpoints] An array of service - * endpoints. - * - * @param {array} [parameters.subnet.serviceEndpointPolicies] An array of - * service endpoint policies. - * - * @param {array} [parameters.subnet.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * - * @param {array} [parameters.subnet.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * - * @param {array} [parameters.subnet.delegations] Gets an array of references - * to the delegations on the subnet. - * - * @param {string} [parameters.subnet.provisioningState] The provisioning state - * of the resource. - * - * @param {string} [parameters.subnet.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [parameters.subnet.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.id] Resource ID. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 InterfaceEndpoint} 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 _beginCreateOrUpdate(resourceGroupName, interfaceEndpointName, parameters, 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-10-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 (interfaceEndpointName === null || interfaceEndpointName === undefined || typeof interfaceEndpointName.valueOf() !== 'string') { - throw new Error('interfaceEndpointName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/interfaceEndpoints/{interfaceEndpointName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{interfaceEndpointName}', encodeURIComponent(interfaceEndpointName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['InterfaceEndpoint']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['InterfaceEndpoint']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['InterfaceEndpoint']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Gets all interface endpoints in a resource group. - * - * @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 InterfaceEndpointListResult} 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['InterfaceEndpointListResult']().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 interface endpoints in a subscription. - * - * @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 InterfaceEndpointListResult} 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 _listBySubscriptionNext(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['InterfaceEndpointListResult']().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 InterfaceEndpoints. */ -class InterfaceEndpoints { - /** - * Create a InterfaceEndpoints. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._list = _list; - this._listBySubscription = _listBySubscription; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._listNext = _listNext; - this._listBySubscriptionNext = _listBySubscriptionNext; - } - - /** - * Deletes the specified interface endpoint. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} interfaceEndpointName The name of the interface endpoint. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, interfaceEndpointName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, interfaceEndpointName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified interface endpoint. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} interfaceEndpointName The name of the interface endpoint. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, interfaceEndpointName, 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._deleteMethod(resourceGroupName, interfaceEndpointName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, interfaceEndpointName, options, optionalCallback); - } - } - - /** - * Gets the specified interface endpoint by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} interfaceEndpointName The name of the interface endpoint. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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, interfaceEndpointName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, interfaceEndpointName, 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 interface endpoint by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} interfaceEndpointName The name of the interface endpoint. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {InterfaceEndpoint} - 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 InterfaceEndpoint} 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, interfaceEndpointName, 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, interfaceEndpointName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, interfaceEndpointName, options, optionalCallback); - } - } - - /** - * Creates or updates an interface endpoint in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} interfaceEndpointName The name of the interface endpoint. - * - * @param {object} parameters Parameters supplied to the create or update - * interface endpoint operation - * - * @param {string} [parameters.fqdn] A first-party service's FQDN that is - * mapped to the private IP allocated via this interface endpoint. - * - * @param {object} [parameters.endpointService] A reference to the service - * being brought into the virtual network. - * - * @param {string} [parameters.endpointService.id] A unique identifier of the - * service being referenced by the interface endpoint. - * - * @param {object} [parameters.subnet] The ID of the subnet from which the - * private IP will be allocated. - * - * @param {string} [parameters.subnet.addressPrefix] The address prefix for the - * subnet. - * - * @param {array} [parameters.subnet.addressPrefixes] List of address prefixes - * for the subnet. - * - * @param {object} [parameters.subnet.networkSecurityGroup] The reference of - * the NetworkSecurityGroup resource. - * - * @param {array} [parameters.subnet.networkSecurityGroup.securityRules] A - * collection of security rules of the network security group. - * - * @param {array} [parameters.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} [parameters.subnet.networkSecurityGroup.resourceGuid] The - * resource GUID property of the network security group resource. - * - * @param {string} [parameters.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.subnet.networkSecurityGroup.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.networkSecurityGroup.id] Resource ID. - * - * @param {string} [parameters.subnet.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [parameters.subnet.networkSecurityGroup.tags] Resource tags. - * - * @param {object} [parameters.subnet.routeTable] The reference of the - * RouteTable resource. - * - * @param {array} [parameters.subnet.routeTable.routes] Collection of routes - * contained within a route table. - * - * @param {boolean} [parameters.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} [parameters.subnet.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [parameters.subnet.routeTable.etag] Gets a unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.routeTable.id] Resource ID. - * - * @param {string} [parameters.subnet.routeTable.location] Resource location. - * - * @param {object} [parameters.subnet.routeTable.tags] Resource tags. - * - * @param {array} [parameters.subnet.serviceEndpoints] An array of service - * endpoints. - * - * @param {array} [parameters.subnet.serviceEndpointPolicies] An array of - * service endpoint policies. - * - * @param {array} [parameters.subnet.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * - * @param {array} [parameters.subnet.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * - * @param {array} [parameters.subnet.delegations] Gets an array of references - * to the delegations on the subnet. - * - * @param {string} [parameters.subnet.provisioningState] The provisioning state - * of the resource. - * - * @param {string} [parameters.subnet.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [parameters.subnet.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.id] Resource ID. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, interfaceEndpointName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, interfaceEndpointName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates an interface endpoint in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} interfaceEndpointName The name of the interface endpoint. - * - * @param {object} parameters Parameters supplied to the create or update - * interface endpoint operation - * - * @param {string} [parameters.fqdn] A first-party service's FQDN that is - * mapped to the private IP allocated via this interface endpoint. - * - * @param {object} [parameters.endpointService] A reference to the service - * being brought into the virtual network. - * - * @param {string} [parameters.endpointService.id] A unique identifier of the - * service being referenced by the interface endpoint. - * - * @param {object} [parameters.subnet] The ID of the subnet from which the - * private IP will be allocated. - * - * @param {string} [parameters.subnet.addressPrefix] The address prefix for the - * subnet. - * - * @param {array} [parameters.subnet.addressPrefixes] List of address prefixes - * for the subnet. - * - * @param {object} [parameters.subnet.networkSecurityGroup] The reference of - * the NetworkSecurityGroup resource. - * - * @param {array} [parameters.subnet.networkSecurityGroup.securityRules] A - * collection of security rules of the network security group. - * - * @param {array} [parameters.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} [parameters.subnet.networkSecurityGroup.resourceGuid] The - * resource GUID property of the network security group resource. - * - * @param {string} [parameters.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.subnet.networkSecurityGroup.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.networkSecurityGroup.id] Resource ID. - * - * @param {string} [parameters.subnet.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [parameters.subnet.networkSecurityGroup.tags] Resource tags. - * - * @param {object} [parameters.subnet.routeTable] The reference of the - * RouteTable resource. - * - * @param {array} [parameters.subnet.routeTable.routes] Collection of routes - * contained within a route table. - * - * @param {boolean} [parameters.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} [parameters.subnet.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [parameters.subnet.routeTable.etag] Gets a unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.routeTable.id] Resource ID. - * - * @param {string} [parameters.subnet.routeTable.location] Resource location. - * - * @param {object} [parameters.subnet.routeTable.tags] Resource tags. - * - * @param {array} [parameters.subnet.serviceEndpoints] An array of service - * endpoints. - * - * @param {array} [parameters.subnet.serviceEndpointPolicies] An array of - * service endpoint policies. - * - * @param {array} [parameters.subnet.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * - * @param {array} [parameters.subnet.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * - * @param {array} [parameters.subnet.delegations] Gets an array of references - * to the delegations on the subnet. - * - * @param {string} [parameters.subnet.provisioningState] The provisioning state - * of the resource. - * - * @param {string} [parameters.subnet.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [parameters.subnet.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.id] Resource ID. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {InterfaceEndpoint} - 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 InterfaceEndpoint} 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. - */ - createOrUpdate(resourceGroupName, interfaceEndpointName, parameters, 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._createOrUpdate(resourceGroupName, interfaceEndpointName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, interfaceEndpointName, parameters, options, optionalCallback); - } - } - - /** - * Gets all interface endpoints in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, 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 interface endpoints in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {InterfaceEndpointListResult} - 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 InterfaceEndpointListResult} 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, 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, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, options, optionalCallback); - } - } - - /** - * Gets all interface endpoints in a subscription. - * - * @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. - */ - listBySubscriptionWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listBySubscription(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 interface endpoints in a subscription. - * - * @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 {InterfaceEndpointListResult} - 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 InterfaceEndpointListResult} 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. - */ - listBySubscription(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._listBySubscription(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listBySubscription(options, optionalCallback); - } - } - - /** - * Deletes the specified interface endpoint. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} interfaceEndpointName The name of the interface endpoint. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, interfaceEndpointName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, interfaceEndpointName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified interface endpoint. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} interfaceEndpointName The name of the interface endpoint. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, interfaceEndpointName, 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._beginDeleteMethod(resourceGroupName, interfaceEndpointName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, interfaceEndpointName, options, optionalCallback); - } - } - - /** - * Creates or updates an interface endpoint in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} interfaceEndpointName The name of the interface endpoint. - * - * @param {object} parameters Parameters supplied to the create or update - * interface endpoint operation - * - * @param {string} [parameters.fqdn] A first-party service's FQDN that is - * mapped to the private IP allocated via this interface endpoint. - * - * @param {object} [parameters.endpointService] A reference to the service - * being brought into the virtual network. - * - * @param {string} [parameters.endpointService.id] A unique identifier of the - * service being referenced by the interface endpoint. - * - * @param {object} [parameters.subnet] The ID of the subnet from which the - * private IP will be allocated. - * - * @param {string} [parameters.subnet.addressPrefix] The address prefix for the - * subnet. - * - * @param {array} [parameters.subnet.addressPrefixes] List of address prefixes - * for the subnet. - * - * @param {object} [parameters.subnet.networkSecurityGroup] The reference of - * the NetworkSecurityGroup resource. - * - * @param {array} [parameters.subnet.networkSecurityGroup.securityRules] A - * collection of security rules of the network security group. - * - * @param {array} [parameters.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} [parameters.subnet.networkSecurityGroup.resourceGuid] The - * resource GUID property of the network security group resource. - * - * @param {string} [parameters.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.subnet.networkSecurityGroup.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.networkSecurityGroup.id] Resource ID. - * - * @param {string} [parameters.subnet.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [parameters.subnet.networkSecurityGroup.tags] Resource tags. - * - * @param {object} [parameters.subnet.routeTable] The reference of the - * RouteTable resource. - * - * @param {array} [parameters.subnet.routeTable.routes] Collection of routes - * contained within a route table. - * - * @param {boolean} [parameters.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} [parameters.subnet.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [parameters.subnet.routeTable.etag] Gets a unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.routeTable.id] Resource ID. - * - * @param {string} [parameters.subnet.routeTable.location] Resource location. - * - * @param {object} [parameters.subnet.routeTable.tags] Resource tags. - * - * @param {array} [parameters.subnet.serviceEndpoints] An array of service - * endpoints. - * - * @param {array} [parameters.subnet.serviceEndpointPolicies] An array of - * service endpoint policies. - * - * @param {array} [parameters.subnet.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * - * @param {array} [parameters.subnet.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * - * @param {array} [parameters.subnet.delegations] Gets an array of references - * to the delegations on the subnet. - * - * @param {string} [parameters.subnet.provisioningState] The provisioning state - * of the resource. - * - * @param {string} [parameters.subnet.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [parameters.subnet.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.id] Resource ID. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, interfaceEndpointName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, interfaceEndpointName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates an interface endpoint in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} interfaceEndpointName The name of the interface endpoint. - * - * @param {object} parameters Parameters supplied to the create or update - * interface endpoint operation - * - * @param {string} [parameters.fqdn] A first-party service's FQDN that is - * mapped to the private IP allocated via this interface endpoint. - * - * @param {object} [parameters.endpointService] A reference to the service - * being brought into the virtual network. - * - * @param {string} [parameters.endpointService.id] A unique identifier of the - * service being referenced by the interface endpoint. - * - * @param {object} [parameters.subnet] The ID of the subnet from which the - * private IP will be allocated. - * - * @param {string} [parameters.subnet.addressPrefix] The address prefix for the - * subnet. - * - * @param {array} [parameters.subnet.addressPrefixes] List of address prefixes - * for the subnet. - * - * @param {object} [parameters.subnet.networkSecurityGroup] The reference of - * the NetworkSecurityGroup resource. - * - * @param {array} [parameters.subnet.networkSecurityGroup.securityRules] A - * collection of security rules of the network security group. - * - * @param {array} [parameters.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} [parameters.subnet.networkSecurityGroup.resourceGuid] The - * resource GUID property of the network security group resource. - * - * @param {string} [parameters.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.subnet.networkSecurityGroup.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.networkSecurityGroup.id] Resource ID. - * - * @param {string} [parameters.subnet.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [parameters.subnet.networkSecurityGroup.tags] Resource tags. - * - * @param {object} [parameters.subnet.routeTable] The reference of the - * RouteTable resource. - * - * @param {array} [parameters.subnet.routeTable.routes] Collection of routes - * contained within a route table. - * - * @param {boolean} [parameters.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} [parameters.subnet.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [parameters.subnet.routeTable.etag] Gets a unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.routeTable.id] Resource ID. - * - * @param {string} [parameters.subnet.routeTable.location] Resource location. - * - * @param {object} [parameters.subnet.routeTable.tags] Resource tags. - * - * @param {array} [parameters.subnet.serviceEndpoints] An array of service - * endpoints. - * - * @param {array} [parameters.subnet.serviceEndpointPolicies] An array of - * service endpoint policies. - * - * @param {array} [parameters.subnet.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * - * @param {array} [parameters.subnet.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * - * @param {array} [parameters.subnet.delegations] Gets an array of references - * to the delegations on the subnet. - * - * @param {string} [parameters.subnet.provisioningState] The provisioning state - * of the resource. - * - * @param {string} [parameters.subnet.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [parameters.subnet.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.subnet.id] Resource ID. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {InterfaceEndpoint} - 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 InterfaceEndpoint} 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. - */ - beginCreateOrUpdate(resourceGroupName, interfaceEndpointName, parameters, 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._beginCreateOrUpdate(resourceGroupName, interfaceEndpointName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, interfaceEndpointName, parameters, options, optionalCallback); - } - } - - /** - * Gets all interface endpoints in a resource group. - * - * @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 interface endpoints in a resource group. - * - * @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 {InterfaceEndpointListResult} - 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 InterfaceEndpointListResult} 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); - } - } - - /** - * Gets all interface endpoints in a subscription. - * - * @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. - */ - listBySubscriptionNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listBySubscriptionNext(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 interface endpoints in a subscription. - * - * @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 {InterfaceEndpointListResult} - 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 InterfaceEndpointListResult} 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. - */ - listBySubscriptionNext(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._listBySubscriptionNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listBySubscriptionNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = InterfaceEndpoints; diff --git a/lib/services/networkManagement2/lib/operations/loadBalancerBackendAddressPools.js b/lib/services/networkManagement2/lib/operations/loadBalancerBackendAddressPools.js deleted file mode 100644 index ae3306f15..000000000 --- a/lib/services/networkManagement2/lib/operations/loadBalancerBackendAddressPools.js +++ /dev/null @@ -1,715 +0,0 @@ -/* - * 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 all the load balancer backed address pools. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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 LoadBalancerBackendAddressPoolListResult} - * 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, loadBalancerName, 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-10-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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { - throw new Error('loadBalancerName 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/loadBalancers/{loadBalancerName}/backendAddressPools'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); - 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['LoadBalancerBackendAddressPoolListResult']().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 load balancer backend address pool. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} backendAddressPoolName The name of the backend address pool. - * - * @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 BackendAddressPool} 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, loadBalancerName, backendAddressPoolName, 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-10-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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { - throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); - } - if (backendAddressPoolName === null || backendAddressPoolName === undefined || typeof backendAddressPoolName.valueOf() !== 'string') { - throw new Error('backendAddressPoolName 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/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); - requestUrl = requestUrl.replace('{backendAddressPoolName}', encodeURIComponent(backendAddressPoolName)); - 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['BackendAddressPool']().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 the load balancer backed address pools. - * - * @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 LoadBalancerBackendAddressPoolListResult} - * 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['LoadBalancerBackendAddressPoolListResult']().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 LoadBalancerBackendAddressPools. */ -class LoadBalancerBackendAddressPools { - /** - * Create a LoadBalancerBackendAddressPools. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._list = _list; - this._get = _get; - this._listNext = _listNext; - } - - /** - * Gets all the load balancer backed address pools. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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, loadBalancerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, loadBalancerName, 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 the load balancer backed address pools. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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 {LoadBalancerBackendAddressPoolListResult} - 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 LoadBalancerBackendAddressPoolListResult} - * 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, loadBalancerName, 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, loadBalancerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, loadBalancerName, options, optionalCallback); - } - } - - /** - * Gets load balancer backend address pool. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} backendAddressPoolName The name of the backend address pool. - * - * @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, loadBalancerName, backendAddressPoolName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, loadBalancerName, backendAddressPoolName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets load balancer backend address pool. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} backendAddressPoolName The name of the backend address pool. - * - * @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 {BackendAddressPool} - 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 BackendAddressPool} 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, loadBalancerName, backendAddressPoolName, 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, loadBalancerName, backendAddressPoolName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, loadBalancerName, backendAddressPoolName, options, optionalCallback); - } - } - - /** - * Gets all the load balancer backed address pools. - * - * @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 the load balancer backed address pools. - * - * @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 {LoadBalancerBackendAddressPoolListResult} - 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 LoadBalancerBackendAddressPoolListResult} - * 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 = LoadBalancerBackendAddressPools; diff --git a/lib/services/networkManagement2/lib/operations/loadBalancerFrontendIPConfigurations.js b/lib/services/networkManagement2/lib/operations/loadBalancerFrontendIPConfigurations.js deleted file mode 100644 index 741a76dfe..000000000 --- a/lib/services/networkManagement2/lib/operations/loadBalancerFrontendIPConfigurations.js +++ /dev/null @@ -1,724 +0,0 @@ -/* - * 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 all the load balancer frontend IP configurations. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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 - * LoadBalancerFrontendIPConfigurationListResult} 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, loadBalancerName, 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-10-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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { - throw new Error('loadBalancerName 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/loadBalancers/{loadBalancerName}/frontendIPConfigurations'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); - 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['LoadBalancerFrontendIPConfigurationListResult']().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 load balancer frontend IP configuration. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} frontendIPConfigurationName The name of the frontend IP - * configuration. - * - * @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 FrontendIPConfiguration} 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, loadBalancerName, frontendIPConfigurationName, 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-10-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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { - throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); - } - if (frontendIPConfigurationName === null || frontendIPConfigurationName === undefined || typeof frontendIPConfigurationName.valueOf() !== 'string') { - throw new Error('frontendIPConfigurationName 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/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); - requestUrl = requestUrl.replace('{frontendIPConfigurationName}', encodeURIComponent(frontendIPConfigurationName)); - 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['FrontendIPConfiguration']().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 the load balancer frontend IP configurations. - * - * @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 - * LoadBalancerFrontendIPConfigurationListResult} 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['LoadBalancerFrontendIPConfigurationListResult']().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 LoadBalancerFrontendIPConfigurations. */ -class LoadBalancerFrontendIPConfigurations { - /** - * Create a LoadBalancerFrontendIPConfigurations. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._list = _list; - this._get = _get; - this._listNext = _listNext; - } - - /** - * Gets all the load balancer frontend IP configurations. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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, loadBalancerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, loadBalancerName, 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 the load balancer frontend IP configurations. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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 {LoadBalancerFrontendIPConfigurationListResult} - 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 - * LoadBalancerFrontendIPConfigurationListResult} 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, loadBalancerName, 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, loadBalancerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, loadBalancerName, options, optionalCallback); - } - } - - /** - * Gets load balancer frontend IP configuration. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} frontendIPConfigurationName The name of the frontend IP - * configuration. - * - * @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, loadBalancerName, frontendIPConfigurationName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, loadBalancerName, frontendIPConfigurationName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets load balancer frontend IP configuration. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} frontendIPConfigurationName The name of the frontend IP - * configuration. - * - * @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 {FrontendIPConfiguration} - 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 FrontendIPConfiguration} 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, loadBalancerName, frontendIPConfigurationName, 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, loadBalancerName, frontendIPConfigurationName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, loadBalancerName, frontendIPConfigurationName, options, optionalCallback); - } - } - - /** - * Gets all the load balancer frontend IP configurations. - * - * @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 the load balancer frontend IP configurations. - * - * @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 {LoadBalancerFrontendIPConfigurationListResult} - 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 - * LoadBalancerFrontendIPConfigurationListResult} 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 = LoadBalancerFrontendIPConfigurations; diff --git a/lib/services/networkManagement2/lib/operations/loadBalancerLoadBalancingRules.js b/lib/services/networkManagement2/lib/operations/loadBalancerLoadBalancingRules.js deleted file mode 100644 index 76530a651..000000000 --- a/lib/services/networkManagement2/lib/operations/loadBalancerLoadBalancingRules.js +++ /dev/null @@ -1,715 +0,0 @@ -/* - * 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 all the load balancing rules in a load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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 LoadBalancerLoadBalancingRuleListResult} 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, loadBalancerName, 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-10-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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { - throw new Error('loadBalancerName 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/loadBalancers/{loadBalancerName}/loadBalancingRules'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); - 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['LoadBalancerLoadBalancingRuleListResult']().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 the specified load balancer load balancing rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} loadBalancingRuleName The name of the load balancing rule. - * - * @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 LoadBalancingRule} 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, loadBalancerName, loadBalancingRuleName, 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-10-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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { - throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); - } - if (loadBalancingRuleName === null || loadBalancingRuleName === undefined || typeof loadBalancingRuleName.valueOf() !== 'string') { - throw new Error('loadBalancingRuleName 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/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); - requestUrl = requestUrl.replace('{loadBalancingRuleName}', encodeURIComponent(loadBalancingRuleName)); - 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['LoadBalancingRule']().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 the load balancing rules in a load balancer. - * - * @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 LoadBalancerLoadBalancingRuleListResult} 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['LoadBalancerLoadBalancingRuleListResult']().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 LoadBalancerLoadBalancingRules. */ -class LoadBalancerLoadBalancingRules { - /** - * Create a LoadBalancerLoadBalancingRules. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._list = _list; - this._get = _get; - this._listNext = _listNext; - } - - /** - * Gets all the load balancing rules in a load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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, loadBalancerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, loadBalancerName, 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 the load balancing rules in a load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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 {LoadBalancerLoadBalancingRuleListResult} - 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 LoadBalancerLoadBalancingRuleListResult} 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, loadBalancerName, 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, loadBalancerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, loadBalancerName, options, optionalCallback); - } - } - - /** - * Gets the specified load balancer load balancing rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} loadBalancingRuleName The name of the load balancing rule. - * - * @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, loadBalancerName, loadBalancingRuleName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, loadBalancerName, loadBalancingRuleName, 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 load balancer load balancing rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} loadBalancingRuleName The name of the load balancing rule. - * - * @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 {LoadBalancingRule} - 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 LoadBalancingRule} 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, loadBalancerName, loadBalancingRuleName, 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, loadBalancerName, loadBalancingRuleName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, loadBalancerName, loadBalancingRuleName, options, optionalCallback); - } - } - - /** - * Gets all the load balancing rules in a load balancer. - * - * @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 the load balancing rules in a load balancer. - * - * @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 {LoadBalancerLoadBalancingRuleListResult} - 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 LoadBalancerLoadBalancingRuleListResult} 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 = LoadBalancerLoadBalancingRules; diff --git a/lib/services/networkManagement2/lib/operations/loadBalancerNetworkInterfaces.js b/lib/services/networkManagement2/lib/operations/loadBalancerNetworkInterfaces.js deleted file mode 100644 index b677a5784..000000000 --- a/lib/services/networkManagement2/lib/operations/loadBalancerNetworkInterfaces.js +++ /dev/null @@ -1,475 +0,0 @@ -/* - * 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 associated load balancer network interfaces. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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 NetworkInterfaceListResult} 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, loadBalancerName, 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-10-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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { - throw new Error('loadBalancerName 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/loadBalancers/{loadBalancerName}/networkInterfaces'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); - 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['NetworkInterfaceListResult']().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 associated load balancer network interfaces. - * - * @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 NetworkInterfaceListResult} 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['NetworkInterfaceListResult']().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 LoadBalancerNetworkInterfaces. */ -class LoadBalancerNetworkInterfaces { - /** - * Create a LoadBalancerNetworkInterfaces. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._list = _list; - this._listNext = _listNext; - } - - /** - * Gets associated load balancer network interfaces. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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, loadBalancerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, loadBalancerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets associated load balancer network interfaces. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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 {NetworkInterfaceListResult} - 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 NetworkInterfaceListResult} 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, loadBalancerName, 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, loadBalancerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, loadBalancerName, options, optionalCallback); - } - } - - /** - * Gets associated load balancer network interfaces. - * - * @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 associated load balancer network interfaces. - * - * @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 {NetworkInterfaceListResult} - 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 NetworkInterfaceListResult} 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 = LoadBalancerNetworkInterfaces; diff --git a/lib/services/networkManagement2/lib/operations/loadBalancerOutboundRules.js b/lib/services/networkManagement2/lib/operations/loadBalancerOutboundRules.js deleted file mode 100644 index f98dc3261..000000000 --- a/lib/services/networkManagement2/lib/operations/loadBalancerOutboundRules.js +++ /dev/null @@ -1,715 +0,0 @@ -/* - * 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 all the outbound rules in a load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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 LoadBalancerOutboundRuleListResult} 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, loadBalancerName, 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-10-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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { - throw new Error('loadBalancerName 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/loadBalancers/{loadBalancerName}/outboundRules'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); - 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['LoadBalancerOutboundRuleListResult']().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 the specified load balancer outbound rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} outboundRuleName The name of the outbound rule. - * - * @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 OutboundRule} 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, loadBalancerName, outboundRuleName, 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-10-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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { - throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); - } - if (outboundRuleName === null || outboundRuleName === undefined || typeof outboundRuleName.valueOf() !== 'string') { - throw new Error('outboundRuleName 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/loadBalancers/{loadBalancerName}/outboundRules/{outboundRuleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); - requestUrl = requestUrl.replace('{outboundRuleName}', encodeURIComponent(outboundRuleName)); - 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['OutboundRule']().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 the outbound rules in a load balancer. - * - * @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 LoadBalancerOutboundRuleListResult} 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['LoadBalancerOutboundRuleListResult']().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 LoadBalancerOutboundRules. */ -class LoadBalancerOutboundRules { - /** - * Create a LoadBalancerOutboundRules. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._list = _list; - this._get = _get; - this._listNext = _listNext; - } - - /** - * Gets all the outbound rules in a load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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, loadBalancerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, loadBalancerName, 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 the outbound rules in a load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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 {LoadBalancerOutboundRuleListResult} - 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 LoadBalancerOutboundRuleListResult} 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, loadBalancerName, 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, loadBalancerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, loadBalancerName, options, optionalCallback); - } - } - - /** - * Gets the specified load balancer outbound rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} outboundRuleName The name of the outbound rule. - * - * @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, loadBalancerName, outboundRuleName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, loadBalancerName, outboundRuleName, 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 load balancer outbound rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} outboundRuleName The name of the outbound rule. - * - * @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 {OutboundRule} - 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 OutboundRule} 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, loadBalancerName, outboundRuleName, 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, loadBalancerName, outboundRuleName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, loadBalancerName, outboundRuleName, options, optionalCallback); - } - } - - /** - * Gets all the outbound rules in a load balancer. - * - * @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 the outbound rules in a load balancer. - * - * @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 {LoadBalancerOutboundRuleListResult} - 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 LoadBalancerOutboundRuleListResult} 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 = LoadBalancerOutboundRules; diff --git a/lib/services/networkManagement2/lib/operations/loadBalancerProbes.js b/lib/services/networkManagement2/lib/operations/loadBalancerProbes.js deleted file mode 100644 index 2851e03a5..000000000 --- a/lib/services/networkManagement2/lib/operations/loadBalancerProbes.js +++ /dev/null @@ -1,715 +0,0 @@ -/* - * 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 all the load balancer probes. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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 LoadBalancerProbeListResult} 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, loadBalancerName, 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-10-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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { - throw new Error('loadBalancerName 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/loadBalancers/{loadBalancerName}/probes'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); - 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['LoadBalancerProbeListResult']().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 load balancer probe. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} probeName The name of the probe. - * - * @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 Probe} 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, loadBalancerName, probeName, 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-10-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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { - throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); - } - if (probeName === null || probeName === undefined || typeof probeName.valueOf() !== 'string') { - throw new Error('probeName 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/loadBalancers/{loadBalancerName}/probes/{probeName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); - requestUrl = requestUrl.replace('{probeName}', encodeURIComponent(probeName)); - 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['Probe']().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 the load balancer probes. - * - * @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 LoadBalancerProbeListResult} 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['LoadBalancerProbeListResult']().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 LoadBalancerProbes. */ -class LoadBalancerProbes { - /** - * Create a LoadBalancerProbes. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._list = _list; - this._get = _get; - this._listNext = _listNext; - } - - /** - * Gets all the load balancer probes. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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, loadBalancerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, loadBalancerName, 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 the load balancer probes. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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 {LoadBalancerProbeListResult} - 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 LoadBalancerProbeListResult} 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, loadBalancerName, 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, loadBalancerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, loadBalancerName, options, optionalCallback); - } - } - - /** - * Gets load balancer probe. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} probeName The name of the probe. - * - * @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, loadBalancerName, probeName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, loadBalancerName, probeName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets load balancer probe. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {string} probeName The name of the probe. - * - * @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 {Probe} - 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 Probe} 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, loadBalancerName, probeName, 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, loadBalancerName, probeName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, loadBalancerName, probeName, options, optionalCallback); - } - } - - /** - * Gets all the load balancer probes. - * - * @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 the load balancer probes. - * - * @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 {LoadBalancerProbeListResult} - 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 LoadBalancerProbeListResult} 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 = LoadBalancerProbes; diff --git a/lib/services/networkManagement2/lib/operations/loadBalancers.js b/lib/services/networkManagement2/lib/operations/loadBalancers.js deleted file mode 100644 index 5dfcb5fdc..000000000 --- a/lib/services/networkManagement2/lib/operations/loadBalancers.js +++ /dev/null @@ -1,2689 +0,0 @@ -/* - * 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; - - -/** - * Deletes the specified load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, loadBalancerName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, loadBalancerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets the specified load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 LoadBalancer} 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, loadBalancerName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2018-10-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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { - throw new Error('loadBalancerName 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 (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand 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/loadBalancers/{loadBalancerName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } - 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['LoadBalancer']().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); - }); -} - - -/** - * Creates or updates a load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} parameters Parameters supplied to the create or update load - * balancer operation. - * - * @param {object} [parameters.sku] The load balancer SKU. - * - * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible - * values include: 'Basic', 'Standard' - * - * @param {array} [parameters.frontendIPConfigurations] Object representing the - * frontend IPs to be used for the load balancer - * - * @param {array} [parameters.backendAddressPools] Collection of backend - * address pools used by a load balancer - * - * @param {array} [parameters.loadBalancingRules] Object collection - * representing the load balancing rules Gets the provisioning - * - * @param {array} [parameters.probes] Collection of probe objects used in the - * load balancer - * - * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules - * used by a load balancer. Defining inbound NAT rules on your load balancer is - * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are - * referenced from virtual machine scale sets. NICs that are associated with - * individual virtual machines cannot reference an Inbound NAT pool. They have - * to reference individual inbound NAT rules. - * - * @param {array} [parameters.inboundNatPools] Defines an external port range - * for inbound NAT to a single backend port on NICs associated with a load - * balancer. Inbound NAT rules are created automatically for each NIC - * associated with the Load Balancer using an external port from this range. - * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive - * with defining inbound Nat rules. Inbound NAT pools are referenced from - * virtual machine scale sets. NICs that are associated with individual virtual - * machines cannot reference an inbound NAT pool. They have to reference - * individual inbound NAT rules. - * - * @param {array} [parameters.outboundRules] The outbound rules. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * load balancer resource. - * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 LoadBalancer} 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 _createOrUpdate(resourceGroupName, loadBalancerName, parameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, loadBalancerName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['LoadBalancer']().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); - }); - }); -} - - -/** - * Updates a load balancer tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} parameters Parameters supplied to update load balancer tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 LoadBalancer} 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 _updateTags(resourceGroupName, loadBalancerName, parameters, 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.'); - } - - // Send request - this.beginUpdateTags(resourceGroupName, loadBalancerName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['LoadBalancer']().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 the load balancers in a subscription. - * - * @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 LoadBalancerListResult} 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 _listAll(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/loadBalancers'; - 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['LoadBalancerListResult']().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 the load balancers in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 LoadBalancerListResult} 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, 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-10-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 (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/loadBalancers'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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['LoadBalancerListResult']().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); - }); -} - -/** - * Deletes the specified load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, loadBalancerName, 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-10-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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { - throw new Error('loadBalancerName 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/loadBalancers/{loadBalancerName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates a load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} parameters Parameters supplied to the create or update load - * balancer operation. - * - * @param {object} [parameters.sku] The load balancer SKU. - * - * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible - * values include: 'Basic', 'Standard' - * - * @param {array} [parameters.frontendIPConfigurations] Object representing the - * frontend IPs to be used for the load balancer - * - * @param {array} [parameters.backendAddressPools] Collection of backend - * address pools used by a load balancer - * - * @param {array} [parameters.loadBalancingRules] Object collection - * representing the load balancing rules Gets the provisioning - * - * @param {array} [parameters.probes] Collection of probe objects used in the - * load balancer - * - * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules - * used by a load balancer. Defining inbound NAT rules on your load balancer is - * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are - * referenced from virtual machine scale sets. NICs that are associated with - * individual virtual machines cannot reference an Inbound NAT pool. They have - * to reference individual inbound NAT rules. - * - * @param {array} [parameters.inboundNatPools] Defines an external port range - * for inbound NAT to a single backend port on NICs associated with a load - * balancer. Inbound NAT rules are created automatically for each NIC - * associated with the Load Balancer using an external port from this range. - * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive - * with defining inbound Nat rules. Inbound NAT pools are referenced from - * virtual machine scale sets. NICs that are associated with individual virtual - * machines cannot reference an inbound NAT pool. They have to reference - * individual inbound NAT rules. - * - * @param {array} [parameters.outboundRules] The outbound rules. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * load balancer resource. - * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 LoadBalancer} 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 _beginCreateOrUpdate(resourceGroupName, loadBalancerName, parameters, 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-10-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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { - throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/loadBalancers/{loadBalancerName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['LoadBalancer']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['LoadBalancer']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['LoadBalancer']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Updates a load balancer tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} parameters Parameters supplied to update load balancer tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 LoadBalancer} 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 _beginUpdateTags(resourceGroupName, loadBalancerName, parameters, 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-10-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 (loadBalancerName === null || loadBalancerName === undefined || typeof loadBalancerName.valueOf() !== 'string') { - throw new Error('loadBalancerName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/loadBalancers/{loadBalancerName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{loadBalancerName}', encodeURIComponent(loadBalancerName)); - 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 = 'PATCH'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['TagsObject']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // 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['LoadBalancer']().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 the load balancers in a subscription. - * - * @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 LoadBalancerListResult} 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 _listAllNext(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['LoadBalancerListResult']().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 the load balancers in a resource group. - * - * @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 LoadBalancerListResult} 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['LoadBalancerListResult']().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 LoadBalancers. */ -class LoadBalancers { - /** - * Create a LoadBalancers. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._updateTags = _updateTags; - this._listAll = _listAll; - this._list = _list; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdateTags = _beginUpdateTags; - this._listAllNext = _listAllNext; - this._listNext = _listNext; - } - - /** - * Deletes the specified load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, loadBalancerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, loadBalancerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, loadBalancerName, 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._deleteMethod(resourceGroupName, loadBalancerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, loadBalancerName, options, optionalCallback); - } - } - - /** - * Gets the specified load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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, loadBalancerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, loadBalancerName, 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 load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {LoadBalancer} - 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 LoadBalancer} 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, loadBalancerName, 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, loadBalancerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, loadBalancerName, options, optionalCallback); - } - } - - /** - * Creates or updates a load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} parameters Parameters supplied to the create or update load - * balancer operation. - * - * @param {object} [parameters.sku] The load balancer SKU. - * - * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible - * values include: 'Basic', 'Standard' - * - * @param {array} [parameters.frontendIPConfigurations] Object representing the - * frontend IPs to be used for the load balancer - * - * @param {array} [parameters.backendAddressPools] Collection of backend - * address pools used by a load balancer - * - * @param {array} [parameters.loadBalancingRules] Object collection - * representing the load balancing rules Gets the provisioning - * - * @param {array} [parameters.probes] Collection of probe objects used in the - * load balancer - * - * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules - * used by a load balancer. Defining inbound NAT rules on your load balancer is - * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are - * referenced from virtual machine scale sets. NICs that are associated with - * individual virtual machines cannot reference an Inbound NAT pool. They have - * to reference individual inbound NAT rules. - * - * @param {array} [parameters.inboundNatPools] Defines an external port range - * for inbound NAT to a single backend port on NICs associated with a load - * balancer. Inbound NAT rules are created automatically for each NIC - * associated with the Load Balancer using an external port from this range. - * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive - * with defining inbound Nat rules. Inbound NAT pools are referenced from - * virtual machine scale sets. NICs that are associated with individual virtual - * machines cannot reference an inbound NAT pool. They have to reference - * individual inbound NAT rules. - * - * @param {array} [parameters.outboundRules] The outbound rules. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * load balancer resource. - * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, loadBalancerName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, loadBalancerName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} parameters Parameters supplied to the create or update load - * balancer operation. - * - * @param {object} [parameters.sku] The load balancer SKU. - * - * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible - * values include: 'Basic', 'Standard' - * - * @param {array} [parameters.frontendIPConfigurations] Object representing the - * frontend IPs to be used for the load balancer - * - * @param {array} [parameters.backendAddressPools] Collection of backend - * address pools used by a load balancer - * - * @param {array} [parameters.loadBalancingRules] Object collection - * representing the load balancing rules Gets the provisioning - * - * @param {array} [parameters.probes] Collection of probe objects used in the - * load balancer - * - * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules - * used by a load balancer. Defining inbound NAT rules on your load balancer is - * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are - * referenced from virtual machine scale sets. NICs that are associated with - * individual virtual machines cannot reference an Inbound NAT pool. They have - * to reference individual inbound NAT rules. - * - * @param {array} [parameters.inboundNatPools] Defines an external port range - * for inbound NAT to a single backend port on NICs associated with a load - * balancer. Inbound NAT rules are created automatically for each NIC - * associated with the Load Balancer using an external port from this range. - * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive - * with defining inbound Nat rules. Inbound NAT pools are referenced from - * virtual machine scale sets. NICs that are associated with individual virtual - * machines cannot reference an inbound NAT pool. They have to reference - * individual inbound NAT rules. - * - * @param {array} [parameters.outboundRules] The outbound rules. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * load balancer resource. - * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {LoadBalancer} - 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 LoadBalancer} 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. - */ - createOrUpdate(resourceGroupName, loadBalancerName, parameters, 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._createOrUpdate(resourceGroupName, loadBalancerName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, loadBalancerName, parameters, options, optionalCallback); - } - } - - /** - * Updates a load balancer tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} parameters Parameters supplied to update load balancer tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName, loadBalancerName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateTags(resourceGroupName, loadBalancerName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates a load balancer tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} parameters Parameters supplied to update load balancer tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {LoadBalancer} - 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 LoadBalancer} 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. - */ - updateTags(resourceGroupName, loadBalancerName, parameters, 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._updateTags(resourceGroupName, loadBalancerName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateTags(resourceGroupName, loadBalancerName, parameters, options, optionalCallback); - } - } - - /** - * Gets all the load balancers in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAll(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 the load balancers in a subscription. - * - * @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 {LoadBalancerListResult} - 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 LoadBalancerListResult} 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. - */ - listAll(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._listAll(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAll(options, optionalCallback); - } - } - - /** - * Gets all the load balancers in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, 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 the load balancers in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {LoadBalancerListResult} - 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 LoadBalancerListResult} 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, 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, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, options, optionalCallback); - } - } - - /** - * Deletes the specified load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, loadBalancerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, loadBalancerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, loadBalancerName, 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._beginDeleteMethod(resourceGroupName, loadBalancerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, loadBalancerName, options, optionalCallback); - } - } - - /** - * Creates or updates a load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} parameters Parameters supplied to the create or update load - * balancer operation. - * - * @param {object} [parameters.sku] The load balancer SKU. - * - * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible - * values include: 'Basic', 'Standard' - * - * @param {array} [parameters.frontendIPConfigurations] Object representing the - * frontend IPs to be used for the load balancer - * - * @param {array} [parameters.backendAddressPools] Collection of backend - * address pools used by a load balancer - * - * @param {array} [parameters.loadBalancingRules] Object collection - * representing the load balancing rules Gets the provisioning - * - * @param {array} [parameters.probes] Collection of probe objects used in the - * load balancer - * - * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules - * used by a load balancer. Defining inbound NAT rules on your load balancer is - * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are - * referenced from virtual machine scale sets. NICs that are associated with - * individual virtual machines cannot reference an Inbound NAT pool. They have - * to reference individual inbound NAT rules. - * - * @param {array} [parameters.inboundNatPools] Defines an external port range - * for inbound NAT to a single backend port on NICs associated with a load - * balancer. Inbound NAT rules are created automatically for each NIC - * associated with the Load Balancer using an external port from this range. - * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive - * with defining inbound Nat rules. Inbound NAT pools are referenced from - * virtual machine scale sets. NICs that are associated with individual virtual - * machines cannot reference an inbound NAT pool. They have to reference - * individual inbound NAT rules. - * - * @param {array} [parameters.outboundRules] The outbound rules. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * load balancer resource. - * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, loadBalancerName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, loadBalancerName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a load balancer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} parameters Parameters supplied to the create or update load - * balancer operation. - * - * @param {object} [parameters.sku] The load balancer SKU. - * - * @param {string} [parameters.sku.name] Name of a load balancer SKU. Possible - * values include: 'Basic', 'Standard' - * - * @param {array} [parameters.frontendIPConfigurations] Object representing the - * frontend IPs to be used for the load balancer - * - * @param {array} [parameters.backendAddressPools] Collection of backend - * address pools used by a load balancer - * - * @param {array} [parameters.loadBalancingRules] Object collection - * representing the load balancing rules Gets the provisioning - * - * @param {array} [parameters.probes] Collection of probe objects used in the - * load balancer - * - * @param {array} [parameters.inboundNatRules] Collection of inbound NAT Rules - * used by a load balancer. Defining inbound NAT rules on your load balancer is - * mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are - * referenced from virtual machine scale sets. NICs that are associated with - * individual virtual machines cannot reference an Inbound NAT pool. They have - * to reference individual inbound NAT rules. - * - * @param {array} [parameters.inboundNatPools] Defines an external port range - * for inbound NAT to a single backend port on NICs associated with a load - * balancer. Inbound NAT rules are created automatically for each NIC - * associated with the Load Balancer using an external port from this range. - * Defining an Inbound NAT pool on your Load Balancer is mutually exclusive - * with defining inbound Nat rules. Inbound NAT pools are referenced from - * virtual machine scale sets. NICs that are associated with individual virtual - * machines cannot reference an inbound NAT pool. They have to reference - * individual inbound NAT rules. - * - * @param {array} [parameters.outboundRules] The outbound rules. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * load balancer resource. - * - * @param {string} [parameters.provisioningState] Gets the provisioning state - * of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {LoadBalancer} - 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 LoadBalancer} 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. - */ - beginCreateOrUpdate(resourceGroupName, loadBalancerName, parameters, 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._beginCreateOrUpdate(resourceGroupName, loadBalancerName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, loadBalancerName, parameters, options, optionalCallback); - } - } - - /** - * Updates a load balancer tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} parameters Parameters supplied to update load balancer tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName, loadBalancerName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginUpdateTags(resourceGroupName, loadBalancerName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates a load balancer tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} loadBalancerName The name of the load balancer. - * - * @param {object} parameters Parameters supplied to update load balancer tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {LoadBalancer} - 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 LoadBalancer} 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. - */ - beginUpdateTags(resourceGroupName, loadBalancerName, parameters, 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._beginUpdateTags(resourceGroupName, loadBalancerName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginUpdateTags(resourceGroupName, loadBalancerName, parameters, options, optionalCallback); - } - } - - /** - * Gets all the load balancers in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAllNext(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 the load balancers in a subscription. - * - * @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 {LoadBalancerListResult} - 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 LoadBalancerListResult} 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. - */ - listAllNext(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._listAllNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAllNext(nextPageLink, options, optionalCallback); - } - } - - /** - * Gets all the load balancers in a resource group. - * - * @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 the load balancers in a resource group. - * - * @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 {LoadBalancerListResult} - 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 LoadBalancerListResult} 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 = LoadBalancers; diff --git a/lib/services/networkManagement2/lib/operations/localNetworkGateways.js b/lib/services/networkManagement2/lib/operations/localNetworkGateways.js deleted file mode 100644 index eb535b3b3..000000000 --- a/lib/services/networkManagement2/lib/operations/localNetworkGateways.js +++ /dev/null @@ -1,2181 +0,0 @@ -/* - * 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; - - -/** - * Creates or updates a local network gateway in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @param {object} parameters Parameters supplied to the create or update local - * network gateway operation. - * - * @param {object} [parameters.localNetworkAddressSpace] Local network site - * address space. - * - * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [parameters.gatewayIpAddress] IP address of local network - * gateway. - * - * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker - * settings. - * - * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. - * - * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.bgpSettings.peerWeight] The weight added to - * routes learned from this BGP speaker. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * LocalNetworkGateway resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 LocalNetworkGateway} 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 _createOrUpdate(resourceGroupName, localNetworkGatewayName, parameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, localNetworkGatewayName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['LocalNetworkGateway']().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 the specified local network gateway in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @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 LocalNetworkGateway} 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, localNetworkGatewayName, 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-10-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 (localNetworkGatewayName === null || localNetworkGatewayName === undefined || typeof localNetworkGatewayName.valueOf() !== 'string') { - throw new Error('localNetworkGatewayName cannot be null or undefined and it must be of type string.'); - } - if (localNetworkGatewayName !== null && localNetworkGatewayName !== undefined) { - if (localNetworkGatewayName.length < 1) - { - throw new Error('"localNetworkGatewayName" should satisfy the constraint - "MinLength": 1'); - } - } - 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/localNetworkGateways/{localNetworkGatewayName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{localNetworkGatewayName}', encodeURIComponent(localNetworkGatewayName)); - 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['LocalNetworkGateway']().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); - }); -} - - -/** - * Deletes the specified local network gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, localNetworkGatewayName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, localNetworkGatewayName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * Updates a local network gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @param {object} parameters Parameters supplied to update local network - * gateway tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 LocalNetworkGateway} 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 _updateTags(resourceGroupName, localNetworkGatewayName, parameters, 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.'); - } - - // Send request - this.beginUpdateTags(resourceGroupName, localNetworkGatewayName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['LocalNetworkGateway']().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 the local network gateways in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 LocalNetworkGatewayListResult} 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, 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-10-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 (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/localNetworkGateways'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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['LocalNetworkGatewayListResult']().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); - }); -} - -/** - * Creates or updates a local network gateway in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @param {object} parameters Parameters supplied to the create or update local - * network gateway operation. - * - * @param {object} [parameters.localNetworkAddressSpace] Local network site - * address space. - * - * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [parameters.gatewayIpAddress] IP address of local network - * gateway. - * - * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker - * settings. - * - * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. - * - * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.bgpSettings.peerWeight] The weight added to - * routes learned from this BGP speaker. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * LocalNetworkGateway resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 LocalNetworkGateway} 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 _beginCreateOrUpdate(resourceGroupName, localNetworkGatewayName, parameters, 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-10-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 (localNetworkGatewayName === null || localNetworkGatewayName === undefined || typeof localNetworkGatewayName.valueOf() !== 'string') { - throw new Error('localNetworkGatewayName cannot be null or undefined and it must be of type string.'); - } - if (localNetworkGatewayName !== null && localNetworkGatewayName !== undefined) { - if (localNetworkGatewayName.length < 1) - { - throw new Error('"localNetworkGatewayName" should satisfy the constraint - "MinLength": 1'); - } - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/localNetworkGateways/{localNetworkGatewayName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{localNetworkGatewayName}', encodeURIComponent(localNetworkGatewayName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['LocalNetworkGateway']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['LocalNetworkGateway']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['LocalNetworkGateway']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Deletes the specified local network gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, localNetworkGatewayName, 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-10-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 (localNetworkGatewayName === null || localNetworkGatewayName === undefined || typeof localNetworkGatewayName.valueOf() !== 'string') { - throw new Error('localNetworkGatewayName cannot be null or undefined and it must be of type string.'); - } - if (localNetworkGatewayName !== null && localNetworkGatewayName !== undefined) { - if (localNetworkGatewayName.length < 1) - { - throw new Error('"localNetworkGatewayName" should satisfy the constraint - "MinLength": 1'); - } - } - 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/localNetworkGateways/{localNetworkGatewayName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{localNetworkGatewayName}', encodeURIComponent(localNetworkGatewayName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Updates a local network gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @param {object} parameters Parameters supplied to update local network - * gateway tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 LocalNetworkGateway} 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 _beginUpdateTags(resourceGroupName, localNetworkGatewayName, parameters, 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-10-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 (localNetworkGatewayName === null || localNetworkGatewayName === undefined || typeof localNetworkGatewayName.valueOf() !== 'string') { - throw new Error('localNetworkGatewayName cannot be null or undefined and it must be of type string.'); - } - if (localNetworkGatewayName !== null && localNetworkGatewayName !== undefined) { - if (localNetworkGatewayName.length < 1) - { - throw new Error('"localNetworkGatewayName" should satisfy the constraint - "MinLength": 1'); - } - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/localNetworkGateways/{localNetworkGatewayName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{localNetworkGatewayName}', encodeURIComponent(localNetworkGatewayName)); - 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 = 'PATCH'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['TagsObject']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // 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['LocalNetworkGateway']().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 the local network gateways in a resource group. - * - * @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 LocalNetworkGatewayListResult} 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['LocalNetworkGatewayListResult']().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 LocalNetworkGateways. */ -class LocalNetworkGateways { - /** - * Create a LocalNetworkGateways. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._createOrUpdate = _createOrUpdate; - this._get = _get; - this._deleteMethod = _deleteMethod; - this._updateTags = _updateTags; - this._list = _list; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginUpdateTags = _beginUpdateTags; - this._listNext = _listNext; - } - - /** - * Creates or updates a local network gateway in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @param {object} parameters Parameters supplied to the create or update local - * network gateway operation. - * - * @param {object} [parameters.localNetworkAddressSpace] Local network site - * address space. - * - * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [parameters.gatewayIpAddress] IP address of local network - * gateway. - * - * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker - * settings. - * - * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. - * - * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.bgpSettings.peerWeight] The weight added to - * routes learned from this BGP speaker. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * LocalNetworkGateway resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, localNetworkGatewayName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, localNetworkGatewayName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a local network gateway in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @param {object} parameters Parameters supplied to the create or update local - * network gateway operation. - * - * @param {object} [parameters.localNetworkAddressSpace] Local network site - * address space. - * - * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [parameters.gatewayIpAddress] IP address of local network - * gateway. - * - * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker - * settings. - * - * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. - * - * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.bgpSettings.peerWeight] The weight added to - * routes learned from this BGP speaker. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * LocalNetworkGateway resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {LocalNetworkGateway} - 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 LocalNetworkGateway} 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. - */ - createOrUpdate(resourceGroupName, localNetworkGatewayName, parameters, 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._createOrUpdate(resourceGroupName, localNetworkGatewayName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, localNetworkGatewayName, parameters, options, optionalCallback); - } - } - - /** - * Gets the specified local network gateway in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @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, localNetworkGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, localNetworkGatewayName, 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 local network gateway in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @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 {LocalNetworkGateway} - 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 LocalNetworkGateway} 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, localNetworkGatewayName, 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, localNetworkGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, localNetworkGatewayName, options, optionalCallback); - } - } - - /** - * Deletes the specified local network gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, localNetworkGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, localNetworkGatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified local network gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, localNetworkGatewayName, 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._deleteMethod(resourceGroupName, localNetworkGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, localNetworkGatewayName, options, optionalCallback); - } - } - - /** - * Updates a local network gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @param {object} parameters Parameters supplied to update local network - * gateway tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName, localNetworkGatewayName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateTags(resourceGroupName, localNetworkGatewayName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates a local network gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @param {object} parameters Parameters supplied to update local network - * gateway tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {LocalNetworkGateway} - 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 LocalNetworkGateway} 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. - */ - updateTags(resourceGroupName, localNetworkGatewayName, parameters, 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._updateTags(resourceGroupName, localNetworkGatewayName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateTags(resourceGroupName, localNetworkGatewayName, parameters, options, optionalCallback); - } - } - - /** - * Gets all the local network gateways in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, 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 the local network gateways in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {LocalNetworkGatewayListResult} - 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 LocalNetworkGatewayListResult} 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, 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, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, options, optionalCallback); - } - } - - /** - * Creates or updates a local network gateway in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @param {object} parameters Parameters supplied to the create or update local - * network gateway operation. - * - * @param {object} [parameters.localNetworkAddressSpace] Local network site - * address space. - * - * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [parameters.gatewayIpAddress] IP address of local network - * gateway. - * - * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker - * settings. - * - * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. - * - * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.bgpSettings.peerWeight] The weight added to - * routes learned from this BGP speaker. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * LocalNetworkGateway resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, localNetworkGatewayName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, localNetworkGatewayName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a local network gateway in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @param {object} parameters Parameters supplied to the create or update local - * network gateway operation. - * - * @param {object} [parameters.localNetworkAddressSpace] Local network site - * address space. - * - * @param {array} [parameters.localNetworkAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [parameters.gatewayIpAddress] IP address of local network - * gateway. - * - * @param {object} [parameters.bgpSettings] Local network gateway's BGP speaker - * settings. - * - * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. - * - * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.bgpSettings.peerWeight] The weight added to - * routes learned from this BGP speaker. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * LocalNetworkGateway resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {LocalNetworkGateway} - 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 LocalNetworkGateway} 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. - */ - beginCreateOrUpdate(resourceGroupName, localNetworkGatewayName, parameters, 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._beginCreateOrUpdate(resourceGroupName, localNetworkGatewayName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, localNetworkGatewayName, parameters, options, optionalCallback); - } - } - - /** - * Deletes the specified local network gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, localNetworkGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, localNetworkGatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified local network gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, localNetworkGatewayName, 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._beginDeleteMethod(resourceGroupName, localNetworkGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, localNetworkGatewayName, options, optionalCallback); - } - } - - /** - * Updates a local network gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @param {object} parameters Parameters supplied to update local network - * gateway tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName, localNetworkGatewayName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginUpdateTags(resourceGroupName, localNetworkGatewayName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates a local network gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} localNetworkGatewayName The name of the local network - * gateway. - * - * @param {object} parameters Parameters supplied to update local network - * gateway tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {LocalNetworkGateway} - 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 LocalNetworkGateway} 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. - */ - beginUpdateTags(resourceGroupName, localNetworkGatewayName, parameters, 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._beginUpdateTags(resourceGroupName, localNetworkGatewayName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginUpdateTags(resourceGroupName, localNetworkGatewayName, parameters, options, optionalCallback); - } - } - - /** - * Gets all the local network gateways in a resource group. - * - * @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 the local network gateways in a resource group. - * - * @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 {LocalNetworkGatewayListResult} - 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 LocalNetworkGatewayListResult} 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 = LocalNetworkGateways; diff --git a/lib/services/networkManagement2/lib/operations/networkInterfaceIPConfigurations.js b/lib/services/networkManagement2/lib/operations/networkInterfaceIPConfigurations.js deleted file mode 100644 index 16dc14bbb..000000000 --- a/lib/services/networkManagement2/lib/operations/networkInterfaceIPConfigurations.js +++ /dev/null @@ -1,717 +0,0 @@ -/* - * 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; - -/** - * Get all ip configurations in a network interface - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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 NetworkInterfaceIPConfigurationListResult} - * 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, networkInterfaceName, 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-10-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 (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { - throw new Error('networkInterfaceName 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/networkInterfaces/{networkInterfaceName}/ipConfigurations'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); - 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['NetworkInterfaceIPConfigurationListResult']().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 the specified network interface ip configuration. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} ipConfigurationName The name of the ip configuration name. - * - * @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 NetworkInterfaceIPConfiguration} 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, networkInterfaceName, ipConfigurationName, 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-10-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 (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { - throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); - } - if (ipConfigurationName === null || ipConfigurationName === undefined || typeof ipConfigurationName.valueOf() !== 'string') { - throw new Error('ipConfigurationName 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/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); - requestUrl = requestUrl.replace('{ipConfigurationName}', encodeURIComponent(ipConfigurationName)); - 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['NetworkInterfaceIPConfiguration']().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); - }); -} - -/** - * Get all ip configurations in a network interface - * - * @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 NetworkInterfaceIPConfigurationListResult} - * 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['NetworkInterfaceIPConfigurationListResult']().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 NetworkInterfaceIPConfigurations. */ -class NetworkInterfaceIPConfigurations { - /** - * Create a NetworkInterfaceIPConfigurations. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._list = _list; - this._get = _get; - this._listNext = _listNext; - } - - /** - * Get all ip configurations in a network interface - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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, networkInterfaceName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Get all ip configurations in a network interface - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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 {NetworkInterfaceIPConfigurationListResult} - 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 NetworkInterfaceIPConfigurationListResult} - * 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, networkInterfaceName, 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, networkInterfaceName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, networkInterfaceName, options, optionalCallback); - } - } - - /** - * Gets the specified network interface ip configuration. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} ipConfigurationName The name of the ip configuration name. - * - * @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, networkInterfaceName, ipConfigurationName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, networkInterfaceName, ipConfigurationName, 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 network interface ip configuration. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} ipConfigurationName The name of the ip configuration name. - * - * @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 {NetworkInterfaceIPConfiguration} - 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 NetworkInterfaceIPConfiguration} 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, networkInterfaceName, ipConfigurationName, 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, networkInterfaceName, ipConfigurationName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, networkInterfaceName, ipConfigurationName, options, optionalCallback); - } - } - - /** - * Get all ip configurations in a network interface - * - * @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; - }); - }); - } - - /** - * Get all ip configurations in a network interface - * - * @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 {NetworkInterfaceIPConfigurationListResult} - 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 NetworkInterfaceIPConfigurationListResult} - * 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 = NetworkInterfaceIPConfigurations; diff --git a/lib/services/networkManagement2/lib/operations/networkInterfaceLoadBalancers.js b/lib/services/networkManagement2/lib/operations/networkInterfaceLoadBalancers.js deleted file mode 100644 index 9edcfdf8d..000000000 --- a/lib/services/networkManagement2/lib/operations/networkInterfaceLoadBalancers.js +++ /dev/null @@ -1,475 +0,0 @@ -/* - * 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; - -/** - * List all load balancers in a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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 NetworkInterfaceLoadBalancerListResult} 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, networkInterfaceName, 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-10-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 (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { - throw new Error('networkInterfaceName 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/networkInterfaces/{networkInterfaceName}/loadBalancers'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); - 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['NetworkInterfaceLoadBalancerListResult']().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); - }); -} - -/** - * List all load balancers in a network interface. - * - * @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 NetworkInterfaceLoadBalancerListResult} 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['NetworkInterfaceLoadBalancerListResult']().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 NetworkInterfaceLoadBalancers. */ -class NetworkInterfaceLoadBalancers { - /** - * Create a NetworkInterfaceLoadBalancers. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._list = _list; - this._listNext = _listNext; - } - - /** - * List all load balancers in a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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, networkInterfaceName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * List all load balancers in a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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 {NetworkInterfaceLoadBalancerListResult} - 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 NetworkInterfaceLoadBalancerListResult} 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, networkInterfaceName, 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, networkInterfaceName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, networkInterfaceName, options, optionalCallback); - } - } - - /** - * List all load balancers in a network interface. - * - * @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; - }); - }); - } - - /** - * List all load balancers in a network interface. - * - * @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 {NetworkInterfaceLoadBalancerListResult} - 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 NetworkInterfaceLoadBalancerListResult} 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 = NetworkInterfaceLoadBalancers; diff --git a/lib/services/networkManagement2/lib/operations/networkInterfaceTapConfigurations.js b/lib/services/networkManagement2/lib/operations/networkInterfaceTapConfigurations.js deleted file mode 100644 index 913636d8d..000000000 --- a/lib/services/networkManagement2/lib/operations/networkInterfaceTapConfigurations.js +++ /dev/null @@ -1,3714 +0,0 @@ -/* - * 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; - - -/** - * Deletes the specified tap configuration from the NetworkInterface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} tapConfigurationName The name of the tap configuration. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, networkInterfaceName, tapConfigurationName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, networkInterfaceName, tapConfigurationName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Get the specified tap configuration on a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} tapConfigurationName The name of the tap configuration. - * - * @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 NetworkInterfaceTapConfiguration} 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, networkInterfaceName, tapConfigurationName, 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-10-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 (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { - throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); - } - if (tapConfigurationName === null || tapConfigurationName === undefined || typeof tapConfigurationName.valueOf() !== 'string') { - throw new Error('tapConfigurationName 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/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); - requestUrl = requestUrl.replace('{tapConfigurationName}', encodeURIComponent(tapConfigurationName)); - 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['NetworkInterfaceTapConfiguration']().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); - }); -} - - -/** - * Creates or updates a Tap configuration in the specified NetworkInterface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} tapConfigurationName The name of the tap configuration. - * - * @param {object} tapConfigurationParameters Parameters supplied to the create - * or update tap configuration operation. - * - * @param {object} [tapConfigurationParameters.virtualNetworkTap] The reference - * of the Virtual Network Tap resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration] - * The reference to the private IP Address of the collector nic that will - * receive the tap - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.virtualNetworkTaps] - * The reference to Virtual Network Taps. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.applicationGatewayBackendAddressPools] - * The reference of ApplicationGatewayBackendAddressPool resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.loadBalancerBackendAddressPools] - * The reference of LoadBalancerBackendAddressPool resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.loadBalancerInboundNatRules] - * A list of references of LoadBalancerInboundNatRules. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAddress] - * Private IP address of the IP configuration. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAllocationMethod] - * Defines how a private IP address is assigned. Possible values are: 'Static' - * and 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAddressVersion] - * Available from Api-Version 2016-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet] - * Subnet bound to the IP configuration. - * - * @param {boolean} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.primary] - * Gets whether this is a primary customer address on the network interface. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress] - * Public IP address bound to the IP configuration. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.applicationSecurityGroups] - * Application security groups in which the IP configuration is included. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.provisioningState] - * The provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.id] - * Resource ID. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration] - * The reference to the private IP address on the internal Load Balancer that - * will receive the tap - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.privateIPAllocationMethod] - * The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet] - * The reference of the subnet resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.tags] - * Resource tags. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * - * @param {boolean} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.tags] - * Resource tags. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.id] - * Resource ID. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress] - * The reference of the Public IP resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku] - * The public IP address SKU. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku.name] - * Name of a public IP address SKU. Possible values include: 'Basic', - * 'Standard' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is specified, - * an A DNS record is created for the public IP in the Microsoft Azure DNS - * system. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and the - * regionalized DNS zone. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipTags] - * The list of tags associated with the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipAddress] - * The IP address associated with the public IP address resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * - * @param {number} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.tags] - * Resource tags. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix] - * The reference of the Public IP Prefix resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.id] - * Resource ID. - * - * @param {number} - * [tapConfigurationParameters.virtualNetworkTap.destinationPort] The VXLAN - * destination port that will receive the tapped traffic. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.etag] Gets a - * unique read-only string that changes whenever the resource is updated. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.id] Resource - * ID. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.location] - * Resource location. - * - * @param {object} [tapConfigurationParameters.virtualNetworkTap.tags] Resource - * tags. - * - * @param {string} [tapConfigurationParameters.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [tapConfigurationParameters.etag] A unique read-only string - * that changes whenever the resource is updated. - * - * @param {string} [tapConfigurationParameters.id] Resource ID. - * - * @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 NetworkInterfaceTapConfiguration} 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 _createOrUpdate(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['NetworkInterfaceTapConfiguration']().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); - }); - }); -} - -/** - * Get all Tap configurations in a network interface - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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 NetworkInterfaceTapConfigurationListResult} - * 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, networkInterfaceName, 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-10-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 (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { - throw new Error('networkInterfaceName 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/networkInterfaces/{networkInterfaceName}/tapConfigurations'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); - 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['NetworkInterfaceTapConfigurationListResult']().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); - }); -} - -/** - * Deletes the specified tap configuration from the NetworkInterface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} tapConfigurationName The name of the tap configuration. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, networkInterfaceName, tapConfigurationName, 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-10-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 (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { - throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); - } - if (tapConfigurationName === null || tapConfigurationName === undefined || typeof tapConfigurationName.valueOf() !== 'string') { - throw new Error('tapConfigurationName 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/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); - requestUrl = requestUrl.replace('{tapConfigurationName}', encodeURIComponent(tapConfigurationName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates a Tap configuration in the specified NetworkInterface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} tapConfigurationName The name of the tap configuration. - * - * @param {object} tapConfigurationParameters Parameters supplied to the create - * or update tap configuration operation. - * - * @param {object} [tapConfigurationParameters.virtualNetworkTap] The reference - * of the Virtual Network Tap resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration] - * The reference to the private IP Address of the collector nic that will - * receive the tap - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.virtualNetworkTaps] - * The reference to Virtual Network Taps. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.applicationGatewayBackendAddressPools] - * The reference of ApplicationGatewayBackendAddressPool resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.loadBalancerBackendAddressPools] - * The reference of LoadBalancerBackendAddressPool resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.loadBalancerInboundNatRules] - * A list of references of LoadBalancerInboundNatRules. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAddress] - * Private IP address of the IP configuration. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAllocationMethod] - * Defines how a private IP address is assigned. Possible values are: 'Static' - * and 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAddressVersion] - * Available from Api-Version 2016-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet] - * Subnet bound to the IP configuration. - * - * @param {boolean} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.primary] - * Gets whether this is a primary customer address on the network interface. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress] - * Public IP address bound to the IP configuration. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.applicationSecurityGroups] - * Application security groups in which the IP configuration is included. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.provisioningState] - * The provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.id] - * Resource ID. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration] - * The reference to the private IP address on the internal Load Balancer that - * will receive the tap - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.privateIPAllocationMethod] - * The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet] - * The reference of the subnet resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.tags] - * Resource tags. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * - * @param {boolean} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.tags] - * Resource tags. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.id] - * Resource ID. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress] - * The reference of the Public IP resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku] - * The public IP address SKU. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku.name] - * Name of a public IP address SKU. Possible values include: 'Basic', - * 'Standard' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is specified, - * an A DNS record is created for the public IP in the Microsoft Azure DNS - * system. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and the - * regionalized DNS zone. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipTags] - * The list of tags associated with the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipAddress] - * The IP address associated with the public IP address resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * - * @param {number} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.tags] - * Resource tags. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix] - * The reference of the Public IP Prefix resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.id] - * Resource ID. - * - * @param {number} - * [tapConfigurationParameters.virtualNetworkTap.destinationPort] The VXLAN - * destination port that will receive the tapped traffic. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.etag] Gets a - * unique read-only string that changes whenever the resource is updated. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.id] Resource - * ID. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.location] - * Resource location. - * - * @param {object} [tapConfigurationParameters.virtualNetworkTap.tags] Resource - * tags. - * - * @param {string} [tapConfigurationParameters.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [tapConfigurationParameters.etag] A unique read-only string - * that changes whenever the resource is updated. - * - * @param {string} [tapConfigurationParameters.id] Resource ID. - * - * @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 NetworkInterfaceTapConfiguration} 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 _beginCreateOrUpdate(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, 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-10-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 (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { - throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); - } - if (tapConfigurationName === null || tapConfigurationName === undefined || typeof tapConfigurationName.valueOf() !== 'string') { - throw new Error('tapConfigurationName cannot be null or undefined and it must be of type string.'); - } - if (tapConfigurationParameters === null || tapConfigurationParameters === undefined) { - throw new Error('tapConfigurationParameters cannot be null or undefined.'); - } - 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/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); - requestUrl = requestUrl.replace('{tapConfigurationName}', encodeURIComponent(tapConfigurationName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (tapConfigurationParameters !== null && tapConfigurationParameters !== undefined) { - let requestModelMapper = new client.models['NetworkInterfaceTapConfiguration']().mapper(); - requestModel = client.serialize(requestModelMapper, tapConfigurationParameters, 'tapConfigurationParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(tapConfigurationParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['NetworkInterfaceTapConfiguration']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['NetworkInterfaceTapConfiguration']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Get all Tap configurations in a network interface - * - * @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 NetworkInterfaceTapConfigurationListResult} - * 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['NetworkInterfaceTapConfigurationListResult']().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 NetworkInterfaceTapConfigurations. */ -class NetworkInterfaceTapConfigurations { - /** - * Create a NetworkInterfaceTapConfigurations. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._list = _list; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._listNext = _listNext; - } - - /** - * Deletes the specified tap configuration from the NetworkInterface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} tapConfigurationName The name of the tap configuration. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, networkInterfaceName, tapConfigurationName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, networkInterfaceName, tapConfigurationName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified tap configuration from the NetworkInterface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} tapConfigurationName The name of the tap configuration. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, networkInterfaceName, tapConfigurationName, 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._deleteMethod(resourceGroupName, networkInterfaceName, tapConfigurationName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, networkInterfaceName, tapConfigurationName, options, optionalCallback); - } - } - - /** - * Get the specified tap configuration on a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} tapConfigurationName The name of the tap configuration. - * - * @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, networkInterfaceName, tapConfigurationName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, networkInterfaceName, tapConfigurationName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Get the specified tap configuration on a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} tapConfigurationName The name of the tap configuration. - * - * @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 {NetworkInterfaceTapConfiguration} - 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 NetworkInterfaceTapConfiguration} 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, networkInterfaceName, tapConfigurationName, 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, networkInterfaceName, tapConfigurationName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, networkInterfaceName, tapConfigurationName, options, optionalCallback); - } - } - - /** - * Creates or updates a Tap configuration in the specified NetworkInterface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} tapConfigurationName The name of the tap configuration. - * - * @param {object} tapConfigurationParameters Parameters supplied to the create - * or update tap configuration operation. - * - * @param {object} [tapConfigurationParameters.virtualNetworkTap] The reference - * of the Virtual Network Tap resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration] - * The reference to the private IP Address of the collector nic that will - * receive the tap - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.virtualNetworkTaps] - * The reference to Virtual Network Taps. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.applicationGatewayBackendAddressPools] - * The reference of ApplicationGatewayBackendAddressPool resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.loadBalancerBackendAddressPools] - * The reference of LoadBalancerBackendAddressPool resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.loadBalancerInboundNatRules] - * A list of references of LoadBalancerInboundNatRules. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAddress] - * Private IP address of the IP configuration. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAllocationMethod] - * Defines how a private IP address is assigned. Possible values are: 'Static' - * and 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAddressVersion] - * Available from Api-Version 2016-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet] - * Subnet bound to the IP configuration. - * - * @param {boolean} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.primary] - * Gets whether this is a primary customer address on the network interface. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress] - * Public IP address bound to the IP configuration. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.applicationSecurityGroups] - * Application security groups in which the IP configuration is included. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.provisioningState] - * The provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.id] - * Resource ID. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration] - * The reference to the private IP address on the internal Load Balancer that - * will receive the tap - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.privateIPAllocationMethod] - * The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet] - * The reference of the subnet resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.tags] - * Resource tags. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * - * @param {boolean} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.tags] - * Resource tags. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.id] - * Resource ID. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress] - * The reference of the Public IP resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku] - * The public IP address SKU. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku.name] - * Name of a public IP address SKU. Possible values include: 'Basic', - * 'Standard' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is specified, - * an A DNS record is created for the public IP in the Microsoft Azure DNS - * system. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and the - * regionalized DNS zone. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipTags] - * The list of tags associated with the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipAddress] - * The IP address associated with the public IP address resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * - * @param {number} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.tags] - * Resource tags. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix] - * The reference of the Public IP Prefix resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.id] - * Resource ID. - * - * @param {number} - * [tapConfigurationParameters.virtualNetworkTap.destinationPort] The VXLAN - * destination port that will receive the tapped traffic. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.etag] Gets a - * unique read-only string that changes whenever the resource is updated. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.id] Resource - * ID. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.location] - * Resource location. - * - * @param {object} [tapConfigurationParameters.virtualNetworkTap.tags] Resource - * tags. - * - * @param {string} [tapConfigurationParameters.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [tapConfigurationParameters.etag] A unique read-only string - * that changes whenever the resource is updated. - * - * @param {string} [tapConfigurationParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a Tap configuration in the specified NetworkInterface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} tapConfigurationName The name of the tap configuration. - * - * @param {object} tapConfigurationParameters Parameters supplied to the create - * or update tap configuration operation. - * - * @param {object} [tapConfigurationParameters.virtualNetworkTap] The reference - * of the Virtual Network Tap resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration] - * The reference to the private IP Address of the collector nic that will - * receive the tap - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.virtualNetworkTaps] - * The reference to Virtual Network Taps. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.applicationGatewayBackendAddressPools] - * The reference of ApplicationGatewayBackendAddressPool resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.loadBalancerBackendAddressPools] - * The reference of LoadBalancerBackendAddressPool resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.loadBalancerInboundNatRules] - * A list of references of LoadBalancerInboundNatRules. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAddress] - * Private IP address of the IP configuration. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAllocationMethod] - * Defines how a private IP address is assigned. Possible values are: 'Static' - * and 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAddressVersion] - * Available from Api-Version 2016-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet] - * Subnet bound to the IP configuration. - * - * @param {boolean} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.primary] - * Gets whether this is a primary customer address on the network interface. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress] - * Public IP address bound to the IP configuration. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.applicationSecurityGroups] - * Application security groups in which the IP configuration is included. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.provisioningState] - * The provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.id] - * Resource ID. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration] - * The reference to the private IP address on the internal Load Balancer that - * will receive the tap - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.privateIPAllocationMethod] - * The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet] - * The reference of the subnet resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.tags] - * Resource tags. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * - * @param {boolean} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.tags] - * Resource tags. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.id] - * Resource ID. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress] - * The reference of the Public IP resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku] - * The public IP address SKU. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku.name] - * Name of a public IP address SKU. Possible values include: 'Basic', - * 'Standard' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is specified, - * an A DNS record is created for the public IP in the Microsoft Azure DNS - * system. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and the - * regionalized DNS zone. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipTags] - * The list of tags associated with the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipAddress] - * The IP address associated with the public IP address resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * - * @param {number} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.tags] - * Resource tags. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix] - * The reference of the Public IP Prefix resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.id] - * Resource ID. - * - * @param {number} - * [tapConfigurationParameters.virtualNetworkTap.destinationPort] The VXLAN - * destination port that will receive the tapped traffic. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.etag] Gets a - * unique read-only string that changes whenever the resource is updated. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.id] Resource - * ID. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.location] - * Resource location. - * - * @param {object} [tapConfigurationParameters.virtualNetworkTap.tags] Resource - * tags. - * - * @param {string} [tapConfigurationParameters.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [tapConfigurationParameters.etag] A unique read-only string - * that changes whenever the resource is updated. - * - * @param {string} [tapConfigurationParameters.id] Resource ID. - * - * @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 {NetworkInterfaceTapConfiguration} - 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 NetworkInterfaceTapConfiguration} 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. - */ - createOrUpdate(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, 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._createOrUpdate(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, options, optionalCallback); - } - } - - /** - * Get all Tap configurations in a network interface - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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, networkInterfaceName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Get all Tap configurations in a network interface - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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 {NetworkInterfaceTapConfigurationListResult} - 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 NetworkInterfaceTapConfigurationListResult} - * 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, networkInterfaceName, 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, networkInterfaceName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, networkInterfaceName, options, optionalCallback); - } - } - - /** - * Deletes the specified tap configuration from the NetworkInterface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} tapConfigurationName The name of the tap configuration. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, networkInterfaceName, tapConfigurationName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, networkInterfaceName, tapConfigurationName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified tap configuration from the NetworkInterface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} tapConfigurationName The name of the tap configuration. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, networkInterfaceName, tapConfigurationName, 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._beginDeleteMethod(resourceGroupName, networkInterfaceName, tapConfigurationName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, networkInterfaceName, tapConfigurationName, options, optionalCallback); - } - } - - /** - * Creates or updates a Tap configuration in the specified NetworkInterface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} tapConfigurationName The name of the tap configuration. - * - * @param {object} tapConfigurationParameters Parameters supplied to the create - * or update tap configuration operation. - * - * @param {object} [tapConfigurationParameters.virtualNetworkTap] The reference - * of the Virtual Network Tap resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration] - * The reference to the private IP Address of the collector nic that will - * receive the tap - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.virtualNetworkTaps] - * The reference to Virtual Network Taps. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.applicationGatewayBackendAddressPools] - * The reference of ApplicationGatewayBackendAddressPool resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.loadBalancerBackendAddressPools] - * The reference of LoadBalancerBackendAddressPool resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.loadBalancerInboundNatRules] - * A list of references of LoadBalancerInboundNatRules. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAddress] - * Private IP address of the IP configuration. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAllocationMethod] - * Defines how a private IP address is assigned. Possible values are: 'Static' - * and 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAddressVersion] - * Available from Api-Version 2016-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet] - * Subnet bound to the IP configuration. - * - * @param {boolean} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.primary] - * Gets whether this is a primary customer address on the network interface. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress] - * Public IP address bound to the IP configuration. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.applicationSecurityGroups] - * Application security groups in which the IP configuration is included. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.provisioningState] - * The provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.id] - * Resource ID. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration] - * The reference to the private IP address on the internal Load Balancer that - * will receive the tap - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.privateIPAllocationMethod] - * The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet] - * The reference of the subnet resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.tags] - * Resource tags. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * - * @param {boolean} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.tags] - * Resource tags. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.id] - * Resource ID. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress] - * The reference of the Public IP resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku] - * The public IP address SKU. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku.name] - * Name of a public IP address SKU. Possible values include: 'Basic', - * 'Standard' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is specified, - * an A DNS record is created for the public IP in the Microsoft Azure DNS - * system. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and the - * regionalized DNS zone. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipTags] - * The list of tags associated with the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipAddress] - * The IP address associated with the public IP address resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * - * @param {number} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.tags] - * Resource tags. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix] - * The reference of the Public IP Prefix resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.id] - * Resource ID. - * - * @param {number} - * [tapConfigurationParameters.virtualNetworkTap.destinationPort] The VXLAN - * destination port that will receive the tapped traffic. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.etag] Gets a - * unique read-only string that changes whenever the resource is updated. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.id] Resource - * ID. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.location] - * Resource location. - * - * @param {object} [tapConfigurationParameters.virtualNetworkTap.tags] Resource - * tags. - * - * @param {string} [tapConfigurationParameters.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [tapConfigurationParameters.etag] A unique read-only string - * that changes whenever the resource is updated. - * - * @param {string} [tapConfigurationParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a Tap configuration in the specified NetworkInterface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} tapConfigurationName The name of the tap configuration. - * - * @param {object} tapConfigurationParameters Parameters supplied to the create - * or update tap configuration operation. - * - * @param {object} [tapConfigurationParameters.virtualNetworkTap] The reference - * of the Virtual Network Tap resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration] - * The reference to the private IP Address of the collector nic that will - * receive the tap - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.virtualNetworkTaps] - * The reference to Virtual Network Taps. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.applicationGatewayBackendAddressPools] - * The reference of ApplicationGatewayBackendAddressPool resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.loadBalancerBackendAddressPools] - * The reference of LoadBalancerBackendAddressPool resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.loadBalancerInboundNatRules] - * A list of references of LoadBalancerInboundNatRules. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAddress] - * Private IP address of the IP configuration. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAllocationMethod] - * Defines how a private IP address is assigned. Possible values are: 'Static' - * and 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.privateIPAddressVersion] - * Available from Api-Version 2016-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.subnet] - * Subnet bound to the IP configuration. - * - * @param {boolean} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.primary] - * Gets whether this is a primary customer address on the network interface. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.publicIPAddress] - * Public IP address bound to the IP configuration. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.applicationSecurityGroups] - * Application security groups in which the IP configuration is included. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.provisioningState] - * The provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationNetworkInterfaceIPConfiguration.id] - * Resource ID. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration] - * The reference to the private IP address on the internal Load Balancer that - * will receive the tap - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.privateIPAllocationMethod] - * The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet] - * The reference of the subnet resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.tags] - * Resource tags. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * - * @param {boolean} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.tags] - * Resource tags. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.subnet.id] - * Resource ID. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress] - * The reference of the Public IP resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku] - * The public IP address SKU. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku.name] - * Name of a public IP address SKU. Possible values include: 'Basic', - * 'Standard' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is specified, - * an A DNS record is created for the public IP in the Microsoft Azure DNS - * system. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and the - * regionalized DNS zone. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipTags] - * The list of tags associated with the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipAddress] - * The IP address associated with the public IP address resource. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * - * @param {number} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.location] - * Resource location. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.tags] - * Resource tags. - * - * @param {object} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix] - * The reference of the Public IP Prefix resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix.id] - * Resource ID. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [tapConfigurationParameters.virtualNetworkTap.destinationLoadBalancerFrontEndIPConfiguration.id] - * Resource ID. - * - * @param {number} - * [tapConfigurationParameters.virtualNetworkTap.destinationPort] The VXLAN - * destination port that will receive the tapped traffic. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.etag] Gets a - * unique read-only string that changes whenever the resource is updated. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.id] Resource - * ID. - * - * @param {string} [tapConfigurationParameters.virtualNetworkTap.location] - * Resource location. - * - * @param {object} [tapConfigurationParameters.virtualNetworkTap.tags] Resource - * tags. - * - * @param {string} [tapConfigurationParameters.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [tapConfigurationParameters.etag] A unique read-only string - * that changes whenever the resource is updated. - * - * @param {string} [tapConfigurationParameters.id] Resource ID. - * - * @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 {NetworkInterfaceTapConfiguration} - 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 NetworkInterfaceTapConfiguration} 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. - */ - beginCreateOrUpdate(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, 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._beginCreateOrUpdate(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters, options, optionalCallback); - } - } - - /** - * Get all Tap configurations in a network interface - * - * @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; - }); - }); - } - - /** - * Get all Tap configurations in a network interface - * - * @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 {NetworkInterfaceTapConfigurationListResult} - 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 NetworkInterfaceTapConfigurationListResult} - * 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 = NetworkInterfaceTapConfigurations; diff --git a/lib/services/networkManagement2/lib/operations/networkInterfaces.js b/lib/services/networkManagement2/lib/operations/networkInterfaces.js deleted file mode 100644 index e3283aa2b..000000000 --- a/lib/services/networkManagement2/lib/operations/networkInterfaces.js +++ /dev/null @@ -1,5646 +0,0 @@ -/* - * 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; - - -/** - * Deletes the specified network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, networkInterfaceName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, networkInterfaceName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets information about the specified network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 NetworkInterface} 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, networkInterfaceName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2018-10-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 (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { - throw new Error('networkInterfaceName 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 (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand 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/networkInterfaces/{networkInterfaceName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } - 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['NetworkInterface']().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); - }); -} - - -/** - * Creates or updates a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} parameters Parameters supplied to the create or update - * network interface operation. - * - * @param {object} [parameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * - * @param {array} [parameters.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * - * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * - * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. - * - * @param {string} [parameters.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.networkSecurityGroup.id] Resource ID. - * - * @param {string} [parameters.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. - * - * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of - * the network interface. - * - * @param {array} [parameters.tapConfigurations] A list of TapConfigurations of - * the network interface. - * - * @param {object} [parameters.dnsSettings] The DNS settings in network - * interface. - * - * @param {array} [parameters.dnsSettings.dnsServers] List of DNS servers IP - * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS - * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it - * must be the only value in dnsServers collection. - * - * @param {array} [parameters.dnsSettings.appliedDnsServers] If the VM that - * uses this NIC is part of an Availability Set, then this list will have the - * union of all DNS servers from all NICs that are part of the Availability - * Set. This property is what is configured on each of those VMs. - * - * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS - * name for this NIC used for internal communications between VMs in the same - * virtual network. - * - * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS - * name supporting internal communications between VMs in the same virtual - * network. - * - * @param {string} [parameters.dnsSettings.internalDomainNameSuffix] Even if - * internalDnsNameLabel is not specified, a DNS entry is created for the - * primary NIC of the VM. This DNS name can be constructed by concatenating the - * VM name with the value of internalDomainNameSuffix. - * - * @param {string} [parameters.macAddress] The MAC address of the network - * interface. - * - * @param {boolean} [parameters.primary] Gets whether this is a primary network - * interface on a virtual machine. - * - * @param {boolean} [parameters.enableAcceleratedNetworking] If the network - * interface is accelerated networking enabled. - * - * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP - * forwarding is enabled on this network interface. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network interface resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 NetworkInterface} 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 _createOrUpdate(resourceGroupName, networkInterfaceName, parameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, networkInterfaceName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['NetworkInterface']().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); - }); - }); -} - - -/** - * Updates a network interface tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} parameters Parameters supplied to update network interface - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 NetworkInterface} 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 _updateTags(resourceGroupName, networkInterfaceName, parameters, 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.'); - } - - // Send request - this.beginUpdateTags(resourceGroupName, networkInterfaceName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['NetworkInterface']().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 network interfaces in a subscription. - * - * @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 NetworkInterfaceListResult} 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 _listAll(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/networkInterfaces'; - 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['NetworkInterfaceListResult']().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 network interfaces in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 NetworkInterfaceListResult} 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, 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-10-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 (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/networkInterfaces'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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['NetworkInterfaceListResult']().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 route tables applied to a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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 EffectiveRouteListResult} 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 _getEffectiveRouteTable(resourceGroupName, networkInterfaceName, 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.'); - } - - // Send request - this.beginGetEffectiveRouteTable(resourceGroupName, networkInterfaceName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['EffectiveRouteListResult']().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 network security groups applied to a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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 EffectiveNetworkSecurityGroupListResult} 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 _listEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, 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.'); - } - - // Send request - this.beginListEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['EffectiveNetworkSecurityGroupListResult']().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 information about all network interfaces in a virtual machine in a - * virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @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 NetworkInterfaceListResult} 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 _listVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, 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 = '2017-03-30'; - // 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 (virtualMachineScaleSetName === null || virtualMachineScaleSetName === undefined || typeof virtualMachineScaleSetName.valueOf() !== 'string') { - throw new Error('virtualMachineScaleSetName cannot be null or undefined and it must be of type string.'); - } - if (virtualmachineIndex === null || virtualmachineIndex === undefined || typeof virtualmachineIndex.valueOf() !== 'string') { - throw new Error('virtualmachineIndex 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.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualMachineScaleSetName}', encodeURIComponent(virtualMachineScaleSetName)); - requestUrl = requestUrl.replace('{virtualmachineIndex}', encodeURIComponent(virtualmachineIndex)); - 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['NetworkInterfaceListResult']().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 network interfaces in a virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @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 NetworkInterfaceListResult} 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 _listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, 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 = '2017-03-30'; - // 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 (virtualMachineScaleSetName === null || virtualMachineScaleSetName === undefined || typeof virtualMachineScaleSetName.valueOf() !== 'string') { - throw new Error('virtualMachineScaleSetName 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.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualMachineScaleSetName}', encodeURIComponent(virtualMachineScaleSetName)); - 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['NetworkInterfaceListResult']().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); - }); -} - -/** - * Get the specified network interface in a virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 NetworkInterface} 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 _getVirtualMachineScaleSetNetworkInterface(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2017-03-30'; - // 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 (virtualMachineScaleSetName === null || virtualMachineScaleSetName === undefined || typeof virtualMachineScaleSetName.valueOf() !== 'string') { - throw new Error('virtualMachineScaleSetName cannot be null or undefined and it must be of type string.'); - } - if (virtualmachineIndex === null || virtualmachineIndex === undefined || typeof virtualmachineIndex.valueOf() !== 'string') { - throw new Error('virtualmachineIndex cannot be null or undefined and it must be of type string.'); - } - if (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { - throw new Error('networkInterfaceName 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 (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand 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.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualMachineScaleSetName}', encodeURIComponent(virtualMachineScaleSetName)); - requestUrl = requestUrl.replace('{virtualmachineIndex}', encodeURIComponent(virtualmachineIndex)); - requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } - 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['NetworkInterface']().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); - }); -} - -/** - * Get the specified network interface ip configuration in a virtual machine - * scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 NetworkInterfaceIPConfigurationListResult} - * 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 _listVirtualMachineScaleSetIpConfigurations(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2017-03-30'; - // 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 (virtualMachineScaleSetName === null || virtualMachineScaleSetName === undefined || typeof virtualMachineScaleSetName.valueOf() !== 'string') { - throw new Error('virtualMachineScaleSetName cannot be null or undefined and it must be of type string.'); - } - if (virtualmachineIndex === null || virtualmachineIndex === undefined || typeof virtualmachineIndex.valueOf() !== 'string') { - throw new Error('virtualmachineIndex cannot be null or undefined and it must be of type string.'); - } - if (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { - throw new Error('networkInterfaceName 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 (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand 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.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualMachineScaleSetName}', encodeURIComponent(virtualMachineScaleSetName)); - requestUrl = requestUrl.replace('{virtualmachineIndex}', encodeURIComponent(virtualmachineIndex)); - requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } - 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['NetworkInterfaceIPConfigurationListResult']().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); - }); -} - -/** - * Get the specified network interface ip configuration in a virtual machine - * scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} ipConfigurationName The name of the ip configuration. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 NetworkInterfaceIPConfiguration} 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 _getVirtualMachineScaleSetIpConfiguration(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2017-03-30'; - // 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 (virtualMachineScaleSetName === null || virtualMachineScaleSetName === undefined || typeof virtualMachineScaleSetName.valueOf() !== 'string') { - throw new Error('virtualMachineScaleSetName cannot be null or undefined and it must be of type string.'); - } - if (virtualmachineIndex === null || virtualmachineIndex === undefined || typeof virtualmachineIndex.valueOf() !== 'string') { - throw new Error('virtualmachineIndex cannot be null or undefined and it must be of type string.'); - } - if (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { - throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); - } - if (ipConfigurationName === null || ipConfigurationName === undefined || typeof ipConfigurationName.valueOf() !== 'string') { - throw new Error('ipConfigurationName 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 (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand 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.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualMachineScaleSetName}', encodeURIComponent(virtualMachineScaleSetName)); - requestUrl = requestUrl.replace('{virtualmachineIndex}', encodeURIComponent(virtualmachineIndex)); - requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); - requestUrl = requestUrl.replace('{ipConfigurationName}', encodeURIComponent(ipConfigurationName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } - 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['NetworkInterfaceIPConfiguration']().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); - }); -} - -/** - * Deletes the specified network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, networkInterfaceName, 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-10-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 (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { - throw new Error('networkInterfaceName 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/networkInterfaces/{networkInterfaceName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} parameters Parameters supplied to the create or update - * network interface operation. - * - * @param {object} [parameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * - * @param {array} [parameters.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * - * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * - * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. - * - * @param {string} [parameters.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.networkSecurityGroup.id] Resource ID. - * - * @param {string} [parameters.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. - * - * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of - * the network interface. - * - * @param {array} [parameters.tapConfigurations] A list of TapConfigurations of - * the network interface. - * - * @param {object} [parameters.dnsSettings] The DNS settings in network - * interface. - * - * @param {array} [parameters.dnsSettings.dnsServers] List of DNS servers IP - * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS - * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it - * must be the only value in dnsServers collection. - * - * @param {array} [parameters.dnsSettings.appliedDnsServers] If the VM that - * uses this NIC is part of an Availability Set, then this list will have the - * union of all DNS servers from all NICs that are part of the Availability - * Set. This property is what is configured on each of those VMs. - * - * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS - * name for this NIC used for internal communications between VMs in the same - * virtual network. - * - * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS - * name supporting internal communications between VMs in the same virtual - * network. - * - * @param {string} [parameters.dnsSettings.internalDomainNameSuffix] Even if - * internalDnsNameLabel is not specified, a DNS entry is created for the - * primary NIC of the VM. This DNS name can be constructed by concatenating the - * VM name with the value of internalDomainNameSuffix. - * - * @param {string} [parameters.macAddress] The MAC address of the network - * interface. - * - * @param {boolean} [parameters.primary] Gets whether this is a primary network - * interface on a virtual machine. - * - * @param {boolean} [parameters.enableAcceleratedNetworking] If the network - * interface is accelerated networking enabled. - * - * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP - * forwarding is enabled on this network interface. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network interface resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 NetworkInterface} 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 _beginCreateOrUpdate(resourceGroupName, networkInterfaceName, parameters, 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-10-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 (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { - throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/networkInterfaces/{networkInterfaceName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['NetworkInterface']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['NetworkInterface']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['NetworkInterface']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Updates a network interface tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} parameters Parameters supplied to update network interface - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 NetworkInterface} 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 _beginUpdateTags(resourceGroupName, networkInterfaceName, parameters, 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-10-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 (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { - throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/networkInterfaces/{networkInterfaceName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); - 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 = 'PATCH'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['TagsObject']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // 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['NetworkInterface']().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 route tables applied to a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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 EffectiveRouteListResult} 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 _beginGetEffectiveRouteTable(resourceGroupName, networkInterfaceName, 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-10-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 (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { - throw new Error('networkInterfaceName 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/networkInterfaces/{networkInterfaceName}/effectiveRouteTable'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); - 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 = 'POST'; - 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 && statusCode !== 202) { - 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['EffectiveRouteListResult']().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 network security groups applied to a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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 EffectiveNetworkSecurityGroupListResult} 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 _beginListEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, 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-10-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 (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { - throw new Error('networkInterfaceName 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/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); - 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 = 'POST'; - 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 && statusCode !== 202) { - 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['EffectiveNetworkSecurityGroupListResult']().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 network interfaces in a subscription. - * - * @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 NetworkInterfaceListResult} 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 _listAllNext(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['NetworkInterfaceListResult']().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 network interfaces in a resource group. - * - * @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 NetworkInterfaceListResult} 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['NetworkInterfaceListResult']().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 information about all network interfaces in a virtual machine in a - * virtual machine scale set. - * - * @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 NetworkInterfaceListResult} 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 _listVirtualMachineScaleSetVMNetworkInterfacesNext(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['NetworkInterfaceListResult']().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 network interfaces in a virtual machine scale set. - * - * @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 NetworkInterfaceListResult} 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 _listVirtualMachineScaleSetNetworkInterfacesNext(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['NetworkInterfaceListResult']().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); - }); -} - -/** - * Get the specified network interface ip configuration in a virtual machine - * scale set. - * - * @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 NetworkInterfaceIPConfigurationListResult} - * 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 _listVirtualMachineScaleSetIpConfigurationsNext(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['NetworkInterfaceIPConfigurationListResult']().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 NetworkInterfaces. */ -class NetworkInterfaces { - /** - * Create a NetworkInterfaces. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._updateTags = _updateTags; - this._listAll = _listAll; - this._list = _list; - this._getEffectiveRouteTable = _getEffectiveRouteTable; - this._listEffectiveNetworkSecurityGroups = _listEffectiveNetworkSecurityGroups; - this._listVirtualMachineScaleSetVMNetworkInterfaces = _listVirtualMachineScaleSetVMNetworkInterfaces; - this._listVirtualMachineScaleSetNetworkInterfaces = _listVirtualMachineScaleSetNetworkInterfaces; - this._getVirtualMachineScaleSetNetworkInterface = _getVirtualMachineScaleSetNetworkInterface; - this._listVirtualMachineScaleSetIpConfigurations = _listVirtualMachineScaleSetIpConfigurations; - this._getVirtualMachineScaleSetIpConfiguration = _getVirtualMachineScaleSetIpConfiguration; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdateTags = _beginUpdateTags; - this._beginGetEffectiveRouteTable = _beginGetEffectiveRouteTable; - this._beginListEffectiveNetworkSecurityGroups = _beginListEffectiveNetworkSecurityGroups; - this._listAllNext = _listAllNext; - this._listNext = _listNext; - this._listVirtualMachineScaleSetVMNetworkInterfacesNext = _listVirtualMachineScaleSetVMNetworkInterfacesNext; - this._listVirtualMachineScaleSetNetworkInterfacesNext = _listVirtualMachineScaleSetNetworkInterfacesNext; - this._listVirtualMachineScaleSetIpConfigurationsNext = _listVirtualMachineScaleSetIpConfigurationsNext; - } - - /** - * Deletes the specified network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, networkInterfaceName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, networkInterfaceName, 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._deleteMethod(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, networkInterfaceName, options, optionalCallback); - } - } - - /** - * Gets information about the specified network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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, networkInterfaceName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets information about the specified network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {NetworkInterface} - 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 NetworkInterface} 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, networkInterfaceName, 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, networkInterfaceName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, networkInterfaceName, options, optionalCallback); - } - } - - /** - * Creates or updates a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} parameters Parameters supplied to the create or update - * network interface operation. - * - * @param {object} [parameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * - * @param {array} [parameters.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * - * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * - * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. - * - * @param {string} [parameters.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.networkSecurityGroup.id] Resource ID. - * - * @param {string} [parameters.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. - * - * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of - * the network interface. - * - * @param {array} [parameters.tapConfigurations] A list of TapConfigurations of - * the network interface. - * - * @param {object} [parameters.dnsSettings] The DNS settings in network - * interface. - * - * @param {array} [parameters.dnsSettings.dnsServers] List of DNS servers IP - * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS - * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it - * must be the only value in dnsServers collection. - * - * @param {array} [parameters.dnsSettings.appliedDnsServers] If the VM that - * uses this NIC is part of an Availability Set, then this list will have the - * union of all DNS servers from all NICs that are part of the Availability - * Set. This property is what is configured on each of those VMs. - * - * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS - * name for this NIC used for internal communications between VMs in the same - * virtual network. - * - * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS - * name supporting internal communications between VMs in the same virtual - * network. - * - * @param {string} [parameters.dnsSettings.internalDomainNameSuffix] Even if - * internalDnsNameLabel is not specified, a DNS entry is created for the - * primary NIC of the VM. This DNS name can be constructed by concatenating the - * VM name with the value of internalDomainNameSuffix. - * - * @param {string} [parameters.macAddress] The MAC address of the network - * interface. - * - * @param {boolean} [parameters.primary] Gets whether this is a primary network - * interface on a virtual machine. - * - * @param {boolean} [parameters.enableAcceleratedNetworking] If the network - * interface is accelerated networking enabled. - * - * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP - * forwarding is enabled on this network interface. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network interface resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, networkInterfaceName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, networkInterfaceName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} parameters Parameters supplied to the create or update - * network interface operation. - * - * @param {object} [parameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * - * @param {array} [parameters.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * - * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * - * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. - * - * @param {string} [parameters.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.networkSecurityGroup.id] Resource ID. - * - * @param {string} [parameters.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. - * - * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of - * the network interface. - * - * @param {array} [parameters.tapConfigurations] A list of TapConfigurations of - * the network interface. - * - * @param {object} [parameters.dnsSettings] The DNS settings in network - * interface. - * - * @param {array} [parameters.dnsSettings.dnsServers] List of DNS servers IP - * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS - * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it - * must be the only value in dnsServers collection. - * - * @param {array} [parameters.dnsSettings.appliedDnsServers] If the VM that - * uses this NIC is part of an Availability Set, then this list will have the - * union of all DNS servers from all NICs that are part of the Availability - * Set. This property is what is configured on each of those VMs. - * - * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS - * name for this NIC used for internal communications between VMs in the same - * virtual network. - * - * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS - * name supporting internal communications between VMs in the same virtual - * network. - * - * @param {string} [parameters.dnsSettings.internalDomainNameSuffix] Even if - * internalDnsNameLabel is not specified, a DNS entry is created for the - * primary NIC of the VM. This DNS name can be constructed by concatenating the - * VM name with the value of internalDomainNameSuffix. - * - * @param {string} [parameters.macAddress] The MAC address of the network - * interface. - * - * @param {boolean} [parameters.primary] Gets whether this is a primary network - * interface on a virtual machine. - * - * @param {boolean} [parameters.enableAcceleratedNetworking] If the network - * interface is accelerated networking enabled. - * - * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP - * forwarding is enabled on this network interface. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network interface resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {NetworkInterface} - 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 NetworkInterface} 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. - */ - createOrUpdate(resourceGroupName, networkInterfaceName, parameters, 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._createOrUpdate(resourceGroupName, networkInterfaceName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, networkInterfaceName, parameters, options, optionalCallback); - } - } - - /** - * Updates a network interface tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} parameters Parameters supplied to update network interface - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName, networkInterfaceName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateTags(resourceGroupName, networkInterfaceName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates a network interface tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} parameters Parameters supplied to update network interface - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {NetworkInterface} - 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 NetworkInterface} 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. - */ - updateTags(resourceGroupName, networkInterfaceName, parameters, 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._updateTags(resourceGroupName, networkInterfaceName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateTags(resourceGroupName, networkInterfaceName, parameters, options, optionalCallback); - } - } - - /** - * Gets all network interfaces in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAll(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 network interfaces in a subscription. - * - * @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 {NetworkInterfaceListResult} - 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 NetworkInterfaceListResult} 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. - */ - listAll(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._listAll(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAll(options, optionalCallback); - } - } - - /** - * Gets all network interfaces in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, 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 network interfaces in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {NetworkInterfaceListResult} - 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 NetworkInterfaceListResult} 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, 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, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, options, optionalCallback); - } - } - - /** - * Gets all route tables applied to a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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. - */ - getEffectiveRouteTableWithHttpOperationResponse(resourceGroupName, networkInterfaceName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getEffectiveRouteTable(resourceGroupName, networkInterfaceName, 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 route tables applied to a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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 {EffectiveRouteListResult} - 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 EffectiveRouteListResult} 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. - */ - getEffectiveRouteTable(resourceGroupName, networkInterfaceName, 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._getEffectiveRouteTable(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getEffectiveRouteTable(resourceGroupName, networkInterfaceName, options, optionalCallback); - } - } - - /** - * Gets all network security groups applied to a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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. - */ - listEffectiveNetworkSecurityGroupsWithHttpOperationResponse(resourceGroupName, networkInterfaceName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, 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 network security groups applied to a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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 {EffectiveNetworkSecurityGroupListResult} - 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 EffectiveNetworkSecurityGroupListResult} 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. - */ - listEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, 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._listEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, options, optionalCallback); - } - } - - /** - * Gets information about all network interfaces in a virtual machine in a - * virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @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. - */ - listVirtualMachineScaleSetVMNetworkInterfacesWithHttpOperationResponse(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets information about all network interfaces in a virtual machine in a - * virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @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 {NetworkInterfaceListResult} - 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 NetworkInterfaceListResult} 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. - */ - listVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, 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._listVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, options, optionalCallback); - } - } - - /** - * Gets all network interfaces in a virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @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. - */ - listVirtualMachineScaleSetNetworkInterfacesWithHttpOperationResponse(resourceGroupName, virtualMachineScaleSetName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, 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 network interfaces in a virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @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 {NetworkInterfaceListResult} - 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 NetworkInterfaceListResult} 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. - */ - listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, 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._listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, options, optionalCallback); - } - } - - /** - * Get the specified network interface in a virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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. - */ - getVirtualMachineScaleSetNetworkInterfaceWithHttpOperationResponse(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getVirtualMachineScaleSetNetworkInterface(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Get the specified network interface in a virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {NetworkInterface} - 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 NetworkInterface} 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. - */ - getVirtualMachineScaleSetNetworkInterface(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, 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._getVirtualMachineScaleSetNetworkInterface(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getVirtualMachineScaleSetNetworkInterface(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, options, optionalCallback); - } - } - - /** - * Get the specified network interface ip configuration in a virtual machine - * scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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. - */ - listVirtualMachineScaleSetIpConfigurationsWithHttpOperationResponse(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listVirtualMachineScaleSetIpConfigurations(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Get the specified network interface ip configuration in a virtual machine - * scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {NetworkInterfaceIPConfigurationListResult} - 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 NetworkInterfaceIPConfigurationListResult} - * 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. - */ - listVirtualMachineScaleSetIpConfigurations(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, 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._listVirtualMachineScaleSetIpConfigurations(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listVirtualMachineScaleSetIpConfigurations(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, options, optionalCallback); - } - } - - /** - * Get the specified network interface ip configuration in a virtual machine - * scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} ipConfigurationName The name of the ip configuration. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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. - */ - getVirtualMachineScaleSetIpConfigurationWithHttpOperationResponse(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getVirtualMachineScaleSetIpConfiguration(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Get the specified network interface ip configuration in a virtual machine - * scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} ipConfigurationName The name of the ip configuration. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {NetworkInterfaceIPConfiguration} - 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 NetworkInterfaceIPConfiguration} 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. - */ - getVirtualMachineScaleSetIpConfiguration(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, 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._getVirtualMachineScaleSetIpConfiguration(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getVirtualMachineScaleSetIpConfiguration(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, options, optionalCallback); - } - } - - /** - * Deletes the specified network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, networkInterfaceName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, networkInterfaceName, 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._beginDeleteMethod(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, networkInterfaceName, options, optionalCallback); - } - } - - /** - * Creates or updates a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} parameters Parameters supplied to the create or update - * network interface operation. - * - * @param {object} [parameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * - * @param {array} [parameters.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * - * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * - * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. - * - * @param {string} [parameters.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.networkSecurityGroup.id] Resource ID. - * - * @param {string} [parameters.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. - * - * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of - * the network interface. - * - * @param {array} [parameters.tapConfigurations] A list of TapConfigurations of - * the network interface. - * - * @param {object} [parameters.dnsSettings] The DNS settings in network - * interface. - * - * @param {array} [parameters.dnsSettings.dnsServers] List of DNS servers IP - * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS - * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it - * must be the only value in dnsServers collection. - * - * @param {array} [parameters.dnsSettings.appliedDnsServers] If the VM that - * uses this NIC is part of an Availability Set, then this list will have the - * union of all DNS servers from all NICs that are part of the Availability - * Set. This property is what is configured on each of those VMs. - * - * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS - * name for this NIC used for internal communications between VMs in the same - * virtual network. - * - * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS - * name supporting internal communications between VMs in the same virtual - * network. - * - * @param {string} [parameters.dnsSettings.internalDomainNameSuffix] Even if - * internalDnsNameLabel is not specified, a DNS entry is created for the - * primary NIC of the VM. This DNS name can be constructed by concatenating the - * VM name with the value of internalDomainNameSuffix. - * - * @param {string} [parameters.macAddress] The MAC address of the network - * interface. - * - * @param {boolean} [parameters.primary] Gets whether this is a primary network - * interface on a virtual machine. - * - * @param {boolean} [parameters.enableAcceleratedNetworking] If the network - * interface is accelerated networking enabled. - * - * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP - * forwarding is enabled on this network interface. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network interface resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, networkInterfaceName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, networkInterfaceName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} parameters Parameters supplied to the create or update - * network interface operation. - * - * @param {object} [parameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * - * @param {array} [parameters.networkSecurityGroup.securityRules] A collection - * of security rules of the network security group. - * - * @param {array} [parameters.networkSecurityGroup.defaultSecurityRules] The - * default security rules of network security group. - * - * @param {string} [parameters.networkSecurityGroup.resourceGuid] The resource - * GUID property of the network security group resource. - * - * @param {string} [parameters.networkSecurityGroup.provisioningState] The - * provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.networkSecurityGroup.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.networkSecurityGroup.id] Resource ID. - * - * @param {string} [parameters.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [parameters.networkSecurityGroup.tags] Resource tags. - * - * @param {array} [parameters.ipConfigurations] A list of IPConfigurations of - * the network interface. - * - * @param {array} [parameters.tapConfigurations] A list of TapConfigurations of - * the network interface. - * - * @param {object} [parameters.dnsSettings] The DNS settings in network - * interface. - * - * @param {array} [parameters.dnsSettings.dnsServers] List of DNS servers IP - * addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS - * resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it - * must be the only value in dnsServers collection. - * - * @param {array} [parameters.dnsSettings.appliedDnsServers] If the VM that - * uses this NIC is part of an Availability Set, then this list will have the - * union of all DNS servers from all NICs that are part of the Availability - * Set. This property is what is configured on each of those VMs. - * - * @param {string} [parameters.dnsSettings.internalDnsNameLabel] Relative DNS - * name for this NIC used for internal communications between VMs in the same - * virtual network. - * - * @param {string} [parameters.dnsSettings.internalFqdn] Fully qualified DNS - * name supporting internal communications between VMs in the same virtual - * network. - * - * @param {string} [parameters.dnsSettings.internalDomainNameSuffix] Even if - * internalDnsNameLabel is not specified, a DNS entry is created for the - * primary NIC of the VM. This DNS name can be constructed by concatenating the - * VM name with the value of internalDomainNameSuffix. - * - * @param {string} [parameters.macAddress] The MAC address of the network - * interface. - * - * @param {boolean} [parameters.primary] Gets whether this is a primary network - * interface on a virtual machine. - * - * @param {boolean} [parameters.enableAcceleratedNetworking] If the network - * interface is accelerated networking enabled. - * - * @param {boolean} [parameters.enableIPForwarding] Indicates whether IP - * forwarding is enabled on this network interface. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network interface resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {NetworkInterface} - 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 NetworkInterface} 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. - */ - beginCreateOrUpdate(resourceGroupName, networkInterfaceName, parameters, 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._beginCreateOrUpdate(resourceGroupName, networkInterfaceName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, networkInterfaceName, parameters, options, optionalCallback); - } - } - - /** - * Updates a network interface tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} parameters Parameters supplied to update network interface - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName, networkInterfaceName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginUpdateTags(resourceGroupName, networkInterfaceName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates a network interface tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {object} parameters Parameters supplied to update network interface - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {NetworkInterface} - 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 NetworkInterface} 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. - */ - beginUpdateTags(resourceGroupName, networkInterfaceName, parameters, 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._beginUpdateTags(resourceGroupName, networkInterfaceName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginUpdateTags(resourceGroupName, networkInterfaceName, parameters, options, optionalCallback); - } - } - - /** - * Gets all route tables applied to a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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. - */ - beginGetEffectiveRouteTableWithHttpOperationResponse(resourceGroupName, networkInterfaceName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginGetEffectiveRouteTable(resourceGroupName, networkInterfaceName, 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 route tables applied to a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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 {EffectiveRouteListResult} - 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 EffectiveRouteListResult} 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. - */ - beginGetEffectiveRouteTable(resourceGroupName, networkInterfaceName, 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._beginGetEffectiveRouteTable(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginGetEffectiveRouteTable(resourceGroupName, networkInterfaceName, options, optionalCallback); - } - } - - /** - * Gets all network security groups applied to a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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. - */ - beginListEffectiveNetworkSecurityGroupsWithHttpOperationResponse(resourceGroupName, networkInterfaceName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginListEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, 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 network security groups applied to a network interface. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @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 {EffectiveNetworkSecurityGroupListResult} - 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 EffectiveNetworkSecurityGroupListResult} 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. - */ - beginListEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, 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._beginListEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginListEffectiveNetworkSecurityGroups(resourceGroupName, networkInterfaceName, options, optionalCallback); - } - } - - /** - * Gets all network interfaces in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAllNext(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 network interfaces in a subscription. - * - * @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 {NetworkInterfaceListResult} - 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 NetworkInterfaceListResult} 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. - */ - listAllNext(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._listAllNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAllNext(nextPageLink, options, optionalCallback); - } - } - - /** - * Gets all network interfaces in a resource group. - * - * @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 network interfaces in a resource group. - * - * @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 {NetworkInterfaceListResult} - 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 NetworkInterfaceListResult} 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); - } - } - - /** - * Gets information about all network interfaces in a virtual machine in a - * virtual machine scale set. - * - * @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. - */ - listVirtualMachineScaleSetVMNetworkInterfacesNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listVirtualMachineScaleSetVMNetworkInterfacesNext(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 information about all network interfaces in a virtual machine in a - * virtual machine scale set. - * - * @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 {NetworkInterfaceListResult} - 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 NetworkInterfaceListResult} 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. - */ - listVirtualMachineScaleSetVMNetworkInterfacesNext(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._listVirtualMachineScaleSetVMNetworkInterfacesNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listVirtualMachineScaleSetVMNetworkInterfacesNext(nextPageLink, options, optionalCallback); - } - } - - /** - * Gets all network interfaces in a virtual machine scale set. - * - * @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. - */ - listVirtualMachineScaleSetNetworkInterfacesNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listVirtualMachineScaleSetNetworkInterfacesNext(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 network interfaces in a virtual machine scale set. - * - * @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 {NetworkInterfaceListResult} - 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 NetworkInterfaceListResult} 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. - */ - listVirtualMachineScaleSetNetworkInterfacesNext(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._listVirtualMachineScaleSetNetworkInterfacesNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listVirtualMachineScaleSetNetworkInterfacesNext(nextPageLink, options, optionalCallback); - } - } - - /** - * Get the specified network interface ip configuration in a virtual machine - * scale set. - * - * @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. - */ - listVirtualMachineScaleSetIpConfigurationsNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listVirtualMachineScaleSetIpConfigurationsNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Get the specified network interface ip configuration in a virtual machine - * scale set. - * - * @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 {NetworkInterfaceIPConfigurationListResult} - 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 NetworkInterfaceIPConfigurationListResult} - * 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. - */ - listVirtualMachineScaleSetIpConfigurationsNext(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._listVirtualMachineScaleSetIpConfigurationsNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listVirtualMachineScaleSetIpConfigurationsNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = NetworkInterfaces; diff --git a/lib/services/networkManagement2/lib/operations/networkProfiles.js b/lib/services/networkManagement2/lib/operations/networkProfiles.js deleted file mode 100644 index 59c60dcfd..000000000 --- a/lib/services/networkManagement2/lib/operations/networkProfiles.js +++ /dev/null @@ -1,1925 +0,0 @@ -/* - * 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; - -/** - * Deletes the specified network profile. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkProfileName The name of the NetworkProfile. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, networkProfileName, 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-10-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 (networkProfileName === null || networkProfileName === undefined || typeof networkProfileName.valueOf() !== 'string') { - throw new Error('networkProfileName 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/networkProfiles/{networkProfileName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkProfileName}', encodeURIComponent(networkProfileName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Gets the specified network profile in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkProfileName The name of the PublicIPPrefx. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 NetworkProfile} 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, networkProfileName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2018-10-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 (networkProfileName === null || networkProfileName === undefined || typeof networkProfileName.valueOf() !== 'string') { - throw new Error('networkProfileName 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 (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand 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/networkProfiles/{networkProfileName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkProfileName}', encodeURIComponent(networkProfileName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } - 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['NetworkProfile']().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); - }); -} - -/** - * Creates or updates a network profile. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkProfileName The name of the network profile. - * - * @param {object} parameters Parameters supplied to the create or update - * network profile operation. - * - * @param {array} [parameters.containerNetworkInterfaces] List of child - * container network interfaces. - * - * @param {array} [parameters.containerNetworkInterfaceConfigurations] List of - * chid container network interface configurations. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 NetworkProfile} 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 _createOrUpdate(resourceGroupName, networkProfileName, parameters, 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-10-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 (networkProfileName === null || networkProfileName === undefined || typeof networkProfileName.valueOf() !== 'string') { - throw new Error('networkProfileName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/networkProfiles/{networkProfileName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkProfileName}', encodeURIComponent(networkProfileName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['NetworkProfile']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['NetworkProfile']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['NetworkProfile']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Updates network profile tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkProfileName The name of the network profile. - * - * @param {object} parameters Parameters supplied to update network profile - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 NetworkProfile} 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 _updateTags(resourceGroupName, networkProfileName, parameters, 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-10-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 (networkProfileName === null || networkProfileName === undefined || typeof networkProfileName.valueOf() !== 'string') { - throw new Error('networkProfileName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/networkProfiles/{networkProfileName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkProfileName}', encodeURIComponent(networkProfileName)); - 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 = 'PATCH'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['TagsObject']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // 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['NetworkProfile']().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 the network profiles in a subscription. - * - * @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 NetworkProfileListResult} 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 _listAll(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/networkProfiles'; - 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['NetworkProfileListResult']().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 network profiles in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 NetworkProfileListResult} 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, 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-10-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 (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/networkProfiles'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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['NetworkProfileListResult']().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 the network profiles in a subscription. - * - * @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 NetworkProfileListResult} 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 _listAllNext(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['NetworkProfileListResult']().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 network profiles in a resource group. - * - * @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 NetworkProfileListResult} 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['NetworkProfileListResult']().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 NetworkProfiles. */ -class NetworkProfiles { - /** - * Create a NetworkProfiles. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._updateTags = _updateTags; - this._listAll = _listAll; - this._list = _list; - this._listAllNext = _listAllNext; - this._listNext = _listNext; - } - - /** - * Deletes the specified network profile. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkProfileName The name of the NetworkProfile. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, networkProfileName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, networkProfileName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified network profile. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkProfileName The name of the NetworkProfile. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, networkProfileName, 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._deleteMethod(resourceGroupName, networkProfileName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, networkProfileName, options, optionalCallback); - } - } - - /** - * Gets the specified network profile in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkProfileName The name of the PublicIPPrefx. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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, networkProfileName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, networkProfileName, 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 network profile in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkProfileName The name of the PublicIPPrefx. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {NetworkProfile} - 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 NetworkProfile} 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, networkProfileName, 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, networkProfileName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, networkProfileName, options, optionalCallback); - } - } - - /** - * Creates or updates a network profile. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkProfileName The name of the network profile. - * - * @param {object} parameters Parameters supplied to the create or update - * network profile operation. - * - * @param {array} [parameters.containerNetworkInterfaces] List of child - * container network interfaces. - * - * @param {array} [parameters.containerNetworkInterfaceConfigurations] List of - * chid container network interface configurations. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, networkProfileName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, networkProfileName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a network profile. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkProfileName The name of the network profile. - * - * @param {object} parameters Parameters supplied to the create or update - * network profile operation. - * - * @param {array} [parameters.containerNetworkInterfaces] List of child - * container network interfaces. - * - * @param {array} [parameters.containerNetworkInterfaceConfigurations] List of - * chid container network interface configurations. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {NetworkProfile} - 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 NetworkProfile} 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. - */ - createOrUpdate(resourceGroupName, networkProfileName, parameters, 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._createOrUpdate(resourceGroupName, networkProfileName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, networkProfileName, parameters, options, optionalCallback); - } - } - - /** - * Updates network profile tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkProfileName The name of the network profile. - * - * @param {object} parameters Parameters supplied to update network profile - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName, networkProfileName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateTags(resourceGroupName, networkProfileName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates network profile tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkProfileName The name of the network profile. - * - * @param {object} parameters Parameters supplied to update network profile - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {NetworkProfile} - 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 NetworkProfile} 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. - */ - updateTags(resourceGroupName, networkProfileName, parameters, 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._updateTags(resourceGroupName, networkProfileName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateTags(resourceGroupName, networkProfileName, parameters, options, optionalCallback); - } - } - - /** - * Gets all the network profiles in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAll(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 the network profiles in a subscription. - * - * @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 {NetworkProfileListResult} - 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 NetworkProfileListResult} 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. - */ - listAll(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._listAll(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAll(options, optionalCallback); - } - } - - /** - * Gets all network profiles in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, 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 network profiles in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {NetworkProfileListResult} - 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 NetworkProfileListResult} 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, 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, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, options, optionalCallback); - } - } - - /** - * Gets all the network profiles in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAllNext(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 the network profiles in a subscription. - * - * @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 {NetworkProfileListResult} - 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 NetworkProfileListResult} 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. - */ - listAllNext(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._listAllNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAllNext(nextPageLink, options, optionalCallback); - } - } - - /** - * Gets all network profiles in a resource group. - * - * @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 network profiles in a resource group. - * - * @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 {NetworkProfileListResult} - 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 NetworkProfileListResult} 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 = NetworkProfiles; diff --git a/lib/services/networkManagement2/lib/operations/networkSecurityGroups.js b/lib/services/networkManagement2/lib/operations/networkSecurityGroups.js deleted file mode 100644 index a864f1bc1..000000000 --- a/lib/services/networkManagement2/lib/operations/networkSecurityGroups.js +++ /dev/null @@ -1,2536 +0,0 @@ -/* - * 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; - - -/** - * Deletes the specified network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, networkSecurityGroupName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, networkSecurityGroupName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets the specified network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 NetworkSecurityGroup} 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, networkSecurityGroupName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2018-10-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 (networkSecurityGroupName === null || networkSecurityGroupName === undefined || typeof networkSecurityGroupName.valueOf() !== 'string') { - throw new Error('networkSecurityGroupName 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 (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand 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/networkSecurityGroups/{networkSecurityGroupName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkSecurityGroupName}', encodeURIComponent(networkSecurityGroupName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } - 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['NetworkSecurityGroup']().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); - }); -} - - -/** - * Creates or updates a network security group in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to the create or update - * network security group operation. - * - * @param {array} [parameters.securityRules] A collection of security rules of - * the network security group. - * - * @param {array} [parameters.defaultSecurityRules] The default security rules - * of network security group. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network security group resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 NetworkSecurityGroup} 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 _createOrUpdate(resourceGroupName, networkSecurityGroupName, parameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['NetworkSecurityGroup']().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); - }); - }); -} - - -/** - * Updates a network security group tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to update network security - * group tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 NetworkSecurityGroup} 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 _updateTags(resourceGroupName, networkSecurityGroupName, parameters, 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.'); - } - - // Send request - this.beginUpdateTags(resourceGroupName, networkSecurityGroupName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['NetworkSecurityGroup']().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 network security groups in a subscription. - * - * @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 NetworkSecurityGroupListResult} 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 _listAll(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/networkSecurityGroups'; - 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['NetworkSecurityGroupListResult']().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 network security groups in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 NetworkSecurityGroupListResult} 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, 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-10-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 (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/networkSecurityGroups'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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['NetworkSecurityGroupListResult']().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); - }); -} - -/** - * Deletes the specified network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, networkSecurityGroupName, 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-10-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 (networkSecurityGroupName === null || networkSecurityGroupName === undefined || typeof networkSecurityGroupName.valueOf() !== 'string') { - throw new Error('networkSecurityGroupName 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/networkSecurityGroups/{networkSecurityGroupName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkSecurityGroupName}', encodeURIComponent(networkSecurityGroupName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates a network security group in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to the create or update - * network security group operation. - * - * @param {array} [parameters.securityRules] A collection of security rules of - * the network security group. - * - * @param {array} [parameters.defaultSecurityRules] The default security rules - * of network security group. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network security group resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 NetworkSecurityGroup} 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 _beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, parameters, 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-10-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 (networkSecurityGroupName === null || networkSecurityGroupName === undefined || typeof networkSecurityGroupName.valueOf() !== 'string') { - throw new Error('networkSecurityGroupName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/networkSecurityGroups/{networkSecurityGroupName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkSecurityGroupName}', encodeURIComponent(networkSecurityGroupName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['NetworkSecurityGroup']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['NetworkSecurityGroup']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['NetworkSecurityGroup']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Updates a network security group tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to update network security - * group tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 NetworkSecurityGroup} 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 _beginUpdateTags(resourceGroupName, networkSecurityGroupName, parameters, 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-10-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 (networkSecurityGroupName === null || networkSecurityGroupName === undefined || typeof networkSecurityGroupName.valueOf() !== 'string') { - throw new Error('networkSecurityGroupName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/networkSecurityGroups/{networkSecurityGroupName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkSecurityGroupName}', encodeURIComponent(networkSecurityGroupName)); - 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 = 'PATCH'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['TagsObject']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // 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['NetworkSecurityGroup']().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 network security groups in a subscription. - * - * @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 NetworkSecurityGroupListResult} 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 _listAllNext(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['NetworkSecurityGroupListResult']().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 network security groups in a resource group. - * - * @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 NetworkSecurityGroupListResult} 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['NetworkSecurityGroupListResult']().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 NetworkSecurityGroups. */ -class NetworkSecurityGroups { - /** - * Create a NetworkSecurityGroups. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._updateTags = _updateTags; - this._listAll = _listAll; - this._list = _list; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdateTags = _beginUpdateTags; - this._listAllNext = _listAllNext; - this._listNext = _listNext; - } - - /** - * Deletes the specified network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, networkSecurityGroupName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, networkSecurityGroupName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, networkSecurityGroupName, 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._deleteMethod(resourceGroupName, networkSecurityGroupName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, networkSecurityGroupName, options, optionalCallback); - } - } - - /** - * Gets the specified network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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, networkSecurityGroupName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, networkSecurityGroupName, 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 network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {NetworkSecurityGroup} - 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 NetworkSecurityGroup} 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, networkSecurityGroupName, 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, networkSecurityGroupName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, networkSecurityGroupName, options, optionalCallback); - } - } - - /** - * Creates or updates a network security group in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to the create or update - * network security group operation. - * - * @param {array} [parameters.securityRules] A collection of security rules of - * the network security group. - * - * @param {array} [parameters.defaultSecurityRules] The default security rules - * of network security group. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network security group resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, networkSecurityGroupName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, networkSecurityGroupName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a network security group in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to the create or update - * network security group operation. - * - * @param {array} [parameters.securityRules] A collection of security rules of - * the network security group. - * - * @param {array} [parameters.defaultSecurityRules] The default security rules - * of network security group. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network security group resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {NetworkSecurityGroup} - 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 NetworkSecurityGroup} 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. - */ - createOrUpdate(resourceGroupName, networkSecurityGroupName, parameters, 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._createOrUpdate(resourceGroupName, networkSecurityGroupName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, networkSecurityGroupName, parameters, options, optionalCallback); - } - } - - /** - * Updates a network security group tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to update network security - * group tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName, networkSecurityGroupName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateTags(resourceGroupName, networkSecurityGroupName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates a network security group tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to update network security - * group tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {NetworkSecurityGroup} - 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 NetworkSecurityGroup} 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. - */ - updateTags(resourceGroupName, networkSecurityGroupName, parameters, 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._updateTags(resourceGroupName, networkSecurityGroupName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateTags(resourceGroupName, networkSecurityGroupName, parameters, options, optionalCallback); - } - } - - /** - * Gets all network security groups in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAll(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 network security groups in a subscription. - * - * @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 {NetworkSecurityGroupListResult} - 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 NetworkSecurityGroupListResult} 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. - */ - listAll(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._listAll(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAll(options, optionalCallback); - } - } - - /** - * Gets all network security groups in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, 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 network security groups in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {NetworkSecurityGroupListResult} - 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 NetworkSecurityGroupListResult} 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, 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, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, options, optionalCallback); - } - } - - /** - * Deletes the specified network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, networkSecurityGroupName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, networkSecurityGroupName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, networkSecurityGroupName, 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._beginDeleteMethod(resourceGroupName, networkSecurityGroupName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, networkSecurityGroupName, options, optionalCallback); - } - } - - /** - * Creates or updates a network security group in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to the create or update - * network security group operation. - * - * @param {array} [parameters.securityRules] A collection of security rules of - * the network security group. - * - * @param {array} [parameters.defaultSecurityRules] The default security rules - * of network security group. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network security group resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, networkSecurityGroupName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a network security group in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to the create or update - * network security group operation. - * - * @param {array} [parameters.securityRules] A collection of security rules of - * the network security group. - * - * @param {array} [parameters.defaultSecurityRules] The default security rules - * of network security group. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * network security group resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * public IP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {NetworkSecurityGroup} - 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 NetworkSecurityGroup} 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. - */ - beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, parameters, 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._beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, parameters, options, optionalCallback); - } - } - - /** - * Updates a network security group tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to update network security - * group tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName, networkSecurityGroupName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginUpdateTags(resourceGroupName, networkSecurityGroupName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates a network security group tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {object} parameters Parameters supplied to update network security - * group tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {NetworkSecurityGroup} - 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 NetworkSecurityGroup} 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. - */ - beginUpdateTags(resourceGroupName, networkSecurityGroupName, parameters, 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._beginUpdateTags(resourceGroupName, networkSecurityGroupName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginUpdateTags(resourceGroupName, networkSecurityGroupName, parameters, options, optionalCallback); - } - } - - /** - * Gets all network security groups in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAllNext(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 network security groups in a subscription. - * - * @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 {NetworkSecurityGroupListResult} - 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 NetworkSecurityGroupListResult} 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. - */ - listAllNext(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._listAllNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAllNext(nextPageLink, options, optionalCallback); - } - } - - /** - * Gets all network security groups in a resource group. - * - * @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 network security groups in a resource group. - * - * @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 {NetworkSecurityGroupListResult} - 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 NetworkSecurityGroupListResult} 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 = NetworkSecurityGroups; diff --git a/lib/services/networkManagement2/lib/operations/networkWatchers.js b/lib/services/networkManagement2/lib/operations/networkWatchers.js deleted file mode 100644 index 56466a02a..000000000 --- a/lib/services/networkManagement2/lib/operations/networkWatchers.js +++ /dev/null @@ -1,8021 +0,0 @@ -/* - * 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; - -/** - * Creates or updates a network watcher in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the network watcher - * resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 NetworkWatcher} 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 _createOrUpdate(resourceGroupName, networkWatcherName, parameters, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/networkWatchers/{networkWatcherName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['NetworkWatcher']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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['NetworkWatcher']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['NetworkWatcher']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Gets the specified network watcher by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @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 NetworkWatcher} 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, networkWatcherName, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName 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/networkWatchers/{networkWatcherName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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['NetworkWatcher']().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); - }); -} - - -/** - * Deletes the specified network watcher resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, networkWatcherName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, networkWatcherName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Updates a network watcher tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters supplied to update network watcher - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 NetworkWatcher} 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 _updateTags(resourceGroupName, networkWatcherName, parameters, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/networkWatchers/{networkWatcherName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - 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 = 'PATCH'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['TagsObject']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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['NetworkWatcher']().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 network watchers by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 NetworkWatcherListResult} 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, 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-10-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 (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/networkWatchers'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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['NetworkWatcherListResult']().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 network watchers by subscription. - * - * @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 NetworkWatcherListResult} 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 _listAll(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/networkWatchers'; - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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['NetworkWatcherListResult']().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 the current network topology by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the representation of - * topology. - * - * @param {string} [parameters.targetResourceGroupName] The name of the target - * resource group to perform topology on. - * - * @param {object} [parameters.targetVirtualNetwork] The reference of the - * Virtual Network resource. - * - * @param {object} [parameters.targetSubnet] The reference of the Subnet - * resource. - * - * @param {string} [parameters.targetSubnet.id] Resource ID. - * - * @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 Topology} 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 _getTopology(resourceGroupName, networkWatcherName, parameters, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/networkWatchers/{networkWatcherName}/topology'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - 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 = 'POST'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['TopologyParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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['Topology']().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); - }); -} - - -/** - * Verify IP flow from the specified VM to a location given the currently - * configured NSG rules. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the IP flow to be - * verified. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform next-hop on. - * - * @param {string} parameters.direction The direction of the packet represented - * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' - * - * @param {string} parameters.protocol Protocol to be verified on. Possible - * values include: 'TCP', 'UDP' - * - * @param {string} parameters.localPort The local port. Acceptable values are a - * single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.remotePort The remote port. Acceptable values are - * a single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.localIPAddress The local IP address. Acceptable - * values are valid IPv4 addresses. - * - * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable - * values are valid IPv4 addresses. - * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of them, then this - * parameter must be specified. Otherwise optional). - * - * @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 VerificationIPFlowResult} 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 _verifyIPFlow(resourceGroupName, networkWatcherName, parameters, 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.'); - } - - // Send request - this.beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VerificationIPFlowResult']().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 the next hop from the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the source and destination - * endpoint. - * - * @param {string} parameters.targetResourceId The resource identifier of the - * target resource against which the action is to be performed. - * - * @param {string} parameters.sourceIPAddress The source IP address. - * - * @param {string} parameters.destinationIPAddress The destination IP address. - * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of the nics, then this - * parameter must be specified. Otherwise optional). - * - * @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 NextHopResult} 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 _getNextHop(resourceGroupName, networkWatcherName, parameters, 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.'); - } - - // Send request - this.beginGetNextHop(resourceGroupName, networkWatcherName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['NextHopResult']().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 the configured and effective security group rules on the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the VM to check security - * groups for. - * - * @param {string} parameters.targetResourceId ID of the target VM. - * - * @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 SecurityGroupViewResult} 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 _getVMSecurityRules(resourceGroupName, networkWatcherName, parameters, 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.'); - } - - // Send request - this.beginGetVMSecurityRules(resourceGroupName, networkWatcherName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SecurityGroupViewResult']().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); - }); - }); -} - - -/** - * Initiate troubleshooting on a specified resource - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the resource to - * troubleshoot. - * - * @param {string} parameters.targetResourceId The target resource to - * troubleshoot. - * - * @param {string} parameters.storageId The ID for the storage account to save - * the troubleshoot result. - * - * @param {string} parameters.storagePath The path to the blob to save the - * troubleshoot result in. - * - * @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 TroubleshootingResult} 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 _getTroubleshooting(resourceGroupName, networkWatcherName, parameters, 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.'); - } - - // Send request - this.beginGetTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TroubleshootingResult']().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); - }); - }); -} - - -/** - * Get the last completed troubleshooting result on a specified resource - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the resource to query the - * troubleshooting result. - * - * @param {string} parameters.targetResourceId The target resource ID to query - * the troubleshooting result. - * - * @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 TroubleshootingResult} 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 _getTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, 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.'); - } - - // Send request - this.beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TroubleshootingResult']().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); - }); - }); -} - - -/** - * Configures flow log and traffic analytics (optional) on a specified - * resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the configuration of flow - * log. - * - * @param {string} parameters.targetResourceId The ID of the resource to - * configure for flow log and traffic analytics (optional) . - * - * @param {string} parameters.storageId ID of the storage account which is used - * to store the flow log. - * - * @param {boolean} parameters.enabled Flag to enable/disable flow logging. - * - * @param {object} [parameters.retentionPolicy] - * - * @param {number} [parameters.retentionPolicy.days] Number of days to retain - * flow log records. - * - * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable - * retention. - * - * @param {object} [parameters.format] - * - * @param {string} [parameters.format.type] The file type of flow log. Possible - * values include: 'JSON' - * - * @param {number} [parameters.format.version] The version (revision) of the - * flow log. - * - * @param {object} [parameters.flowAnalyticsConfiguration] - * - * @param {object} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration - * - * @param {boolean} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled - * Flag to enable/disable traffic analytics. - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId - * The resource guid of the attached workspace - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion - * The location of the attached workspace - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId - * Resource Id of the attached workspace - * - * @param {number} - * [parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.trafficAnalyticsInterval] - * The interval in minutes which would decide how frequently TA service should - * do flow analytics - * - * @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 FlowLogInformation} 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 _setFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, 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.'); - } - - // Send request - this.beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FlowLogInformation']().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); - }); - }); -} - - -/** - * Queries status of flow log and traffic analytics (optional) on a specified - * resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define a resource to query flow - * log and traffic analytics (optional) status. - * - * @param {string} parameters.targetResourceId The target resource where - * getting the flow log and traffic analytics (optional) status. - * - * @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 FlowLogInformation} 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 _getFlowLogStatus(resourceGroupName, networkWatcherName, parameters, 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.'); - } - - // Send request - this.beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FlowLogInformation']().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); - }); - }); -} - - -/** - * Verifies the possibility of establishing a direct TCP connection from a - * virtual machine to a given endpoint including another VM or an arbitrary - * remote server. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine how the connectivity - * check will be performed. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource from - * which a connectivity check will be initiated. - * - * @param {number} [parameters.source.port] The source port from which a - * connectivity check will be performed. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * to which a connection attempt will be made. - * - * @param {string} [parameters.destination.address] The IP address or URI the - * resource to which a connection attempt will be made. - * - * @param {number} [parameters.destination.port] Port on which check - * connectivity will be performed. - * - * @param {string} [parameters.protocol] Network protocol. Possible values - * include: 'Tcp', 'Http', 'Https', 'Icmp' - * - * @param {object} [parameters.protocolConfiguration] - * - * @param {object} [parameters.protocolConfiguration.hTTPConfiguration] - * - * @param {string} [parameters.protocolConfiguration.hTTPConfiguration.method] - * HTTP method. Possible values include: 'Get' - * - * @param {array} [parameters.protocolConfiguration.hTTPConfiguration.headers] - * List of HTTP headers. - * - * @param {array} - * [parameters.protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid - * status codes. - * - * @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 ConnectivityInformation} 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 _checkConnectivity(resourceGroupName, networkWatcherName, parameters, 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.'); - } - - // Send request - this.beginCheckConnectivity(resourceGroupName, networkWatcherName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ConnectivityInformation']().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 the relative latency score for internet service providers from a - * specified location to Azure regions. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine Azure reachability - * report configuration. - * - * @param {object} parameters.providerLocation - * - * @param {string} parameters.providerLocation.country The name of the country. - * - * @param {string} [parameters.providerLocation.state] The name of the state. - * - * @param {string} [parameters.providerLocation.city] The name of the city or - * town. - * - * @param {array} [parameters.providers] List of Internet service providers. - * - * @param {array} [parameters.azureLocations] Optional Azure regions to scope - * the query to. - * - * @param {date} parameters.startTime The start time for the Azure reachability - * report. - * - * @param {date} parameters.endTime The end time for the Azure reachability - * report. - * - * @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 AzureReachabilityReport} 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 _getAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, 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.'); - } - - // Send request - this.beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['AzureReachabilityReport']().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); - }); - }); -} - - -/** - * Lists all available internet service providers for a specified Azure region. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that scope the list of available - * providers. - * - * @param {array} [parameters.azureLocations] A list of Azure regions. - * - * @param {string} [parameters.country] The country for available providers - * list. - * - * @param {string} [parameters.state] The state for available providers list. - * - * @param {string} [parameters.city] The city or town for available providers - * list. - * - * @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 AvailableProvidersList} 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 _listAvailableProviders(resourceGroupName, networkWatcherName, parameters, 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.'); - } - - // Send request - this.beginListAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['AvailableProvidersList']().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); - }); - }); -} - - -/** - * Get network configuration diagnostic. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters to get network configuration - * diagnostic. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform network configuration diagnostic. Valid options are VM, - * NetworkInterface, VMSS/NetworkInterface and Application Gateway. - * - * @param {string} [parameters.verbosityLevel] Verbosity level. Accepted values - * are 'Normal', 'Minimum', 'Full'. Possible values include: 'Normal', - * 'Minimum', 'Full' - * - * @param {array} parameters.profiles List of network configuration diagnostic - * profiles. - * - * @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 NetworkConfigurationDiagnosticResponse} 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 _getNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters, 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.'); - } - - // Send request - this.beginGetNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['NetworkConfigurationDiagnosticResponse']().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); - }); - }); -} - -/** - * Deletes the specified network watcher resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, networkWatcherName, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName 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/networkWatchers/{networkWatcherName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - 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 = 'DELETE'; - 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 !== 202 && statusCode !== 204) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Verify IP flow from the specified VM to a location given the currently - * configured NSG rules. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the IP flow to be - * verified. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform next-hop on. - * - * @param {string} parameters.direction The direction of the packet represented - * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' - * - * @param {string} parameters.protocol Protocol to be verified on. Possible - * values include: 'TCP', 'UDP' - * - * @param {string} parameters.localPort The local port. Acceptable values are a - * single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.remotePort The remote port. Acceptable values are - * a single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.localIPAddress The local IP address. Acceptable - * values are valid IPv4 addresses. - * - * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable - * values are valid IPv4 addresses. - * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of them, then this - * parameter must be specified. Otherwise optional). - * - * @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 VerificationIPFlowResult} 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 _beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/networkWatchers/{networkWatcherName}/ipFlowVerify'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - 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 = 'POST'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['VerificationIPFlowParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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['VerificationIPFlowResult']().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); - } - } - // Deserialize Response - if (statusCode === 202) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VerificationIPFlowResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Gets the next hop from the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the source and destination - * endpoint. - * - * @param {string} parameters.targetResourceId The resource identifier of the - * target resource against which the action is to be performed. - * - * @param {string} parameters.sourceIPAddress The source IP address. - * - * @param {string} parameters.destinationIPAddress The destination IP address. - * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of the nics, then this - * parameter must be specified. Otherwise optional). - * - * @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 NextHopResult} 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 _beginGetNextHop(resourceGroupName, networkWatcherName, parameters, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/networkWatchers/{networkWatcherName}/nextHop'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - 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 = 'POST'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['NextHopParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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['NextHopResult']().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); - } - } - // Deserialize Response - if (statusCode === 202) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['NextHopResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Gets the configured and effective security group rules on the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the VM to check security - * groups for. - * - * @param {string} parameters.targetResourceId ID of the target VM. - * - * @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 SecurityGroupViewResult} 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 _beginGetVMSecurityRules(resourceGroupName, networkWatcherName, parameters, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/networkWatchers/{networkWatcherName}/securityGroupView'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - 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 = 'POST'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['SecurityGroupViewParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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['SecurityGroupViewResult']().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); - } - } - // Deserialize Response - if (statusCode === 202) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SecurityGroupViewResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Initiate troubleshooting on a specified resource - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the resource to - * troubleshoot. - * - * @param {string} parameters.targetResourceId The target resource to - * troubleshoot. - * - * @param {string} parameters.storageId The ID for the storage account to save - * the troubleshoot result. - * - * @param {string} parameters.storagePath The path to the blob to save the - * troubleshoot result in. - * - * @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 TroubleshootingResult} 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 _beginGetTroubleshooting(resourceGroupName, networkWatcherName, parameters, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/networkWatchers/{networkWatcherName}/troubleshoot'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - 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 = 'POST'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['TroubleshootingParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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['TroubleshootingResult']().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); - } - } - // Deserialize Response - if (statusCode === 202) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TroubleshootingResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Get the last completed troubleshooting result on a specified resource - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the resource to query the - * troubleshooting result. - * - * @param {string} parameters.targetResourceId The target resource ID to query - * the troubleshooting result. - * - * @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 TroubleshootingResult} 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 _beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/networkWatchers/{networkWatcherName}/queryTroubleshootResult'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - 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 = 'POST'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['QueryTroubleshootingParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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['TroubleshootingResult']().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); - } - } - // Deserialize Response - if (statusCode === 202) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TroubleshootingResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Configures flow log and traffic analytics (optional) on a specified - * resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the configuration of flow - * log. - * - * @param {string} parameters.targetResourceId The ID of the resource to - * configure for flow log and traffic analytics (optional) . - * - * @param {string} parameters.storageId ID of the storage account which is used - * to store the flow log. - * - * @param {boolean} parameters.enabled Flag to enable/disable flow logging. - * - * @param {object} [parameters.retentionPolicy] - * - * @param {number} [parameters.retentionPolicy.days] Number of days to retain - * flow log records. - * - * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable - * retention. - * - * @param {object} [parameters.format] - * - * @param {string} [parameters.format.type] The file type of flow log. Possible - * values include: 'JSON' - * - * @param {number} [parameters.format.version] The version (revision) of the - * flow log. - * - * @param {object} [parameters.flowAnalyticsConfiguration] - * - * @param {object} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration - * - * @param {boolean} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled - * Flag to enable/disable traffic analytics. - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId - * The resource guid of the attached workspace - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion - * The location of the attached workspace - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId - * Resource Id of the attached workspace - * - * @param {number} - * [parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.trafficAnalyticsInterval] - * The interval in minutes which would decide how frequently TA service should - * do flow analytics - * - * @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 FlowLogInformation} 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 _beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/networkWatchers/{networkWatcherName}/configureFlowLog'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - 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 = 'POST'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['FlowLogInformation']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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['FlowLogInformation']().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); - } - } - // Deserialize Response - if (statusCode === 202) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FlowLogInformation']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Queries status of flow log and traffic analytics (optional) on a specified - * resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define a resource to query flow - * log and traffic analytics (optional) status. - * - * @param {string} parameters.targetResourceId The target resource where - * getting the flow log and traffic analytics (optional) status. - * - * @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 FlowLogInformation} 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 _beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameters, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/networkWatchers/{networkWatcherName}/queryFlowLogStatus'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - 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 = 'POST'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['FlowLogStatusParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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['FlowLogInformation']().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); - } - } - // Deserialize Response - if (statusCode === 202) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FlowLogInformation']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Verifies the possibility of establishing a direct TCP connection from a - * virtual machine to a given endpoint including another VM or an arbitrary - * remote server. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine how the connectivity - * check will be performed. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource from - * which a connectivity check will be initiated. - * - * @param {number} [parameters.source.port] The source port from which a - * connectivity check will be performed. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * to which a connection attempt will be made. - * - * @param {string} [parameters.destination.address] The IP address or URI the - * resource to which a connection attempt will be made. - * - * @param {number} [parameters.destination.port] Port on which check - * connectivity will be performed. - * - * @param {string} [parameters.protocol] Network protocol. Possible values - * include: 'Tcp', 'Http', 'Https', 'Icmp' - * - * @param {object} [parameters.protocolConfiguration] - * - * @param {object} [parameters.protocolConfiguration.hTTPConfiguration] - * - * @param {string} [parameters.protocolConfiguration.hTTPConfiguration.method] - * HTTP method. Possible values include: 'Get' - * - * @param {array} [parameters.protocolConfiguration.hTTPConfiguration.headers] - * List of HTTP headers. - * - * @param {array} - * [parameters.protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid - * status codes. - * - * @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 ConnectivityInformation} 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 _beginCheckConnectivity(resourceGroupName, networkWatcherName, parameters, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/networkWatchers/{networkWatcherName}/connectivityCheck'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - 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 = 'POST'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['ConnectivityParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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['ConnectivityInformation']().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); - } - } - // Deserialize Response - if (statusCode === 202) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ConnectivityInformation']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Gets the relative latency score for internet service providers from a - * specified location to Azure regions. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine Azure reachability - * report configuration. - * - * @param {object} parameters.providerLocation - * - * @param {string} parameters.providerLocation.country The name of the country. - * - * @param {string} [parameters.providerLocation.state] The name of the state. - * - * @param {string} [parameters.providerLocation.city] The name of the city or - * town. - * - * @param {array} [parameters.providers] List of Internet service providers. - * - * @param {array} [parameters.azureLocations] Optional Azure regions to scope - * the query to. - * - * @param {date} parameters.startTime The start time for the Azure reachability - * report. - * - * @param {date} parameters.endTime The end time for the Azure reachability - * report. - * - * @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 AzureReachabilityReport} 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 _beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/networkWatchers/{networkWatcherName}/azureReachabilityReport'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - 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 = 'POST'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['AzureReachabilityReportParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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['AzureReachabilityReport']().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); - } - } - // Deserialize Response - if (statusCode === 202) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['AzureReachabilityReport']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Lists all available internet service providers for a specified Azure region. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that scope the list of available - * providers. - * - * @param {array} [parameters.azureLocations] A list of Azure regions. - * - * @param {string} [parameters.country] The country for available providers - * list. - * - * @param {string} [parameters.state] The state for available providers list. - * - * @param {string} [parameters.city] The city or town for available providers - * list. - * - * @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 AvailableProvidersList} 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 _beginListAvailableProviders(resourceGroupName, networkWatcherName, parameters, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/networkWatchers/{networkWatcherName}/availableProvidersList'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - 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 = 'POST'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['AvailableProvidersListParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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['AvailableProvidersList']().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); - } - } - // Deserialize Response - if (statusCode === 202) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['AvailableProvidersList']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Get network configuration diagnostic. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters to get network configuration - * diagnostic. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform network configuration diagnostic. Valid options are VM, - * NetworkInterface, VMSS/NetworkInterface and Application Gateway. - * - * @param {string} [parameters.verbosityLevel] Verbosity level. Accepted values - * are 'Normal', 'Minimum', 'Full'. Possible values include: 'Normal', - * 'Minimum', 'Full' - * - * @param {array} parameters.profiles List of network configuration diagnostic - * profiles. - * - * @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 NetworkConfigurationDiagnosticResponse} 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 _beginGetNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - 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 = 'POST'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['NetworkConfigurationDiagnosticParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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['NetworkConfigurationDiagnosticResponse']().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); - } - } - // Deserialize Response - if (statusCode === 202) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['NetworkConfigurationDiagnosticResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** Class representing a NetworkWatchers. */ -class NetworkWatchers { - /** - * Create a NetworkWatchers. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._createOrUpdate = _createOrUpdate; - this._get = _get; - this._deleteMethod = _deleteMethod; - this._updateTags = _updateTags; - this._list = _list; - this._listAll = _listAll; - this._getTopology = _getTopology; - this._verifyIPFlow = _verifyIPFlow; - this._getNextHop = _getNextHop; - this._getVMSecurityRules = _getVMSecurityRules; - this._getTroubleshooting = _getTroubleshooting; - this._getTroubleshootingResult = _getTroubleshootingResult; - this._setFlowLogConfiguration = _setFlowLogConfiguration; - this._getFlowLogStatus = _getFlowLogStatus; - this._checkConnectivity = _checkConnectivity; - this._getAzureReachabilityReport = _getAzureReachabilityReport; - this._listAvailableProviders = _listAvailableProviders; - this._getNetworkConfigurationDiagnostic = _getNetworkConfigurationDiagnostic; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginVerifyIPFlow = _beginVerifyIPFlow; - this._beginGetNextHop = _beginGetNextHop; - this._beginGetVMSecurityRules = _beginGetVMSecurityRules; - this._beginGetTroubleshooting = _beginGetTroubleshooting; - this._beginGetTroubleshootingResult = _beginGetTroubleshootingResult; - this._beginSetFlowLogConfiguration = _beginSetFlowLogConfiguration; - this._beginGetFlowLogStatus = _beginGetFlowLogStatus; - this._beginCheckConnectivity = _beginCheckConnectivity; - this._beginGetAzureReachabilityReport = _beginGetAzureReachabilityReport; - this._beginListAvailableProviders = _beginListAvailableProviders; - this._beginGetNetworkConfigurationDiagnostic = _beginGetNetworkConfigurationDiagnostic; - } - - /** - * Creates or updates a network watcher in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the network watcher - * resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a network watcher in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the network watcher - * resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {NetworkWatcher} - 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 NetworkWatcher} 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. - */ - createOrUpdate(resourceGroupName, networkWatcherName, parameters, 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._createOrUpdate(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); - } - } - - /** - * Gets the specified network watcher by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @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, networkWatcherName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, networkWatcherName, 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 network watcher by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @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 {NetworkWatcher} - 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 NetworkWatcher} 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, networkWatcherName, 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, networkWatcherName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, networkWatcherName, options, optionalCallback); - } - } - - /** - * Deletes the specified network watcher resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, networkWatcherName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified network watcher resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, networkWatcherName, 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._deleteMethod(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, networkWatcherName, options, optionalCallback); - } - } - - /** - * Updates a network watcher tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters supplied to update network watcher - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateTags(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates a network watcher tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters supplied to update network watcher - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {NetworkWatcher} - 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 NetworkWatcher} 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. - */ - updateTags(resourceGroupName, networkWatcherName, parameters, 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._updateTags(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateTags(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); - } - } - - /** - * Gets all network watchers by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, 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 network watchers by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {NetworkWatcherListResult} - 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 NetworkWatcherListResult} 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, 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, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, options, optionalCallback); - } - } - - /** - * Gets all network watchers by subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAll(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 network watchers by subscription. - * - * @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 {NetworkWatcherListResult} - 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 NetworkWatcherListResult} 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. - */ - listAll(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._listAll(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAll(options, optionalCallback); - } - } - - /** - * Gets the current network topology by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the representation of - * topology. - * - * @param {string} [parameters.targetResourceGroupName] The name of the target - * resource group to perform topology on. - * - * @param {object} [parameters.targetVirtualNetwork] The reference of the - * Virtual Network resource. - * - * @param {object} [parameters.targetSubnet] The reference of the Subnet - * resource. - * - * @param {string} [parameters.targetSubnet.id] Resource ID. - * - * @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. - */ - getTopologyWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getTopology(resourceGroupName, networkWatcherName, parameters, 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 current network topology by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the representation of - * topology. - * - * @param {string} [parameters.targetResourceGroupName] The name of the target - * resource group to perform topology on. - * - * @param {object} [parameters.targetVirtualNetwork] The reference of the - * Virtual Network resource. - * - * @param {object} [parameters.targetSubnet] The reference of the Subnet - * resource. - * - * @param {string} [parameters.targetSubnet.id] Resource ID. - * - * @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 {Topology} - 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 Topology} 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. - */ - getTopology(resourceGroupName, networkWatcherName, parameters, 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._getTopology(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getTopology(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); - } - } - - /** - * Verify IP flow from the specified VM to a location given the currently - * configured NSG rules. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the IP flow to be - * verified. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform next-hop on. - * - * @param {string} parameters.direction The direction of the packet represented - * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' - * - * @param {string} parameters.protocol Protocol to be verified on. Possible - * values include: 'TCP', 'UDP' - * - * @param {string} parameters.localPort The local port. Acceptable values are a - * single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.remotePort The remote port. Acceptable values are - * a single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.localIPAddress The local IP address. Acceptable - * values are valid IPv4 addresses. - * - * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable - * values are valid IPv4 addresses. - * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of them, then this - * parameter must be specified. Otherwise optional). - * - * @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. - */ - verifyIPFlowWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._verifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Verify IP flow from the specified VM to a location given the currently - * configured NSG rules. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the IP flow to be - * verified. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform next-hop on. - * - * @param {string} parameters.direction The direction of the packet represented - * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' - * - * @param {string} parameters.protocol Protocol to be verified on. Possible - * values include: 'TCP', 'UDP' - * - * @param {string} parameters.localPort The local port. Acceptable values are a - * single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.remotePort The remote port. Acceptable values are - * a single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.localIPAddress The local IP address. Acceptable - * values are valid IPv4 addresses. - * - * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable - * values are valid IPv4 addresses. - * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of them, then this - * parameter must be specified. Otherwise optional). - * - * @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 {VerificationIPFlowResult} - 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 VerificationIPFlowResult} 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. - */ - verifyIPFlow(resourceGroupName, networkWatcherName, parameters, 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._verifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._verifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); - } - } - - /** - * Gets the next hop from the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the source and destination - * endpoint. - * - * @param {string} parameters.targetResourceId The resource identifier of the - * target resource against which the action is to be performed. - * - * @param {string} parameters.sourceIPAddress The source IP address. - * - * @param {string} parameters.destinationIPAddress The destination IP address. - * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of the nics, then this - * parameter must be specified. Otherwise optional). - * - * @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. - */ - getNextHopWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getNextHop(resourceGroupName, networkWatcherName, parameters, 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 next hop from the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the source and destination - * endpoint. - * - * @param {string} parameters.targetResourceId The resource identifier of the - * target resource against which the action is to be performed. - * - * @param {string} parameters.sourceIPAddress The source IP address. - * - * @param {string} parameters.destinationIPAddress The destination IP address. - * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of the nics, then this - * parameter must be specified. Otherwise optional). - * - * @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 {NextHopResult} - 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 NextHopResult} 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. - */ - getNextHop(resourceGroupName, networkWatcherName, parameters, 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._getNextHop(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getNextHop(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); - } - } - - /** - * Gets the configured and effective security group rules on the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the VM to check security - * groups for. - * - * @param {string} parameters.targetResourceId ID of the target VM. - * - * @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. - */ - getVMSecurityRulesWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getVMSecurityRules(resourceGroupName, networkWatcherName, parameters, 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 configured and effective security group rules on the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the VM to check security - * groups for. - * - * @param {string} parameters.targetResourceId ID of the target VM. - * - * @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 {SecurityGroupViewResult} - 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 SecurityGroupViewResult} 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. - */ - getVMSecurityRules(resourceGroupName, networkWatcherName, parameters, 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._getVMSecurityRules(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getVMSecurityRules(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); - } - } - - /** - * Initiate troubleshooting on a specified resource - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the resource to - * troubleshoot. - * - * @param {string} parameters.targetResourceId The target resource to - * troubleshoot. - * - * @param {string} parameters.storageId The ID for the storage account to save - * the troubleshoot result. - * - * @param {string} parameters.storagePath The path to the blob to save the - * troubleshoot result in. - * - * @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. - */ - getTroubleshootingWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Initiate troubleshooting on a specified resource - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the resource to - * troubleshoot. - * - * @param {string} parameters.targetResourceId The target resource to - * troubleshoot. - * - * @param {string} parameters.storageId The ID for the storage account to save - * the troubleshoot result. - * - * @param {string} parameters.storagePath The path to the blob to save the - * troubleshoot result in. - * - * @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 {TroubleshootingResult} - 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 TroubleshootingResult} 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. - */ - getTroubleshooting(resourceGroupName, networkWatcherName, parameters, 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._getTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); - } - } - - /** - * Get the last completed troubleshooting result on a specified resource - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the resource to query the - * troubleshooting result. - * - * @param {string} parameters.targetResourceId The target resource ID to query - * the troubleshooting result. - * - * @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. - */ - getTroubleshootingResultWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Get the last completed troubleshooting result on a specified resource - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the resource to query the - * troubleshooting result. - * - * @param {string} parameters.targetResourceId The target resource ID to query - * the troubleshooting result. - * - * @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 {TroubleshootingResult} - 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 TroubleshootingResult} 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. - */ - getTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, 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._getTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); - } - } - - /** - * Configures flow log and traffic analytics (optional) on a specified - * resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the configuration of flow - * log. - * - * @param {string} parameters.targetResourceId The ID of the resource to - * configure for flow log and traffic analytics (optional) . - * - * @param {string} parameters.storageId ID of the storage account which is used - * to store the flow log. - * - * @param {boolean} parameters.enabled Flag to enable/disable flow logging. - * - * @param {object} [parameters.retentionPolicy] - * - * @param {number} [parameters.retentionPolicy.days] Number of days to retain - * flow log records. - * - * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable - * retention. - * - * @param {object} [parameters.format] - * - * @param {string} [parameters.format.type] The file type of flow log. Possible - * values include: 'JSON' - * - * @param {number} [parameters.format.version] The version (revision) of the - * flow log. - * - * @param {object} [parameters.flowAnalyticsConfiguration] - * - * @param {object} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration - * - * @param {boolean} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled - * Flag to enable/disable traffic analytics. - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId - * The resource guid of the attached workspace - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion - * The location of the attached workspace - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId - * Resource Id of the attached workspace - * - * @param {number} - * [parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.trafficAnalyticsInterval] - * The interval in minutes which would decide how frequently TA service should - * do flow analytics - * - * @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. - */ - setFlowLogConfigurationWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._setFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Configures flow log and traffic analytics (optional) on a specified - * resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the configuration of flow - * log. - * - * @param {string} parameters.targetResourceId The ID of the resource to - * configure for flow log and traffic analytics (optional) . - * - * @param {string} parameters.storageId ID of the storage account which is used - * to store the flow log. - * - * @param {boolean} parameters.enabled Flag to enable/disable flow logging. - * - * @param {object} [parameters.retentionPolicy] - * - * @param {number} [parameters.retentionPolicy.days] Number of days to retain - * flow log records. - * - * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable - * retention. - * - * @param {object} [parameters.format] - * - * @param {string} [parameters.format.type] The file type of flow log. Possible - * values include: 'JSON' - * - * @param {number} [parameters.format.version] The version (revision) of the - * flow log. - * - * @param {object} [parameters.flowAnalyticsConfiguration] - * - * @param {object} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration - * - * @param {boolean} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled - * Flag to enable/disable traffic analytics. - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId - * The resource guid of the attached workspace - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion - * The location of the attached workspace - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId - * Resource Id of the attached workspace - * - * @param {number} - * [parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.trafficAnalyticsInterval] - * The interval in minutes which would decide how frequently TA service should - * do flow analytics - * - * @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 {FlowLogInformation} - 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 FlowLogInformation} 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. - */ - setFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, 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._setFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._setFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); - } - } - - /** - * Queries status of flow log and traffic analytics (optional) on a specified - * resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define a resource to query flow - * log and traffic analytics (optional) status. - * - * @param {string} parameters.targetResourceId The target resource where - * getting the flow log and traffic analytics (optional) status. - * - * @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. - */ - getFlowLogStatusWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Queries status of flow log and traffic analytics (optional) on a specified - * resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define a resource to query flow - * log and traffic analytics (optional) status. - * - * @param {string} parameters.targetResourceId The target resource where - * getting the flow log and traffic analytics (optional) status. - * - * @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 {FlowLogInformation} - 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 FlowLogInformation} 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. - */ - getFlowLogStatus(resourceGroupName, networkWatcherName, parameters, 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._getFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); - } - } - - /** - * Verifies the possibility of establishing a direct TCP connection from a - * virtual machine to a given endpoint including another VM or an arbitrary - * remote server. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine how the connectivity - * check will be performed. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource from - * which a connectivity check will be initiated. - * - * @param {number} [parameters.source.port] The source port from which a - * connectivity check will be performed. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * to which a connection attempt will be made. - * - * @param {string} [parameters.destination.address] The IP address or URI the - * resource to which a connection attempt will be made. - * - * @param {number} [parameters.destination.port] Port on which check - * connectivity will be performed. - * - * @param {string} [parameters.protocol] Network protocol. Possible values - * include: 'Tcp', 'Http', 'Https', 'Icmp' - * - * @param {object} [parameters.protocolConfiguration] - * - * @param {object} [parameters.protocolConfiguration.hTTPConfiguration] - * - * @param {string} [parameters.protocolConfiguration.hTTPConfiguration.method] - * HTTP method. Possible values include: 'Get' - * - * @param {array} [parameters.protocolConfiguration.hTTPConfiguration.headers] - * List of HTTP headers. - * - * @param {array} - * [parameters.protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid - * status codes. - * - * @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. - */ - checkConnectivityWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._checkConnectivity(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Verifies the possibility of establishing a direct TCP connection from a - * virtual machine to a given endpoint including another VM or an arbitrary - * remote server. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine how the connectivity - * check will be performed. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource from - * which a connectivity check will be initiated. - * - * @param {number} [parameters.source.port] The source port from which a - * connectivity check will be performed. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * to which a connection attempt will be made. - * - * @param {string} [parameters.destination.address] The IP address or URI the - * resource to which a connection attempt will be made. - * - * @param {number} [parameters.destination.port] Port on which check - * connectivity will be performed. - * - * @param {string} [parameters.protocol] Network protocol. Possible values - * include: 'Tcp', 'Http', 'Https', 'Icmp' - * - * @param {object} [parameters.protocolConfiguration] - * - * @param {object} [parameters.protocolConfiguration.hTTPConfiguration] - * - * @param {string} [parameters.protocolConfiguration.hTTPConfiguration.method] - * HTTP method. Possible values include: 'Get' - * - * @param {array} [parameters.protocolConfiguration.hTTPConfiguration.headers] - * List of HTTP headers. - * - * @param {array} - * [parameters.protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid - * status codes. - * - * @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 {ConnectivityInformation} - 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 ConnectivityInformation} 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. - */ - checkConnectivity(resourceGroupName, networkWatcherName, parameters, 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._checkConnectivity(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._checkConnectivity(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); - } - } - - /** - * Gets the relative latency score for internet service providers from a - * specified location to Azure regions. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine Azure reachability - * report configuration. - * - * @param {object} parameters.providerLocation - * - * @param {string} parameters.providerLocation.country The name of the country. - * - * @param {string} [parameters.providerLocation.state] The name of the state. - * - * @param {string} [parameters.providerLocation.city] The name of the city or - * town. - * - * @param {array} [parameters.providers] List of Internet service providers. - * - * @param {array} [parameters.azureLocations] Optional Azure regions to scope - * the query to. - * - * @param {date} parameters.startTime The start time for the Azure reachability - * report. - * - * @param {date} parameters.endTime The end time for the Azure reachability - * report. - * - * @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. - */ - getAzureReachabilityReportWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, 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 relative latency score for internet service providers from a - * specified location to Azure regions. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine Azure reachability - * report configuration. - * - * @param {object} parameters.providerLocation - * - * @param {string} parameters.providerLocation.country The name of the country. - * - * @param {string} [parameters.providerLocation.state] The name of the state. - * - * @param {string} [parameters.providerLocation.city] The name of the city or - * town. - * - * @param {array} [parameters.providers] List of Internet service providers. - * - * @param {array} [parameters.azureLocations] Optional Azure regions to scope - * the query to. - * - * @param {date} parameters.startTime The start time for the Azure reachability - * report. - * - * @param {date} parameters.endTime The end time for the Azure reachability - * report. - * - * @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 {AzureReachabilityReport} - 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 AzureReachabilityReport} 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. - */ - getAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, 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._getAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); - } - } - - /** - * Lists all available internet service providers for a specified Azure region. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that scope the list of available - * providers. - * - * @param {array} [parameters.azureLocations] A list of Azure regions. - * - * @param {string} [parameters.country] The country for available providers - * list. - * - * @param {string} [parameters.state] The state for available providers list. - * - * @param {string} [parameters.city] The city or town for available providers - * list. - * - * @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. - */ - listAvailableProvidersWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all available internet service providers for a specified Azure region. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that scope the list of available - * providers. - * - * @param {array} [parameters.azureLocations] A list of Azure regions. - * - * @param {string} [parameters.country] The country for available providers - * list. - * - * @param {string} [parameters.state] The state for available providers list. - * - * @param {string} [parameters.city] The city or town for available providers - * list. - * - * @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 {AvailableProvidersList} - 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 AvailableProvidersList} 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. - */ - listAvailableProviders(resourceGroupName, networkWatcherName, parameters, 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._listAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); - } - } - - /** - * Get network configuration diagnostic. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters to get network configuration - * diagnostic. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform network configuration diagnostic. Valid options are VM, - * NetworkInterface, VMSS/NetworkInterface and Application Gateway. - * - * @param {string} [parameters.verbosityLevel] Verbosity level. Accepted values - * are 'Normal', 'Minimum', 'Full'. Possible values include: 'Normal', - * 'Minimum', 'Full' - * - * @param {array} parameters.profiles List of network configuration diagnostic - * profiles. - * - * @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. - */ - getNetworkConfigurationDiagnosticWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Get network configuration diagnostic. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters to get network configuration - * diagnostic. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform network configuration diagnostic. Valid options are VM, - * NetworkInterface, VMSS/NetworkInterface and Application Gateway. - * - * @param {string} [parameters.verbosityLevel] Verbosity level. Accepted values - * are 'Normal', 'Minimum', 'Full'. Possible values include: 'Normal', - * 'Minimum', 'Full' - * - * @param {array} parameters.profiles List of network configuration diagnostic - * profiles. - * - * @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 {NetworkConfigurationDiagnosticResponse} - 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 NetworkConfigurationDiagnosticResponse} 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. - */ - getNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters, 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._getNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); - } - } - - /** - * Deletes the specified network watcher resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, networkWatcherName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified network watcher resource. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, networkWatcherName, 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._beginDeleteMethod(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, networkWatcherName, options, optionalCallback); - } - } - - /** - * Verify IP flow from the specified VM to a location given the currently - * configured NSG rules. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the IP flow to be - * verified. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform next-hop on. - * - * @param {string} parameters.direction The direction of the packet represented - * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' - * - * @param {string} parameters.protocol Protocol to be verified on. Possible - * values include: 'TCP', 'UDP' - * - * @param {string} parameters.localPort The local port. Acceptable values are a - * single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.remotePort The remote port. Acceptable values are - * a single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.localIPAddress The local IP address. Acceptable - * values are valid IPv4 addresses. - * - * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable - * values are valid IPv4 addresses. - * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of them, then this - * parameter must be specified. Otherwise optional). - * - * @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. - */ - beginVerifyIPFlowWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Verify IP flow from the specified VM to a location given the currently - * configured NSG rules. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the IP flow to be - * verified. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform next-hop on. - * - * @param {string} parameters.direction The direction of the packet represented - * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' - * - * @param {string} parameters.protocol Protocol to be verified on. Possible - * values include: 'TCP', 'UDP' - * - * @param {string} parameters.localPort The local port. Acceptable values are a - * single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.remotePort The remote port. Acceptable values are - * a single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.localIPAddress The local IP address. Acceptable - * values are valid IPv4 addresses. - * - * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable - * values are valid IPv4 addresses. - * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of them, then this - * parameter must be specified. Otherwise optional). - * - * @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 {VerificationIPFlowResult} - 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 VerificationIPFlowResult} 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. - */ - beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, 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._beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); - } - } - - /** - * Gets the next hop from the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the source and destination - * endpoint. - * - * @param {string} parameters.targetResourceId The resource identifier of the - * target resource against which the action is to be performed. - * - * @param {string} parameters.sourceIPAddress The source IP address. - * - * @param {string} parameters.destinationIPAddress The destination IP address. - * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of the nics, then this - * parameter must be specified. Otherwise optional). - * - * @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. - */ - beginGetNextHopWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginGetNextHop(resourceGroupName, networkWatcherName, parameters, 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 next hop from the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the source and destination - * endpoint. - * - * @param {string} parameters.targetResourceId The resource identifier of the - * target resource against which the action is to be performed. - * - * @param {string} parameters.sourceIPAddress The source IP address. - * - * @param {string} parameters.destinationIPAddress The destination IP address. - * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of the nics, then this - * parameter must be specified. Otherwise optional). - * - * @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 {NextHopResult} - 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 NextHopResult} 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. - */ - beginGetNextHop(resourceGroupName, networkWatcherName, parameters, 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._beginGetNextHop(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginGetNextHop(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); - } - } - - /** - * Gets the configured and effective security group rules on the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the VM to check security - * groups for. - * - * @param {string} parameters.targetResourceId ID of the target VM. - * - * @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. - */ - beginGetVMSecurityRulesWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginGetVMSecurityRules(resourceGroupName, networkWatcherName, parameters, 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 configured and effective security group rules on the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the VM to check security - * groups for. - * - * @param {string} parameters.targetResourceId ID of the target VM. - * - * @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 {SecurityGroupViewResult} - 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 SecurityGroupViewResult} 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. - */ - beginGetVMSecurityRules(resourceGroupName, networkWatcherName, parameters, 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._beginGetVMSecurityRules(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginGetVMSecurityRules(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); - } - } - - /** - * Initiate troubleshooting on a specified resource - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the resource to - * troubleshoot. - * - * @param {string} parameters.targetResourceId The target resource to - * troubleshoot. - * - * @param {string} parameters.storageId The ID for the storage account to save - * the troubleshoot result. - * - * @param {string} parameters.storagePath The path to the blob to save the - * troubleshoot result in. - * - * @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. - */ - beginGetTroubleshootingWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginGetTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Initiate troubleshooting on a specified resource - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the resource to - * troubleshoot. - * - * @param {string} parameters.targetResourceId The target resource to - * troubleshoot. - * - * @param {string} parameters.storageId The ID for the storage account to save - * the troubleshoot result. - * - * @param {string} parameters.storagePath The path to the blob to save the - * troubleshoot result in. - * - * @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 {TroubleshootingResult} - 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 TroubleshootingResult} 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. - */ - beginGetTroubleshooting(resourceGroupName, networkWatcherName, parameters, 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._beginGetTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginGetTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); - } - } - - /** - * Get the last completed troubleshooting result on a specified resource - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the resource to query the - * troubleshooting result. - * - * @param {string} parameters.targetResourceId The target resource ID to query - * the troubleshooting result. - * - * @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. - */ - beginGetTroubleshootingResultWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Get the last completed troubleshooting result on a specified resource - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the resource to query the - * troubleshooting result. - * - * @param {string} parameters.targetResourceId The target resource ID to query - * the troubleshooting result. - * - * @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 {TroubleshootingResult} - 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 TroubleshootingResult} 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. - */ - beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, 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._beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); - } - } - - /** - * Configures flow log and traffic analytics (optional) on a specified - * resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the configuration of flow - * log. - * - * @param {string} parameters.targetResourceId The ID of the resource to - * configure for flow log and traffic analytics (optional) . - * - * @param {string} parameters.storageId ID of the storage account which is used - * to store the flow log. - * - * @param {boolean} parameters.enabled Flag to enable/disable flow logging. - * - * @param {object} [parameters.retentionPolicy] - * - * @param {number} [parameters.retentionPolicy.days] Number of days to retain - * flow log records. - * - * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable - * retention. - * - * @param {object} [parameters.format] - * - * @param {string} [parameters.format.type] The file type of flow log. Possible - * values include: 'JSON' - * - * @param {number} [parameters.format.version] The version (revision) of the - * flow log. - * - * @param {object} [parameters.flowAnalyticsConfiguration] - * - * @param {object} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration - * - * @param {boolean} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled - * Flag to enable/disable traffic analytics. - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId - * The resource guid of the attached workspace - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion - * The location of the attached workspace - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId - * Resource Id of the attached workspace - * - * @param {number} - * [parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.trafficAnalyticsInterval] - * The interval in minutes which would decide how frequently TA service should - * do flow analytics - * - * @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. - */ - beginSetFlowLogConfigurationWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Configures flow log and traffic analytics (optional) on a specified - * resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the configuration of flow - * log. - * - * @param {string} parameters.targetResourceId The ID of the resource to - * configure for flow log and traffic analytics (optional) . - * - * @param {string} parameters.storageId ID of the storage account which is used - * to store the flow log. - * - * @param {boolean} parameters.enabled Flag to enable/disable flow logging. - * - * @param {object} [parameters.retentionPolicy] - * - * @param {number} [parameters.retentionPolicy.days] Number of days to retain - * flow log records. - * - * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable - * retention. - * - * @param {object} [parameters.format] - * - * @param {string} [parameters.format.type] The file type of flow log. Possible - * values include: 'JSON' - * - * @param {number} [parameters.format.version] The version (revision) of the - * flow log. - * - * @param {object} [parameters.flowAnalyticsConfiguration] - * - * @param {object} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration - * - * @param {boolean} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled - * Flag to enable/disable traffic analytics. - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId - * The resource guid of the attached workspace - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion - * The location of the attached workspace - * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId - * Resource Id of the attached workspace - * - * @param {number} - * [parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.trafficAnalyticsInterval] - * The interval in minutes which would decide how frequently TA service should - * do flow analytics - * - * @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 {FlowLogInformation} - 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 FlowLogInformation} 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. - */ - beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, 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._beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); - } - } - - /** - * Queries status of flow log and traffic analytics (optional) on a specified - * resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define a resource to query flow - * log and traffic analytics (optional) status. - * - * @param {string} parameters.targetResourceId The target resource where - * getting the flow log and traffic analytics (optional) status. - * - * @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. - */ - beginGetFlowLogStatusWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Queries status of flow log and traffic analytics (optional) on a specified - * resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define a resource to query flow - * log and traffic analytics (optional) status. - * - * @param {string} parameters.targetResourceId The target resource where - * getting the flow log and traffic analytics (optional) status. - * - * @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 {FlowLogInformation} - 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 FlowLogInformation} 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. - */ - beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameters, 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._beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); - } - } - - /** - * Verifies the possibility of establishing a direct TCP connection from a - * virtual machine to a given endpoint including another VM or an arbitrary - * remote server. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine how the connectivity - * check will be performed. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource from - * which a connectivity check will be initiated. - * - * @param {number} [parameters.source.port] The source port from which a - * connectivity check will be performed. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * to which a connection attempt will be made. - * - * @param {string} [parameters.destination.address] The IP address or URI the - * resource to which a connection attempt will be made. - * - * @param {number} [parameters.destination.port] Port on which check - * connectivity will be performed. - * - * @param {string} [parameters.protocol] Network protocol. Possible values - * include: 'Tcp', 'Http', 'Https', 'Icmp' - * - * @param {object} [parameters.protocolConfiguration] - * - * @param {object} [parameters.protocolConfiguration.hTTPConfiguration] - * - * @param {string} [parameters.protocolConfiguration.hTTPConfiguration.method] - * HTTP method. Possible values include: 'Get' - * - * @param {array} [parameters.protocolConfiguration.hTTPConfiguration.headers] - * List of HTTP headers. - * - * @param {array} - * [parameters.protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid - * status codes. - * - * @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. - */ - beginCheckConnectivityWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCheckConnectivity(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Verifies the possibility of establishing a direct TCP connection from a - * virtual machine to a given endpoint including another VM or an arbitrary - * remote server. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine how the connectivity - * check will be performed. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource from - * which a connectivity check will be initiated. - * - * @param {number} [parameters.source.port] The source port from which a - * connectivity check will be performed. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * to which a connection attempt will be made. - * - * @param {string} [parameters.destination.address] The IP address or URI the - * resource to which a connection attempt will be made. - * - * @param {number} [parameters.destination.port] Port on which check - * connectivity will be performed. - * - * @param {string} [parameters.protocol] Network protocol. Possible values - * include: 'Tcp', 'Http', 'Https', 'Icmp' - * - * @param {object} [parameters.protocolConfiguration] - * - * @param {object} [parameters.protocolConfiguration.hTTPConfiguration] - * - * @param {string} [parameters.protocolConfiguration.hTTPConfiguration.method] - * HTTP method. Possible values include: 'Get' - * - * @param {array} [parameters.protocolConfiguration.hTTPConfiguration.headers] - * List of HTTP headers. - * - * @param {array} - * [parameters.protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid - * status codes. - * - * @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 {ConnectivityInformation} - 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 ConnectivityInformation} 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. - */ - beginCheckConnectivity(resourceGroupName, networkWatcherName, parameters, 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._beginCheckConnectivity(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCheckConnectivity(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); - } - } - - /** - * Gets the relative latency score for internet service providers from a - * specified location to Azure regions. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine Azure reachability - * report configuration. - * - * @param {object} parameters.providerLocation - * - * @param {string} parameters.providerLocation.country The name of the country. - * - * @param {string} [parameters.providerLocation.state] The name of the state. - * - * @param {string} [parameters.providerLocation.city] The name of the city or - * town. - * - * @param {array} [parameters.providers] List of Internet service providers. - * - * @param {array} [parameters.azureLocations] Optional Azure regions to scope - * the query to. - * - * @param {date} parameters.startTime The start time for the Azure reachability - * report. - * - * @param {date} parameters.endTime The end time for the Azure reachability - * report. - * - * @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. - */ - beginGetAzureReachabilityReportWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, 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 relative latency score for internet service providers from a - * specified location to Azure regions. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine Azure reachability - * report configuration. - * - * @param {object} parameters.providerLocation - * - * @param {string} parameters.providerLocation.country The name of the country. - * - * @param {string} [parameters.providerLocation.state] The name of the state. - * - * @param {string} [parameters.providerLocation.city] The name of the city or - * town. - * - * @param {array} [parameters.providers] List of Internet service providers. - * - * @param {array} [parameters.azureLocations] Optional Azure regions to scope - * the query to. - * - * @param {date} parameters.startTime The start time for the Azure reachability - * report. - * - * @param {date} parameters.endTime The end time for the Azure reachability - * report. - * - * @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 {AzureReachabilityReport} - 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 AzureReachabilityReport} 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. - */ - beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, 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._beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); - } - } - - /** - * Lists all available internet service providers for a specified Azure region. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that scope the list of available - * providers. - * - * @param {array} [parameters.azureLocations] A list of Azure regions. - * - * @param {string} [parameters.country] The country for available providers - * list. - * - * @param {string} [parameters.state] The state for available providers list. - * - * @param {string} [parameters.city] The city or town for available providers - * list. - * - * @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. - */ - beginListAvailableProvidersWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginListAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all available internet service providers for a specified Azure region. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that scope the list of available - * providers. - * - * @param {array} [parameters.azureLocations] A list of Azure regions. - * - * @param {string} [parameters.country] The country for available providers - * list. - * - * @param {string} [parameters.state] The state for available providers list. - * - * @param {string} [parameters.city] The city or town for available providers - * list. - * - * @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 {AvailableProvidersList} - 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 AvailableProvidersList} 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. - */ - beginListAvailableProviders(resourceGroupName, networkWatcherName, parameters, 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._beginListAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginListAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); - } - } - - /** - * Get network configuration diagnostic. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters to get network configuration - * diagnostic. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform network configuration diagnostic. Valid options are VM, - * NetworkInterface, VMSS/NetworkInterface and Application Gateway. - * - * @param {string} [parameters.verbosityLevel] Verbosity level. Accepted values - * are 'Normal', 'Minimum', 'Full'. Possible values include: 'Normal', - * 'Minimum', 'Full' - * - * @param {array} parameters.profiles List of network configuration diagnostic - * profiles. - * - * @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. - */ - beginGetNetworkConfigurationDiagnosticWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginGetNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Get network configuration diagnostic. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters to get network configuration - * diagnostic. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform network configuration diagnostic. Valid options are VM, - * NetworkInterface, VMSS/NetworkInterface and Application Gateway. - * - * @param {string} [parameters.verbosityLevel] Verbosity level. Accepted values - * are 'Normal', 'Minimum', 'Full'. Possible values include: 'Normal', - * 'Minimum', 'Full' - * - * @param {array} parameters.profiles List of network configuration diagnostic - * profiles. - * - * @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 {NetworkConfigurationDiagnosticResponse} - 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 NetworkConfigurationDiagnosticResponse} 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. - */ - beginGetNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters, 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._beginGetNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginGetNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); - } - } - -} - -module.exports = NetworkWatchers; diff --git a/lib/services/networkManagement2/lib/operations/operations.js b/lib/services/networkManagement2/lib/operations/operations.js deleted file mode 100644 index 47a5471c2..000000000 --- a/lib/services/networkManagement2/lib/operations/operations.js +++ /dev/null @@ -1,447 +0,0 @@ -/* - * 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; - -/** - * Lists all of the available Network Rest API operations. - * - * @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 OperationListResult} 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(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-10-01'; - // Validate - try { - 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('/') ? '' : '/') + 'providers/Microsoft.Network/operations'; - 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['OperationListResult']().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); - }); -} - -/** - * Lists all of the available Network Rest API operations. - * - * @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 OperationListResult} 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['OperationListResult']().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 Operations. */ -class Operations { - /** - * Create a Operations. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._list = _list; - this._listNext = _listNext; - } - - /** - * Lists all of the available Network Rest API operations. - * - * @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(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all of the available Network Rest API operations. - * - * @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 {OperationListResult} - 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 OperationListResult} 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(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(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(options, optionalCallback); - } - } - - /** - * Lists all of the available Network Rest API operations. - * - * @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; - }); - }); - } - - /** - * Lists all of the available Network Rest API operations. - * - * @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 {OperationListResult} - 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 OperationListResult} 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 = Operations; diff --git a/lib/services/networkManagement2/lib/operations/p2sVpnGateways.js b/lib/services/networkManagement2/lib/operations/p2sVpnGateways.js deleted file mode 100644 index 51e93a72e..000000000 --- a/lib/services/networkManagement2/lib/operations/p2sVpnGateways.js +++ /dev/null @@ -1,3065 +0,0 @@ -/* - * 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; - -/** - * Retrieves the details of a virtual wan p2s vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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 P2SVpnGateway} 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, gatewayName, 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-10-01'; - // Validate - try { - 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 (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 (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { - throw new Error('gatewayName 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/p2svpnGateways/{gatewayName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['P2SVpnGateway']().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); - }); -} - - -/** - * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the - * existing gateway. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} p2SVpnGatewayParameters Parameters supplied to create or - * Update a virtual wan p2s vpn gateway. - * - * @param {object} [p2SVpnGatewayParameters.virtualHub] The VirtualHub to which - * the gateway belongs - * - * @param {string} [p2SVpnGatewayParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {number} [p2SVpnGatewayParameters.vpnGatewayScaleUnit] The scale unit - * for this p2s vpn gateway. - * - * @param {object} [p2SVpnGatewayParameters.p2SVpnServerConfiguration] The - * P2SVpnServerConfiguration to which the p2sVpnGateway is attached to. - * - * @param {string} [p2SVpnGatewayParameters.p2SVpnServerConfiguration.id] - * Resource ID. - * - * @param {object} [p2SVpnGatewayParameters.vpnClientAddressPool] The reference - * of the address space resource which represents Address space for P2S - * VpnClient. - * - * @param {array} - * [p2SVpnGatewayParameters.vpnClientAddressPool.addressPrefixes] A list of - * address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [p2SVpnGatewayParameters.id] Resource ID. - * - * @param {string} [p2SVpnGatewayParameters.location] Resource location. - * - * @param {object} [p2SVpnGatewayParameters.tags] Resource tags. - * - * @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 P2SVpnGateway} 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 _createOrUpdate(resourceGroupName, gatewayName, p2SVpnGatewayParameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, gatewayName, p2SVpnGatewayParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['P2SVpnGateway']().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); - }); - }); -} - - -/** - * Updates virtual wan p2s vpn gateway tags. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} p2SVpnGatewayParameters Parameters supplied to update a - * virtual wan p2s vpn gateway tags. - * - * @param {object} [p2SVpnGatewayParameters.tags] Resource tags. - * - * @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 P2SVpnGateway} 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 _updateTags(resourceGroupName, gatewayName, p2SVpnGatewayParameters, 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.'); - } - - // Send request - this.beginUpdateTags(resourceGroupName, gatewayName, p2SVpnGatewayParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['P2SVpnGateway']().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); - }); - }); -} - - -/** - * Deletes a virtual wan p2s vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, gatewayName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, gatewayName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Lists all the P2SVpnGateways in a resource group. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @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 ListP2SVpnGatewaysResult} 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 _listByResourceGroup(resourceGroupName, 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-10-01'; - // Validate - try { - 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 (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 (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/p2svpnGateways'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListP2SVpnGatewaysResult']().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); - }); -} - -/** - * Lists all the P2SVpnGateways in a subscription. - * - * @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 ListP2SVpnGatewaysResult} 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(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/p2svpnGateways'; - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListP2SVpnGatewaysResult']().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); - }); -} - - -/** - * Generates VPN profile for P2S client of the P2SVpnGateway in the specified - * resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} gatewayName The name of the P2SVpnGateway. - * - * @param {object} parameters Parameters supplied to the generate P2SVpnGateway - * VPN client package operation. - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @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 VpnProfileResponse} 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 _generateVpnProfile(resourceGroupName, gatewayName, parameters, 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.'); - } - - // Send request - this.beginGenerateVpnProfile(resourceGroupName, gatewayName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VpnProfileResponse']().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); - }); - }); -} - -/** - * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the - * existing gateway. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} p2SVpnGatewayParameters Parameters supplied to create or - * Update a virtual wan p2s vpn gateway. - * - * @param {object} [p2SVpnGatewayParameters.virtualHub] The VirtualHub to which - * the gateway belongs - * - * @param {string} [p2SVpnGatewayParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {number} [p2SVpnGatewayParameters.vpnGatewayScaleUnit] The scale unit - * for this p2s vpn gateway. - * - * @param {object} [p2SVpnGatewayParameters.p2SVpnServerConfiguration] The - * P2SVpnServerConfiguration to which the p2sVpnGateway is attached to. - * - * @param {string} [p2SVpnGatewayParameters.p2SVpnServerConfiguration.id] - * Resource ID. - * - * @param {object} [p2SVpnGatewayParameters.vpnClientAddressPool] The reference - * of the address space resource which represents Address space for P2S - * VpnClient. - * - * @param {array} - * [p2SVpnGatewayParameters.vpnClientAddressPool.addressPrefixes] A list of - * address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [p2SVpnGatewayParameters.id] Resource ID. - * - * @param {string} [p2SVpnGatewayParameters.location] Resource location. - * - * @param {object} [p2SVpnGatewayParameters.tags] Resource tags. - * - * @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 P2SVpnGateway} 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 _beginCreateOrUpdate(resourceGroupName, gatewayName, p2SVpnGatewayParameters, 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-10-01'; - // Validate - try { - 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 (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 (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { - throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); - } - if (p2SVpnGatewayParameters === null || p2SVpnGatewayParameters === undefined) { - throw new Error('p2SVpnGatewayParameters cannot be null or undefined.'); - } - 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/p2svpnGateways/{gatewayName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (p2SVpnGatewayParameters !== null && p2SVpnGatewayParameters !== undefined) { - let requestModelMapper = new client.models['P2SVpnGateway']().mapper(); - requestModel = client.serialize(requestModelMapper, p2SVpnGatewayParameters, 'p2SVpnGatewayParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(p2SVpnGatewayParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['P2SVpnGateway']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['P2SVpnGateway']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Updates virtual wan p2s vpn gateway tags. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} p2SVpnGatewayParameters Parameters supplied to update a - * virtual wan p2s vpn gateway tags. - * - * @param {object} [p2SVpnGatewayParameters.tags] Resource tags. - * - * @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 P2SVpnGateway} 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 _beginUpdateTags(resourceGroupName, gatewayName, p2SVpnGatewayParameters, 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-10-01'; - // Validate - try { - 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 (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 (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { - throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); - } - if (p2SVpnGatewayParameters === null || p2SVpnGatewayParameters === undefined) { - throw new Error('p2SVpnGatewayParameters cannot be null or undefined.'); - } - 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/p2svpnGateways/{gatewayName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); - 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 = 'PATCH'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (p2SVpnGatewayParameters !== null && p2SVpnGatewayParameters !== undefined) { - let requestModelMapper = new client.models['TagsObject']().mapper(); - requestModel = client.serialize(requestModelMapper, p2SVpnGatewayParameters, 'p2SVpnGatewayParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(p2SVpnGatewayParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['P2SVpnGateway']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['P2SVpnGateway']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Deletes a virtual wan p2s vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, gatewayName, 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-10-01'; - // Validate - try { - 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 (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 (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { - throw new Error('gatewayName 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/p2svpnGateways/{gatewayName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Generates VPN profile for P2S client of the P2SVpnGateway in the specified - * resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} gatewayName The name of the P2SVpnGateway. - * - * @param {object} parameters Parameters supplied to the generate P2SVpnGateway - * VPN client package operation. - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @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 VpnProfileResponse} 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 _beginGenerateVpnProfile(resourceGroupName, gatewayName, parameters, 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-10-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 (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { - throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/p2svpnGateways/{gatewayName}/generatevpnprofile'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); - 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 = 'POST'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['P2SVpnProfileParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { - 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['VpnProfileResponse']().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); - }); -} - -/** - * Lists all the P2SVpnGateways in a resource group. - * - * @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 ListP2SVpnGatewaysResult} 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 _listByResourceGroupNext(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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListP2SVpnGatewaysResult']().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); - }); -} - -/** - * Lists all the P2SVpnGateways in a subscription. - * - * @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 ListP2SVpnGatewaysResult} 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListP2SVpnGatewaysResult']().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 P2sVpnGateways. */ -class P2sVpnGateways { - /** - * Create a P2sVpnGateways. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._updateTags = _updateTags; - this._deleteMethod = _deleteMethod; - this._listByResourceGroup = _listByResourceGroup; - this._list = _list; - this._generateVpnProfile = _generateVpnProfile; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdateTags = _beginUpdateTags; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginGenerateVpnProfile = _beginGenerateVpnProfile; - this._listByResourceGroupNext = _listByResourceGroupNext; - this._listNext = _listNext; - } - - /** - * Retrieves the details of a virtual wan p2s vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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, gatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, gatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves the details of a virtual wan p2s vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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 {P2SVpnGateway} - 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 P2SVpnGateway} 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, gatewayName, 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, gatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, gatewayName, options, optionalCallback); - } - } - - /** - * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the - * existing gateway. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} p2SVpnGatewayParameters Parameters supplied to create or - * Update a virtual wan p2s vpn gateway. - * - * @param {object} [p2SVpnGatewayParameters.virtualHub] The VirtualHub to which - * the gateway belongs - * - * @param {string} [p2SVpnGatewayParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {number} [p2SVpnGatewayParameters.vpnGatewayScaleUnit] The scale unit - * for this p2s vpn gateway. - * - * @param {object} [p2SVpnGatewayParameters.p2SVpnServerConfiguration] The - * P2SVpnServerConfiguration to which the p2sVpnGateway is attached to. - * - * @param {string} [p2SVpnGatewayParameters.p2SVpnServerConfiguration.id] - * Resource ID. - * - * @param {object} [p2SVpnGatewayParameters.vpnClientAddressPool] The reference - * of the address space resource which represents Address space for P2S - * VpnClient. - * - * @param {array} - * [p2SVpnGatewayParameters.vpnClientAddressPool.addressPrefixes] A list of - * address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [p2SVpnGatewayParameters.id] Resource ID. - * - * @param {string} [p2SVpnGatewayParameters.location] Resource location. - * - * @param {object} [p2SVpnGatewayParameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, gatewayName, p2SVpnGatewayParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, gatewayName, p2SVpnGatewayParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the - * existing gateway. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} p2SVpnGatewayParameters Parameters supplied to create or - * Update a virtual wan p2s vpn gateway. - * - * @param {object} [p2SVpnGatewayParameters.virtualHub] The VirtualHub to which - * the gateway belongs - * - * @param {string} [p2SVpnGatewayParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {number} [p2SVpnGatewayParameters.vpnGatewayScaleUnit] The scale unit - * for this p2s vpn gateway. - * - * @param {object} [p2SVpnGatewayParameters.p2SVpnServerConfiguration] The - * P2SVpnServerConfiguration to which the p2sVpnGateway is attached to. - * - * @param {string} [p2SVpnGatewayParameters.p2SVpnServerConfiguration.id] - * Resource ID. - * - * @param {object} [p2SVpnGatewayParameters.vpnClientAddressPool] The reference - * of the address space resource which represents Address space for P2S - * VpnClient. - * - * @param {array} - * [p2SVpnGatewayParameters.vpnClientAddressPool.addressPrefixes] A list of - * address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [p2SVpnGatewayParameters.id] Resource ID. - * - * @param {string} [p2SVpnGatewayParameters.location] Resource location. - * - * @param {object} [p2SVpnGatewayParameters.tags] Resource tags. - * - * @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 {P2SVpnGateway} - 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 P2SVpnGateway} 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. - */ - createOrUpdate(resourceGroupName, gatewayName, p2SVpnGatewayParameters, 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._createOrUpdate(resourceGroupName, gatewayName, p2SVpnGatewayParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, gatewayName, p2SVpnGatewayParameters, options, optionalCallback); - } - } - - /** - * Updates virtual wan p2s vpn gateway tags. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} p2SVpnGatewayParameters Parameters supplied to update a - * virtual wan p2s vpn gateway tags. - * - * @param {object} [p2SVpnGatewayParameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName, gatewayName, p2SVpnGatewayParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateTags(resourceGroupName, gatewayName, p2SVpnGatewayParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates virtual wan p2s vpn gateway tags. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} p2SVpnGatewayParameters Parameters supplied to update a - * virtual wan p2s vpn gateway tags. - * - * @param {object} [p2SVpnGatewayParameters.tags] Resource tags. - * - * @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 {P2SVpnGateway} - 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 P2SVpnGateway} 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. - */ - updateTags(resourceGroupName, gatewayName, p2SVpnGatewayParameters, 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._updateTags(resourceGroupName, gatewayName, p2SVpnGatewayParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateTags(resourceGroupName, gatewayName, p2SVpnGatewayParameters, options, optionalCallback); - } - } - - /** - * Deletes a virtual wan p2s vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, gatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, gatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes a virtual wan p2s vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, gatewayName, 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._deleteMethod(resourceGroupName, gatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, gatewayName, options, optionalCallback); - } - } - - /** - * Lists all the P2SVpnGateways in a resource group. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all the P2SVpnGateways in a resource group. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @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 {ListP2SVpnGatewaysResult} - 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 ListP2SVpnGatewaysResult} 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. - */ - listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroup(resourceGroupName, options, optionalCallback); - } - } - - /** - * Lists all the P2SVpnGateways in a subscription. - * - * @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(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all the P2SVpnGateways in a subscription. - * - * @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 {ListP2SVpnGatewaysResult} - 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 ListP2SVpnGatewaysResult} 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(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(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(options, optionalCallback); - } - } - - /** - * Generates VPN profile for P2S client of the P2SVpnGateway in the specified - * resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} gatewayName The name of the P2SVpnGateway. - * - * @param {object} parameters Parameters supplied to the generate P2SVpnGateway - * VPN client package operation. - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @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. - */ - generateVpnProfileWithHttpOperationResponse(resourceGroupName, gatewayName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._generateVpnProfile(resourceGroupName, gatewayName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Generates VPN profile for P2S client of the P2SVpnGateway in the specified - * resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} gatewayName The name of the P2SVpnGateway. - * - * @param {object} parameters Parameters supplied to the generate P2SVpnGateway - * VPN client package operation. - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @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 {VpnProfileResponse} - 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 VpnProfileResponse} 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. - */ - generateVpnProfile(resourceGroupName, gatewayName, parameters, 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._generateVpnProfile(resourceGroupName, gatewayName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._generateVpnProfile(resourceGroupName, gatewayName, parameters, options, optionalCallback); - } - } - - /** - * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the - * existing gateway. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} p2SVpnGatewayParameters Parameters supplied to create or - * Update a virtual wan p2s vpn gateway. - * - * @param {object} [p2SVpnGatewayParameters.virtualHub] The VirtualHub to which - * the gateway belongs - * - * @param {string} [p2SVpnGatewayParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {number} [p2SVpnGatewayParameters.vpnGatewayScaleUnit] The scale unit - * for this p2s vpn gateway. - * - * @param {object} [p2SVpnGatewayParameters.p2SVpnServerConfiguration] The - * P2SVpnServerConfiguration to which the p2sVpnGateway is attached to. - * - * @param {string} [p2SVpnGatewayParameters.p2SVpnServerConfiguration.id] - * Resource ID. - * - * @param {object} [p2SVpnGatewayParameters.vpnClientAddressPool] The reference - * of the address space resource which represents Address space for P2S - * VpnClient. - * - * @param {array} - * [p2SVpnGatewayParameters.vpnClientAddressPool.addressPrefixes] A list of - * address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [p2SVpnGatewayParameters.id] Resource ID. - * - * @param {string} [p2SVpnGatewayParameters.location] Resource location. - * - * @param {object} [p2SVpnGatewayParameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, gatewayName, p2SVpnGatewayParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, gatewayName, p2SVpnGatewayParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates a virtual wan p2s vpn gateway if it doesn't exist else updates the - * existing gateway. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} p2SVpnGatewayParameters Parameters supplied to create or - * Update a virtual wan p2s vpn gateway. - * - * @param {object} [p2SVpnGatewayParameters.virtualHub] The VirtualHub to which - * the gateway belongs - * - * @param {string} [p2SVpnGatewayParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {number} [p2SVpnGatewayParameters.vpnGatewayScaleUnit] The scale unit - * for this p2s vpn gateway. - * - * @param {object} [p2SVpnGatewayParameters.p2SVpnServerConfiguration] The - * P2SVpnServerConfiguration to which the p2sVpnGateway is attached to. - * - * @param {string} [p2SVpnGatewayParameters.p2SVpnServerConfiguration.id] - * Resource ID. - * - * @param {object} [p2SVpnGatewayParameters.vpnClientAddressPool] The reference - * of the address space resource which represents Address space for P2S - * VpnClient. - * - * @param {array} - * [p2SVpnGatewayParameters.vpnClientAddressPool.addressPrefixes] A list of - * address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [p2SVpnGatewayParameters.id] Resource ID. - * - * @param {string} [p2SVpnGatewayParameters.location] Resource location. - * - * @param {object} [p2SVpnGatewayParameters.tags] Resource tags. - * - * @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 {P2SVpnGateway} - 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 P2SVpnGateway} 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. - */ - beginCreateOrUpdate(resourceGroupName, gatewayName, p2SVpnGatewayParameters, 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._beginCreateOrUpdate(resourceGroupName, gatewayName, p2SVpnGatewayParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, gatewayName, p2SVpnGatewayParameters, options, optionalCallback); - } - } - - /** - * Updates virtual wan p2s vpn gateway tags. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} p2SVpnGatewayParameters Parameters supplied to update a - * virtual wan p2s vpn gateway tags. - * - * @param {object} [p2SVpnGatewayParameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName, gatewayName, p2SVpnGatewayParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginUpdateTags(resourceGroupName, gatewayName, p2SVpnGatewayParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates virtual wan p2s vpn gateway tags. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} p2SVpnGatewayParameters Parameters supplied to update a - * virtual wan p2s vpn gateway tags. - * - * @param {object} [p2SVpnGatewayParameters.tags] Resource tags. - * - * @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 {P2SVpnGateway} - 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 P2SVpnGateway} 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. - */ - beginUpdateTags(resourceGroupName, gatewayName, p2SVpnGatewayParameters, 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._beginUpdateTags(resourceGroupName, gatewayName, p2SVpnGatewayParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginUpdateTags(resourceGroupName, gatewayName, p2SVpnGatewayParameters, options, optionalCallback); - } - } - - /** - * Deletes a virtual wan p2s vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, gatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, gatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes a virtual wan p2s vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, gatewayName, 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._beginDeleteMethod(resourceGroupName, gatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, gatewayName, options, optionalCallback); - } - } - - /** - * Generates VPN profile for P2S client of the P2SVpnGateway in the specified - * resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} gatewayName The name of the P2SVpnGateway. - * - * @param {object} parameters Parameters supplied to the generate P2SVpnGateway - * VPN client package operation. - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @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. - */ - beginGenerateVpnProfileWithHttpOperationResponse(resourceGroupName, gatewayName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginGenerateVpnProfile(resourceGroupName, gatewayName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Generates VPN profile for P2S client of the P2SVpnGateway in the specified - * resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} gatewayName The name of the P2SVpnGateway. - * - * @param {object} parameters Parameters supplied to the generate P2SVpnGateway - * VPN client package operation. - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @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 {VpnProfileResponse} - 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 VpnProfileResponse} 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. - */ - beginGenerateVpnProfile(resourceGroupName, gatewayName, parameters, 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._beginGenerateVpnProfile(resourceGroupName, gatewayName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginGenerateVpnProfile(resourceGroupName, gatewayName, parameters, options, optionalCallback); - } - } - - /** - * Lists all the P2SVpnGateways in a resource group. - * - * @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. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all the P2SVpnGateways in a resource group. - * - * @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 {ListP2SVpnGatewaysResult} - 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 ListP2SVpnGatewaysResult} 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. - */ - listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); - } - } - - /** - * Lists all the P2SVpnGateways in a subscription. - * - * @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; - }); - }); - } - - /** - * Lists all the P2SVpnGateways in a subscription. - * - * @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 {ListP2SVpnGatewaysResult} - 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 ListP2SVpnGatewaysResult} 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 = P2sVpnGateways; diff --git a/lib/services/networkManagement2/lib/operations/p2sVpnServerConfigurations.js b/lib/services/networkManagement2/lib/operations/p2sVpnServerConfigurations.js deleted file mode 100644 index 256005dfc..000000000 --- a/lib/services/networkManagement2/lib/operations/p2sVpnServerConfigurations.js +++ /dev/null @@ -1,1871 +0,0 @@ -/* - * 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; - -/** - * Retrieves the details of a P2SVpnServerConfiguration. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnServerConfiguration. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @param {string} p2SVpnServerConfigurationName The name of the - * P2SVpnServerConfiguration. - * - * @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 P2SVpnServerConfiguration} 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, virtualWanName, p2SVpnServerConfigurationName, 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-10-01'; - // Validate - try { - 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 (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 (virtualWanName === null || virtualWanName === undefined || typeof virtualWanName.valueOf() !== 'string') { - throw new Error('virtualWanName cannot be null or undefined and it must be of type string.'); - } - if (p2SVpnServerConfigurationName === null || p2SVpnServerConfigurationName === undefined || typeof p2SVpnServerConfigurationName.valueOf() !== 'string') { - throw new Error('p2SVpnServerConfigurationName 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/virtualWans/{virtualWanName}/p2sVpnServerConfigurations/{p2SVpnServerConfigurationName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualWanName}', encodeURIComponent(virtualWanName)); - requestUrl = requestUrl.replace('{p2SVpnServerConfigurationName}', encodeURIComponent(p2SVpnServerConfigurationName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['P2SVpnServerConfiguration']().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); - }); -} - - -/** - * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it - * doesn't exist else updates the existing P2SVpnServerConfiguration. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @param {string} p2SVpnServerConfigurationName The name of the - * P2SVpnServerConfiguration. - * - * @param {object} p2SVpnServerConfigurationParameters Parameters supplied to - * create or Update a P2SVpnServerConfiguration. - * - * @param {string} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigurationPropertiesName] - * The name of the P2SVpnServerConfiguration that is unique within a VirtualWan - * in a resource group. This name can be used to access the resource along with - * Paren VirtualWan resource name. - * - * @param {array} [p2SVpnServerConfigurationParameters.vpnProtocols] - * vpnProtocols for the P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigVpnClientRootCertificates] - * VPN client root certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigVpnClientRevokedCertificates] - * VPN client revoked certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigRadiusServerRootCertificates] - * Radius Server root certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigRadiusClientRootCertificates] - * Radius client root certificate of P2SVpnServerConfiguration. - * - * @param {array} [p2SVpnServerConfigurationParameters.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for P2SVpnServerConfiguration. - * - * @param {string} [p2SVpnServerConfigurationParameters.radiusServerAddress] - * The radius server address property of the P2SVpnServerConfiguration resource - * for point to site client connection. - * - * @param {string} [p2SVpnServerConfigurationParameters.radiusServerSecret] The - * radius secret property of the P2SVpnServerConfiguration resource for for - * point to site client connection. - * - * @param {string} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigurationPropertiesEtag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} [p2SVpnServerConfigurationParameters.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [p2SVpnServerConfigurationParameters.id] Resource ID. - * - * @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 P2SVpnServerConfiguration} 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 _createOrUpdate(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['P2SVpnServerConfiguration']().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); - }); - }); -} - - -/** - * Deletes a P2SVpnServerConfiguration. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnServerConfiguration. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @param {string} p2SVpnServerConfigurationName The name of the - * P2SVpnServerConfiguration. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @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 ListP2SVpnServerConfigurationsResult} 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 _listByVirtualWan(resourceGroupName, virtualWanName, 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-10-01'; - // Validate - try { - 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 (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 (virtualWanName === null || virtualWanName === undefined || typeof virtualWanName.valueOf() !== 'string') { - throw new Error('virtualWanName 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/virtualWans/{virtualWanName}/p2sVpnServerConfigurations'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualWanName}', encodeURIComponent(virtualWanName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListP2SVpnServerConfigurationsResult']().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); - }); -} - -/** - * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it - * doesn't exist else updates the existing P2SVpnServerConfiguration. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @param {string} p2SVpnServerConfigurationName The name of the - * P2SVpnServerConfiguration. - * - * @param {object} p2SVpnServerConfigurationParameters Parameters supplied to - * create or Update a P2SVpnServerConfiguration. - * - * @param {string} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigurationPropertiesName] - * The name of the P2SVpnServerConfiguration that is unique within a VirtualWan - * in a resource group. This name can be used to access the resource along with - * Paren VirtualWan resource name. - * - * @param {array} [p2SVpnServerConfigurationParameters.vpnProtocols] - * vpnProtocols for the P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigVpnClientRootCertificates] - * VPN client root certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigVpnClientRevokedCertificates] - * VPN client revoked certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigRadiusServerRootCertificates] - * Radius Server root certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigRadiusClientRootCertificates] - * Radius client root certificate of P2SVpnServerConfiguration. - * - * @param {array} [p2SVpnServerConfigurationParameters.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for P2SVpnServerConfiguration. - * - * @param {string} [p2SVpnServerConfigurationParameters.radiusServerAddress] - * The radius server address property of the P2SVpnServerConfiguration resource - * for point to site client connection. - * - * @param {string} [p2SVpnServerConfigurationParameters.radiusServerSecret] The - * radius secret property of the P2SVpnServerConfiguration resource for for - * point to site client connection. - * - * @param {string} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigurationPropertiesEtag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} [p2SVpnServerConfigurationParameters.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [p2SVpnServerConfigurationParameters.id] Resource ID. - * - * @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 P2SVpnServerConfiguration} 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 _beginCreateOrUpdate(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters, 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-10-01'; - // Validate - try { - 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 (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 (virtualWanName === null || virtualWanName === undefined || typeof virtualWanName.valueOf() !== 'string') { - throw new Error('virtualWanName cannot be null or undefined and it must be of type string.'); - } - if (p2SVpnServerConfigurationName === null || p2SVpnServerConfigurationName === undefined || typeof p2SVpnServerConfigurationName.valueOf() !== 'string') { - throw new Error('p2SVpnServerConfigurationName cannot be null or undefined and it must be of type string.'); - } - if (p2SVpnServerConfigurationParameters === null || p2SVpnServerConfigurationParameters === undefined) { - throw new Error('p2SVpnServerConfigurationParameters cannot be null or undefined.'); - } - 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/virtualWans/{virtualWanName}/p2sVpnServerConfigurations/{p2SVpnServerConfigurationName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualWanName}', encodeURIComponent(virtualWanName)); - requestUrl = requestUrl.replace('{p2SVpnServerConfigurationName}', encodeURIComponent(p2SVpnServerConfigurationName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (p2SVpnServerConfigurationParameters !== null && p2SVpnServerConfigurationParameters !== undefined) { - let requestModelMapper = new client.models['P2SVpnServerConfiguration']().mapper(); - requestModel = client.serialize(requestModelMapper, p2SVpnServerConfigurationParameters, 'p2SVpnServerConfigurationParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(p2SVpnServerConfigurationParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['P2SVpnServerConfiguration']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['P2SVpnServerConfiguration']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Deletes a P2SVpnServerConfiguration. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnServerConfiguration. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @param {string} p2SVpnServerConfigurationName The name of the - * P2SVpnServerConfiguration. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, 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-10-01'; - // Validate - try { - 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 (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 (virtualWanName === null || virtualWanName === undefined || typeof virtualWanName.valueOf() !== 'string') { - throw new Error('virtualWanName cannot be null or undefined and it must be of type string.'); - } - if (p2SVpnServerConfigurationName === null || p2SVpnServerConfigurationName === undefined || typeof p2SVpnServerConfigurationName.valueOf() !== 'string') { - throw new Error('p2SVpnServerConfigurationName 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/virtualWans/{virtualWanName}/p2sVpnServerConfigurations/{p2SVpnServerConfigurationName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualWanName}', encodeURIComponent(virtualWanName)); - requestUrl = requestUrl.replace('{p2SVpnServerConfigurationName}', encodeURIComponent(p2SVpnServerConfigurationName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. - * - * @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 ListP2SVpnServerConfigurationsResult} 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 _listByVirtualWanNext(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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListP2SVpnServerConfigurationsResult']().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 P2sVpnServerConfigurations. */ -class P2sVpnServerConfigurations { - /** - * Create a P2sVpnServerConfigurations. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._deleteMethod = _deleteMethod; - this._listByVirtualWan = _listByVirtualWan; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginDeleteMethod = _beginDeleteMethod; - this._listByVirtualWanNext = _listByVirtualWanNext; - } - - /** - * Retrieves the details of a P2SVpnServerConfiguration. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnServerConfiguration. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @param {string} p2SVpnServerConfigurationName The name of the - * P2SVpnServerConfiguration. - * - * @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, virtualWanName, p2SVpnServerConfigurationName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves the details of a P2SVpnServerConfiguration. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnServerConfiguration. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @param {string} p2SVpnServerConfigurationName The name of the - * P2SVpnServerConfiguration. - * - * @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 {P2SVpnServerConfiguration} - 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 P2SVpnServerConfiguration} 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, virtualWanName, p2SVpnServerConfigurationName, 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, virtualWanName, p2SVpnServerConfigurationName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, options, optionalCallback); - } - } - - /** - * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it - * doesn't exist else updates the existing P2SVpnServerConfiguration. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @param {string} p2SVpnServerConfigurationName The name of the - * P2SVpnServerConfiguration. - * - * @param {object} p2SVpnServerConfigurationParameters Parameters supplied to - * create or Update a P2SVpnServerConfiguration. - * - * @param {string} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigurationPropertiesName] - * The name of the P2SVpnServerConfiguration that is unique within a VirtualWan - * in a resource group. This name can be used to access the resource along with - * Paren VirtualWan resource name. - * - * @param {array} [p2SVpnServerConfigurationParameters.vpnProtocols] - * vpnProtocols for the P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigVpnClientRootCertificates] - * VPN client root certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigVpnClientRevokedCertificates] - * VPN client revoked certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigRadiusServerRootCertificates] - * Radius Server root certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigRadiusClientRootCertificates] - * Radius client root certificate of P2SVpnServerConfiguration. - * - * @param {array} [p2SVpnServerConfigurationParameters.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for P2SVpnServerConfiguration. - * - * @param {string} [p2SVpnServerConfigurationParameters.radiusServerAddress] - * The radius server address property of the P2SVpnServerConfiguration resource - * for point to site client connection. - * - * @param {string} [p2SVpnServerConfigurationParameters.radiusServerSecret] The - * radius secret property of the P2SVpnServerConfiguration resource for for - * point to site client connection. - * - * @param {string} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigurationPropertiesEtag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} [p2SVpnServerConfigurationParameters.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [p2SVpnServerConfigurationParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it - * doesn't exist else updates the existing P2SVpnServerConfiguration. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @param {string} p2SVpnServerConfigurationName The name of the - * P2SVpnServerConfiguration. - * - * @param {object} p2SVpnServerConfigurationParameters Parameters supplied to - * create or Update a P2SVpnServerConfiguration. - * - * @param {string} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigurationPropertiesName] - * The name of the P2SVpnServerConfiguration that is unique within a VirtualWan - * in a resource group. This name can be used to access the resource along with - * Paren VirtualWan resource name. - * - * @param {array} [p2SVpnServerConfigurationParameters.vpnProtocols] - * vpnProtocols for the P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigVpnClientRootCertificates] - * VPN client root certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigVpnClientRevokedCertificates] - * VPN client revoked certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigRadiusServerRootCertificates] - * Radius Server root certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigRadiusClientRootCertificates] - * Radius client root certificate of P2SVpnServerConfiguration. - * - * @param {array} [p2SVpnServerConfigurationParameters.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for P2SVpnServerConfiguration. - * - * @param {string} [p2SVpnServerConfigurationParameters.radiusServerAddress] - * The radius server address property of the P2SVpnServerConfiguration resource - * for point to site client connection. - * - * @param {string} [p2SVpnServerConfigurationParameters.radiusServerSecret] The - * radius secret property of the P2SVpnServerConfiguration resource for for - * point to site client connection. - * - * @param {string} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigurationPropertiesEtag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} [p2SVpnServerConfigurationParameters.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [p2SVpnServerConfigurationParameters.id] Resource ID. - * - * @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 {P2SVpnServerConfiguration} - 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 P2SVpnServerConfiguration} 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. - */ - createOrUpdate(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters, 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._createOrUpdate(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters, options, optionalCallback); - } - } - - /** - * Deletes a P2SVpnServerConfiguration. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnServerConfiguration. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @param {string} p2SVpnServerConfigurationName The name of the - * P2SVpnServerConfiguration. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes a P2SVpnServerConfiguration. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnServerConfiguration. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @param {string} p2SVpnServerConfigurationName The name of the - * P2SVpnServerConfiguration. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, 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._deleteMethod(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, options, optionalCallback); - } - } - - /** - * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @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. - */ - listByVirtualWanWithHttpOperationResponse(resourceGroupName, virtualWanName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByVirtualWan(resourceGroupName, virtualWanName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @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 {ListP2SVpnServerConfigurationsResult} - 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 ListP2SVpnServerConfigurationsResult} 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. - */ - listByVirtualWan(resourceGroupName, virtualWanName, 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._listByVirtualWan(resourceGroupName, virtualWanName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByVirtualWan(resourceGroupName, virtualWanName, options, optionalCallback); - } - } - - /** - * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it - * doesn't exist else updates the existing P2SVpnServerConfiguration. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @param {string} p2SVpnServerConfigurationName The name of the - * P2SVpnServerConfiguration. - * - * @param {object} p2SVpnServerConfigurationParameters Parameters supplied to - * create or Update a P2SVpnServerConfiguration. - * - * @param {string} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigurationPropertiesName] - * The name of the P2SVpnServerConfiguration that is unique within a VirtualWan - * in a resource group. This name can be used to access the resource along with - * Paren VirtualWan resource name. - * - * @param {array} [p2SVpnServerConfigurationParameters.vpnProtocols] - * vpnProtocols for the P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigVpnClientRootCertificates] - * VPN client root certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigVpnClientRevokedCertificates] - * VPN client revoked certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigRadiusServerRootCertificates] - * Radius Server root certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigRadiusClientRootCertificates] - * Radius client root certificate of P2SVpnServerConfiguration. - * - * @param {array} [p2SVpnServerConfigurationParameters.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for P2SVpnServerConfiguration. - * - * @param {string} [p2SVpnServerConfigurationParameters.radiusServerAddress] - * The radius server address property of the P2SVpnServerConfiguration resource - * for point to site client connection. - * - * @param {string} [p2SVpnServerConfigurationParameters.radiusServerSecret] The - * radius secret property of the P2SVpnServerConfiguration resource for for - * point to site client connection. - * - * @param {string} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigurationPropertiesEtag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} [p2SVpnServerConfigurationParameters.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [p2SVpnServerConfigurationParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it - * doesn't exist else updates the existing P2SVpnServerConfiguration. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @param {string} p2SVpnServerConfigurationName The name of the - * P2SVpnServerConfiguration. - * - * @param {object} p2SVpnServerConfigurationParameters Parameters supplied to - * create or Update a P2SVpnServerConfiguration. - * - * @param {string} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigurationPropertiesName] - * The name of the P2SVpnServerConfiguration that is unique within a VirtualWan - * in a resource group. This name can be used to access the resource along with - * Paren VirtualWan resource name. - * - * @param {array} [p2SVpnServerConfigurationParameters.vpnProtocols] - * vpnProtocols for the P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigVpnClientRootCertificates] - * VPN client root certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigVpnClientRevokedCertificates] - * VPN client revoked certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigRadiusServerRootCertificates] - * Radius Server root certificate of P2SVpnServerConfiguration. - * - * @param {array} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigRadiusClientRootCertificates] - * Radius client root certificate of P2SVpnServerConfiguration. - * - * @param {array} [p2SVpnServerConfigurationParameters.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for P2SVpnServerConfiguration. - * - * @param {string} [p2SVpnServerConfigurationParameters.radiusServerAddress] - * The radius server address property of the P2SVpnServerConfiguration resource - * for point to site client connection. - * - * @param {string} [p2SVpnServerConfigurationParameters.radiusServerSecret] The - * radius secret property of the P2SVpnServerConfiguration resource for for - * point to site client connection. - * - * @param {string} - * [p2SVpnServerConfigurationParameters.p2SVpnServerConfigurationPropertiesEtag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} [p2SVpnServerConfigurationParameters.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [p2SVpnServerConfigurationParameters.id] Resource ID. - * - * @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 {P2SVpnServerConfiguration} - 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 P2SVpnServerConfiguration} 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. - */ - beginCreateOrUpdate(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters, 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._beginCreateOrUpdate(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, p2SVpnServerConfigurationParameters, options, optionalCallback); - } - } - - /** - * Deletes a P2SVpnServerConfiguration. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnServerConfiguration. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @param {string} p2SVpnServerConfigurationName The name of the - * P2SVpnServerConfiguration. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes a P2SVpnServerConfiguration. - * - * @param {string} resourceGroupName The resource group name of the - * P2SVpnServerConfiguration. - * - * @param {string} virtualWanName The name of the VirtualWan. - * - * @param {string} p2SVpnServerConfigurationName The name of the - * P2SVpnServerConfiguration. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, 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._beginDeleteMethod(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, virtualWanName, p2SVpnServerConfigurationName, options, optionalCallback); - } - } - - /** - * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. - * - * @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. - */ - listByVirtualWanNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByVirtualWanNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all P2SVpnServerConfigurations for a particular VirtualWan. - * - * @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 {ListP2SVpnServerConfigurationsResult} - 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 ListP2SVpnServerConfigurationsResult} 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. - */ - listByVirtualWanNext(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._listByVirtualWanNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByVirtualWanNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = P2sVpnServerConfigurations; diff --git a/lib/services/networkManagement2/lib/operations/packetCaptures.js b/lib/services/networkManagement2/lib/operations/packetCaptures.js deleted file mode 100644 index 7a12dfc8d..000000000 --- a/lib/services/networkManagement2/lib/operations/packetCaptures.js +++ /dev/null @@ -1,2317 +0,0 @@ -/* - * 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; - - -/** - * Create and start a packet capture on the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @param {object} parameters Parameters that define the create packet capture - * operation. - * - * @param {string} parameters.target The ID of the targeted resource, only VM - * is currently supported. - * - * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes - * captured per packet, the remaining bytes are truncated. - * - * @param {number} [parameters.totalBytesPerSession] Maximum size of the - * capture output. - * - * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the - * capture session in seconds. - * - * @param {object} parameters.storageLocation - * - * @param {string} [parameters.storageLocation.storageId] The ID of the storage - * account to save the packet capture session. Required if no local file path - * is provided. - * - * @param {string} [parameters.storageLocation.storagePath] The URI of the - * storage path to save the packet capture. Must be a well-formed URI - * describing the location to save the packet capture. - * - * @param {string} [parameters.storageLocation.filePath] A valid local path on - * the targeting VM. Must include the name of the capture file (*.cap). For - * linux virtual machine it must start with /var/captures. Required if no - * storage ID is provided, otherwise optional. - * - * @param {array} [parameters.filters] - * - * @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 PacketCaptureResult} 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 _create(resourceGroupName, networkWatcherName, packetCaptureName, parameters, 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.'); - } - - // Send request - this.beginCreate(resourceGroupName, networkWatcherName, packetCaptureName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PacketCaptureResult']().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 a packet capture session by name. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @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 PacketCaptureResult} 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, networkWatcherName, packetCaptureName, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); - } - if (packetCaptureName === null || packetCaptureName === undefined || typeof packetCaptureName.valueOf() !== 'string') { - throw new Error('packetCaptureName 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/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - requestUrl = requestUrl.replace('{packetCaptureName}', encodeURIComponent(packetCaptureName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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['PacketCaptureResult']().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); - }); -} - - -/** - * Deletes the specified packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, networkWatcherName, packetCaptureName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * Stops a specified packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _stop(resourceGroupName, networkWatcherName, packetCaptureName, 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.'); - } - - // Send request - this.beginStop(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * Query the status of a running packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} packetCaptureName The name given to the packet capture - * session. - * - * @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 PacketCaptureQueryStatusResult} 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 _getStatus(resourceGroupName, networkWatcherName, packetCaptureName, 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.'); - } - - // Send request - this.beginGetStatus(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PacketCaptureQueryStatusResult']().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); - }); - }); -} - -/** - * Lists all packet capture sessions within the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @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 PacketCaptureListResult} 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, networkWatcherName, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName 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/networkWatchers/{networkWatcherName}/packetCaptures'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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['PacketCaptureListResult']().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); - }); -} - -/** - * Create and start a packet capture on the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @param {object} parameters Parameters that define the create packet capture - * operation. - * - * @param {string} parameters.target The ID of the targeted resource, only VM - * is currently supported. - * - * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes - * captured per packet, the remaining bytes are truncated. - * - * @param {number} [parameters.totalBytesPerSession] Maximum size of the - * capture output. - * - * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the - * capture session in seconds. - * - * @param {object} parameters.storageLocation - * - * @param {string} [parameters.storageLocation.storageId] The ID of the storage - * account to save the packet capture session. Required if no local file path - * is provided. - * - * @param {string} [parameters.storageLocation.storagePath] The URI of the - * storage path to save the packet capture. Must be a well-formed URI - * describing the location to save the packet capture. - * - * @param {string} [parameters.storageLocation.filePath] A valid local path on - * the targeting VM. Must include the name of the capture file (*.cap). For - * linux virtual machine it must start with /var/captures. Required if no - * storage ID is provided, otherwise optional. - * - * @param {array} [parameters.filters] - * - * @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 PacketCaptureResult} 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 _beginCreate(resourceGroupName, networkWatcherName, packetCaptureName, parameters, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); - } - if (packetCaptureName === null || packetCaptureName === undefined || typeof packetCaptureName.valueOf() !== 'string') { - throw new Error('packetCaptureName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - requestUrl = requestUrl.replace('{packetCaptureName}', encodeURIComponent(packetCaptureName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['PacketCapture']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 201) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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 === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PacketCaptureResult']().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); - }); -} - -/** - * Deletes the specified packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, networkWatcherName, packetCaptureName, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); - } - if (packetCaptureName === null || packetCaptureName === undefined || typeof packetCaptureName.valueOf() !== 'string') { - throw new Error('packetCaptureName 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/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - requestUrl = requestUrl.replace('{packetCaptureName}', encodeURIComponent(packetCaptureName)); - 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 = 'DELETE'; - 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 !== 202 && statusCode !== 204) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Stops a specified packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginStop(resourceGroupName, networkWatcherName, packetCaptureName, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); - } - if (packetCaptureName === null || packetCaptureName === undefined || typeof packetCaptureName.valueOf() !== 'string') { - throw new Error('packetCaptureName 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/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - requestUrl = requestUrl.replace('{packetCaptureName}', encodeURIComponent(packetCaptureName)); - 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 = 'POST'; - 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 && statusCode !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Query the status of a running packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} packetCaptureName The name given to the packet capture - * session. - * - * @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 PacketCaptureQueryStatusResult} 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 _beginGetStatus(resourceGroupName, networkWatcherName, packetCaptureName, 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-10-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 (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { - throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); - } - if (packetCaptureName === null || packetCaptureName === undefined || typeof packetCaptureName.valueOf() !== 'string') { - throw new Error('packetCaptureName 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/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); - requestUrl = requestUrl.replace('{packetCaptureName}', encodeURIComponent(packetCaptureName)); - 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 = 'POST'; - 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 && statusCode !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().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['PacketCaptureQueryStatusResult']().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); - } - } - // Deserialize Response - if (statusCode === 202) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PacketCaptureQueryStatusResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** Class representing a PacketCaptures. */ -class PacketCaptures { - /** - * Create a PacketCaptures. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._create = _create; - this._get = _get; - this._deleteMethod = _deleteMethod; - this._stop = _stop; - this._getStatus = _getStatus; - this._list = _list; - this._beginCreate = _beginCreate; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginStop = _beginStop; - this._beginGetStatus = _beginGetStatus; - } - - /** - * Create and start a packet capture on the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @param {object} parameters Parameters that define the create packet capture - * operation. - * - * @param {string} parameters.target The ID of the targeted resource, only VM - * is currently supported. - * - * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes - * captured per packet, the remaining bytes are truncated. - * - * @param {number} [parameters.totalBytesPerSession] Maximum size of the - * capture output. - * - * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the - * capture session in seconds. - * - * @param {object} parameters.storageLocation - * - * @param {string} [parameters.storageLocation.storageId] The ID of the storage - * account to save the packet capture session. Required if no local file path - * is provided. - * - * @param {string} [parameters.storageLocation.storagePath] The URI of the - * storage path to save the packet capture. Must be a well-formed URI - * describing the location to save the packet capture. - * - * @param {string} [parameters.storageLocation.filePath] A valid local path on - * the targeting VM. Must include the name of the capture file (*.cap). For - * linux virtual machine it must start with /var/captures. Required if no - * storage ID is provided, otherwise optional. - * - * @param {array} [parameters.filters] - * - * @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. - */ - createWithHttpOperationResponse(resourceGroupName, networkWatcherName, packetCaptureName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._create(resourceGroupName, networkWatcherName, packetCaptureName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Create and start a packet capture on the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @param {object} parameters Parameters that define the create packet capture - * operation. - * - * @param {string} parameters.target The ID of the targeted resource, only VM - * is currently supported. - * - * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes - * captured per packet, the remaining bytes are truncated. - * - * @param {number} [parameters.totalBytesPerSession] Maximum size of the - * capture output. - * - * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the - * capture session in seconds. - * - * @param {object} parameters.storageLocation - * - * @param {string} [parameters.storageLocation.storageId] The ID of the storage - * account to save the packet capture session. Required if no local file path - * is provided. - * - * @param {string} [parameters.storageLocation.storagePath] The URI of the - * storage path to save the packet capture. Must be a well-formed URI - * describing the location to save the packet capture. - * - * @param {string} [parameters.storageLocation.filePath] A valid local path on - * the targeting VM. Must include the name of the capture file (*.cap). For - * linux virtual machine it must start with /var/captures. Required if no - * storage ID is provided, otherwise optional. - * - * @param {array} [parameters.filters] - * - * @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 {PacketCaptureResult} - 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 PacketCaptureResult} 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. - */ - create(resourceGroupName, networkWatcherName, packetCaptureName, parameters, 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._create(resourceGroupName, networkWatcherName, packetCaptureName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._create(resourceGroupName, networkWatcherName, packetCaptureName, parameters, options, optionalCallback); - } - } - - /** - * Gets a packet capture session by name. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @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, networkWatcherName, packetCaptureName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets a packet capture session by name. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @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 {PacketCaptureResult} - 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 PacketCaptureResult} 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, networkWatcherName, packetCaptureName, 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, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, networkWatcherName, packetCaptureName, options, optionalCallback); - } - } - - /** - * Deletes the specified packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, networkWatcherName, packetCaptureName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, networkWatcherName, packetCaptureName, 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._deleteMethod(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, networkWatcherName, packetCaptureName, options, optionalCallback); - } - } - - /** - * Stops a specified packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @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. - */ - stopWithHttpOperationResponse(resourceGroupName, networkWatcherName, packetCaptureName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._stop(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Stops a specified packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - stop(resourceGroupName, networkWatcherName, packetCaptureName, 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._stop(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._stop(resourceGroupName, networkWatcherName, packetCaptureName, options, optionalCallback); - } - } - - /** - * Query the status of a running packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} packetCaptureName The name given to the packet capture - * session. - * - * @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. - */ - getStatusWithHttpOperationResponse(resourceGroupName, networkWatcherName, packetCaptureName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getStatus(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Query the status of a running packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} packetCaptureName The name given to the packet capture - * session. - * - * @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 {PacketCaptureQueryStatusResult} - 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 PacketCaptureQueryStatusResult} 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. - */ - getStatus(resourceGroupName, networkWatcherName, packetCaptureName, 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._getStatus(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getStatus(resourceGroupName, networkWatcherName, packetCaptureName, options, optionalCallback); - } - } - - /** - * Lists all packet capture sessions within the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @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, networkWatcherName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all packet capture sessions within the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @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 {PacketCaptureListResult} - 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 PacketCaptureListResult} 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, networkWatcherName, 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, networkWatcherName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, networkWatcherName, options, optionalCallback); - } - } - - /** - * Create and start a packet capture on the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @param {object} parameters Parameters that define the create packet capture - * operation. - * - * @param {string} parameters.target The ID of the targeted resource, only VM - * is currently supported. - * - * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes - * captured per packet, the remaining bytes are truncated. - * - * @param {number} [parameters.totalBytesPerSession] Maximum size of the - * capture output. - * - * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the - * capture session in seconds. - * - * @param {object} parameters.storageLocation - * - * @param {string} [parameters.storageLocation.storageId] The ID of the storage - * account to save the packet capture session. Required if no local file path - * is provided. - * - * @param {string} [parameters.storageLocation.storagePath] The URI of the - * storage path to save the packet capture. Must be a well-formed URI - * describing the location to save the packet capture. - * - * @param {string} [parameters.storageLocation.filePath] A valid local path on - * the targeting VM. Must include the name of the capture file (*.cap). For - * linux virtual machine it must start with /var/captures. Required if no - * storage ID is provided, otherwise optional. - * - * @param {array} [parameters.filters] - * - * @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. - */ - beginCreateWithHttpOperationResponse(resourceGroupName, networkWatcherName, packetCaptureName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreate(resourceGroupName, networkWatcherName, packetCaptureName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Create and start a packet capture on the specified VM. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @param {object} parameters Parameters that define the create packet capture - * operation. - * - * @param {string} parameters.target The ID of the targeted resource, only VM - * is currently supported. - * - * @param {number} [parameters.bytesToCapturePerPacket] Number of bytes - * captured per packet, the remaining bytes are truncated. - * - * @param {number} [parameters.totalBytesPerSession] Maximum size of the - * capture output. - * - * @param {number} [parameters.timeLimitInSeconds] Maximum duration of the - * capture session in seconds. - * - * @param {object} parameters.storageLocation - * - * @param {string} [parameters.storageLocation.storageId] The ID of the storage - * account to save the packet capture session. Required if no local file path - * is provided. - * - * @param {string} [parameters.storageLocation.storagePath] The URI of the - * storage path to save the packet capture. Must be a well-formed URI - * describing the location to save the packet capture. - * - * @param {string} [parameters.storageLocation.filePath] A valid local path on - * the targeting VM. Must include the name of the capture file (*.cap). For - * linux virtual machine it must start with /var/captures. Required if no - * storage ID is provided, otherwise optional. - * - * @param {array} [parameters.filters] - * - * @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 {PacketCaptureResult} - 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 PacketCaptureResult} 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. - */ - beginCreate(resourceGroupName, networkWatcherName, packetCaptureName, parameters, 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._beginCreate(resourceGroupName, networkWatcherName, packetCaptureName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreate(resourceGroupName, networkWatcherName, packetCaptureName, parameters, options, optionalCallback); - } - } - - /** - * Deletes the specified packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, networkWatcherName, packetCaptureName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, networkWatcherName, packetCaptureName, 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._beginDeleteMethod(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, networkWatcherName, packetCaptureName, options, optionalCallback); - } - } - - /** - * Stops a specified packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @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. - */ - beginStopWithHttpOperationResponse(resourceGroupName, networkWatcherName, packetCaptureName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginStop(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Stops a specified packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {string} packetCaptureName The name of the packet capture session. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginStop(resourceGroupName, networkWatcherName, packetCaptureName, 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._beginStop(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginStop(resourceGroupName, networkWatcherName, packetCaptureName, options, optionalCallback); - } - } - - /** - * Query the status of a running packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} packetCaptureName The name given to the packet capture - * session. - * - * @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. - */ - beginGetStatusWithHttpOperationResponse(resourceGroupName, networkWatcherName, packetCaptureName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginGetStatus(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Query the status of a running packet capture session. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the Network Watcher resource. - * - * @param {string} packetCaptureName The name given to the packet capture - * session. - * - * @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 {PacketCaptureQueryStatusResult} - 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 PacketCaptureQueryStatusResult} 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. - */ - beginGetStatus(resourceGroupName, networkWatcherName, packetCaptureName, 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._beginGetStatus(resourceGroupName, networkWatcherName, packetCaptureName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginGetStatus(resourceGroupName, networkWatcherName, packetCaptureName, options, optionalCallback); - } - } - -} - -module.exports = PacketCaptures; diff --git a/lib/services/networkManagement2/lib/operations/publicIPAddresses.js b/lib/services/networkManagement2/lib/operations/publicIPAddresses.js deleted file mode 100644 index f4474386f..000000000 --- a/lib/services/networkManagement2/lib/operations/publicIPAddresses.js +++ /dev/null @@ -1,3999 +0,0 @@ -/* - * 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; - - -/** - * Deletes the specified public IP address. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the subnet. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, publicIpAddressName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, publicIpAddressName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets the specified public IP address in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the subnet. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 PublicIPAddress} 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, publicIpAddressName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2018-10-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 (publicIpAddressName === null || publicIpAddressName === undefined || typeof publicIpAddressName.valueOf() !== 'string') { - throw new Error('publicIpAddressName 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 (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand 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/publicIPAddresses/{publicIpAddressName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{publicIpAddressName}', encodeURIComponent(publicIpAddressName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } - 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['PublicIPAddress']().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); - }); -} - - -/** - * Creates or updates a static or dynamic public IP address. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the public IP address. - * - * @param {object} parameters Parameters supplied to the create or update - * public IP address operation. - * - * @param {object} [parameters.sku] The public IP address SKU. - * - * @param {string} [parameters.sku.name] Name of a public IP address SKU. - * Possible values include: 'Basic', 'Standard' - * - * @param {string} [parameters.publicIPAllocationMethod] The public IP - * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' - * - * @param {string} [parameters.publicIPAddressVersion] The public IP address - * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: - * 'IPv4', 'IPv6' - * - * @param {object} [parameters.dnsSettings] The FQDN of the DNS record - * associated with the public IP address. - * - * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the - * Domain name label.The concatenation of the domain name label and the - * regionalized DNS zone make up the fully qualified domain name associated - * with the public IP address. If a domain name label is specified, an A DNS - * record is created for the public IP in the Microsoft Azure DNS system. - * - * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified - * domain name of the A DNS record associated with the public IP. This is the - * concatenation of the domainNameLabel and the regionalized DNS zone. - * - * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the - * Reverse FQDN. A user-visible, fully qualified domain name that resolves to - * this public IP address. If the reverseFqdn is specified, then a PTR DNS - * record is created pointing from the IP address in the in-addr.arpa domain to - * the reverse FQDN. - * - * @param {array} [parameters.ipTags] The list of tags associated with the - * public IP address. - * - * @param {string} [parameters.ipAddress] The IP address associated with the - * public IP address resource. - * - * @param {object} [parameters.publicIPPrefix] The Public IP Prefix this Public - * IP Address should be allocated from. - * - * @param {string} [parameters.publicIPPrefix.id] Resource ID. - * - * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the - * public IP address. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * public IP resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting the - * IP allocated for the resource needs to come from. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 PublicIPAddress} 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 _createOrUpdate(resourceGroupName, publicIpAddressName, parameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, publicIpAddressName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PublicIPAddress']().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); - }); - }); -} - - -/** - * Updates public IP address tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the public IP address. - * - * @param {object} parameters Parameters supplied to update public IP address - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 PublicIPAddress} 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 _updateTags(resourceGroupName, publicIpAddressName, parameters, 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.'); - } - - // Send request - this.beginUpdateTags(resourceGroupName, publicIpAddressName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PublicIPAddress']().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 the public IP addresses in a subscription. - * - * @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 PublicIPAddressListResult} 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 _listAll(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/publicIPAddresses'; - 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['PublicIPAddressListResult']().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 public IP addresses in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 PublicIPAddressListResult} 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, 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-10-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 (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/publicIPAddresses'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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['PublicIPAddressListResult']().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 information about all public IP addresses on a virtual machine scale - * set level. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @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 PublicIPAddressListResult} 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 _listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, 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 = '2017-03-30'; - // 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 (virtualMachineScaleSetName === null || virtualMachineScaleSetName === undefined || typeof virtualMachineScaleSetName.valueOf() !== 'string') { - throw new Error('virtualMachineScaleSetName 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.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualMachineScaleSetName}', encodeURIComponent(virtualMachineScaleSetName)); - 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['PublicIPAddressListResult']().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 information about all public IP addresses in a virtual machine IP - * configuration in a virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @param {string} networkInterfaceName The network interface name. - * - * @param {string} ipConfigurationName The IP configuration name. - * - * @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 PublicIPAddressListResult} 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 _listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, 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 = '2017-03-30'; - // 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 (virtualMachineScaleSetName === null || virtualMachineScaleSetName === undefined || typeof virtualMachineScaleSetName.valueOf() !== 'string') { - throw new Error('virtualMachineScaleSetName cannot be null or undefined and it must be of type string.'); - } - if (virtualmachineIndex === null || virtualmachineIndex === undefined || typeof virtualmachineIndex.valueOf() !== 'string') { - throw new Error('virtualmachineIndex cannot be null or undefined and it must be of type string.'); - } - if (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { - throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); - } - if (ipConfigurationName === null || ipConfigurationName === undefined || typeof ipConfigurationName.valueOf() !== 'string') { - throw new Error('ipConfigurationName 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.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualMachineScaleSetName}', encodeURIComponent(virtualMachineScaleSetName)); - requestUrl = requestUrl.replace('{virtualmachineIndex}', encodeURIComponent(virtualmachineIndex)); - requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); - requestUrl = requestUrl.replace('{ipConfigurationName}', encodeURIComponent(ipConfigurationName)); - 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['PublicIPAddressListResult']().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); - }); -} - -/** - * Get the specified public IP address in a virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} ipConfigurationName The name of the IP configuration. - * - * @param {string} publicIpAddressName The name of the public IP Address. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 PublicIPAddress} 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 _getVirtualMachineScaleSetPublicIPAddress(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2017-03-30'; - // 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 (virtualMachineScaleSetName === null || virtualMachineScaleSetName === undefined || typeof virtualMachineScaleSetName.valueOf() !== 'string') { - throw new Error('virtualMachineScaleSetName cannot be null or undefined and it must be of type string.'); - } - if (virtualmachineIndex === null || virtualmachineIndex === undefined || typeof virtualmachineIndex.valueOf() !== 'string') { - throw new Error('virtualmachineIndex cannot be null or undefined and it must be of type string.'); - } - if (networkInterfaceName === null || networkInterfaceName === undefined || typeof networkInterfaceName.valueOf() !== 'string') { - throw new Error('networkInterfaceName cannot be null or undefined and it must be of type string.'); - } - if (ipConfigurationName === null || ipConfigurationName === undefined || typeof ipConfigurationName.valueOf() !== 'string') { - throw new Error('ipConfigurationName cannot be null or undefined and it must be of type string.'); - } - if (publicIpAddressName === null || publicIpAddressName === undefined || typeof publicIpAddressName.valueOf() !== 'string') { - throw new Error('publicIpAddressName 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 (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand 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.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualMachineScaleSetName}', encodeURIComponent(virtualMachineScaleSetName)); - requestUrl = requestUrl.replace('{virtualmachineIndex}', encodeURIComponent(virtualmachineIndex)); - requestUrl = requestUrl.replace('{networkInterfaceName}', encodeURIComponent(networkInterfaceName)); - requestUrl = requestUrl.replace('{ipConfigurationName}', encodeURIComponent(ipConfigurationName)); - requestUrl = requestUrl.replace('{publicIpAddressName}', encodeURIComponent(publicIpAddressName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } - 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['PublicIPAddress']().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); - }); -} - -/** - * Deletes the specified public IP address. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the subnet. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, publicIpAddressName, 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-10-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 (publicIpAddressName === null || publicIpAddressName === undefined || typeof publicIpAddressName.valueOf() !== 'string') { - throw new Error('publicIpAddressName 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/publicIPAddresses/{publicIpAddressName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{publicIpAddressName}', encodeURIComponent(publicIpAddressName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates a static or dynamic public IP address. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the public IP address. - * - * @param {object} parameters Parameters supplied to the create or update - * public IP address operation. - * - * @param {object} [parameters.sku] The public IP address SKU. - * - * @param {string} [parameters.sku.name] Name of a public IP address SKU. - * Possible values include: 'Basic', 'Standard' - * - * @param {string} [parameters.publicIPAllocationMethod] The public IP - * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' - * - * @param {string} [parameters.publicIPAddressVersion] The public IP address - * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: - * 'IPv4', 'IPv6' - * - * @param {object} [parameters.dnsSettings] The FQDN of the DNS record - * associated with the public IP address. - * - * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the - * Domain name label.The concatenation of the domain name label and the - * regionalized DNS zone make up the fully qualified domain name associated - * with the public IP address. If a domain name label is specified, an A DNS - * record is created for the public IP in the Microsoft Azure DNS system. - * - * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified - * domain name of the A DNS record associated with the public IP. This is the - * concatenation of the domainNameLabel and the regionalized DNS zone. - * - * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the - * Reverse FQDN. A user-visible, fully qualified domain name that resolves to - * this public IP address. If the reverseFqdn is specified, then a PTR DNS - * record is created pointing from the IP address in the in-addr.arpa domain to - * the reverse FQDN. - * - * @param {array} [parameters.ipTags] The list of tags associated with the - * public IP address. - * - * @param {string} [parameters.ipAddress] The IP address associated with the - * public IP address resource. - * - * @param {object} [parameters.publicIPPrefix] The Public IP Prefix this Public - * IP Address should be allocated from. - * - * @param {string} [parameters.publicIPPrefix.id] Resource ID. - * - * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the - * public IP address. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * public IP resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting the - * IP allocated for the resource needs to come from. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 PublicIPAddress} 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 _beginCreateOrUpdate(resourceGroupName, publicIpAddressName, parameters, 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-10-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 (publicIpAddressName === null || publicIpAddressName === undefined || typeof publicIpAddressName.valueOf() !== 'string') { - throw new Error('publicIpAddressName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/publicIPAddresses/{publicIpAddressName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{publicIpAddressName}', encodeURIComponent(publicIpAddressName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['PublicIPAddress']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['PublicIPAddress']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PublicIPAddress']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Updates public IP address tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the public IP address. - * - * @param {object} parameters Parameters supplied to update public IP address - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 PublicIPAddress} 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 _beginUpdateTags(resourceGroupName, publicIpAddressName, parameters, 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-10-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 (publicIpAddressName === null || publicIpAddressName === undefined || typeof publicIpAddressName.valueOf() !== 'string') { - throw new Error('publicIpAddressName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/publicIPAddresses/{publicIpAddressName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{publicIpAddressName}', encodeURIComponent(publicIpAddressName)); - 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 = 'PATCH'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['TagsObject']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // 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['PublicIPAddress']().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 the public IP addresses in a subscription. - * - * @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 PublicIPAddressListResult} 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 _listAllNext(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['PublicIPAddressListResult']().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 public IP addresses in a resource group. - * - * @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 PublicIPAddressListResult} 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['PublicIPAddressListResult']().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 information about all public IP addresses on a virtual machine scale - * set level. - * - * @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 PublicIPAddressListResult} 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 _listVirtualMachineScaleSetPublicIPAddressesNext(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['PublicIPAddressListResult']().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 information about all public IP addresses in a virtual machine IP - * configuration in a virtual machine scale set. - * - * @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 PublicIPAddressListResult} 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 _listVirtualMachineScaleSetVMPublicIPAddressesNext(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['PublicIPAddressListResult']().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 PublicIPAddresses. */ -class PublicIPAddresses { - /** - * Create a PublicIPAddresses. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._updateTags = _updateTags; - this._listAll = _listAll; - this._list = _list; - this._listVirtualMachineScaleSetPublicIPAddresses = _listVirtualMachineScaleSetPublicIPAddresses; - this._listVirtualMachineScaleSetVMPublicIPAddresses = _listVirtualMachineScaleSetVMPublicIPAddresses; - this._getVirtualMachineScaleSetPublicIPAddress = _getVirtualMachineScaleSetPublicIPAddress; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdateTags = _beginUpdateTags; - this._listAllNext = _listAllNext; - this._listNext = _listNext; - this._listVirtualMachineScaleSetPublicIPAddressesNext = _listVirtualMachineScaleSetPublicIPAddressesNext; - this._listVirtualMachineScaleSetVMPublicIPAddressesNext = _listVirtualMachineScaleSetVMPublicIPAddressesNext; - } - - /** - * Deletes the specified public IP address. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the subnet. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, publicIpAddressName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, publicIpAddressName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified public IP address. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the subnet. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, publicIpAddressName, 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._deleteMethod(resourceGroupName, publicIpAddressName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, publicIpAddressName, options, optionalCallback); - } - } - - /** - * Gets the specified public IP address in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the subnet. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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, publicIpAddressName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, publicIpAddressName, 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 public IP address in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the subnet. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {PublicIPAddress} - 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 PublicIPAddress} 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, publicIpAddressName, 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, publicIpAddressName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, publicIpAddressName, options, optionalCallback); - } - } - - /** - * Creates or updates a static or dynamic public IP address. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the public IP address. - * - * @param {object} parameters Parameters supplied to the create or update - * public IP address operation. - * - * @param {object} [parameters.sku] The public IP address SKU. - * - * @param {string} [parameters.sku.name] Name of a public IP address SKU. - * Possible values include: 'Basic', 'Standard' - * - * @param {string} [parameters.publicIPAllocationMethod] The public IP - * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' - * - * @param {string} [parameters.publicIPAddressVersion] The public IP address - * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: - * 'IPv4', 'IPv6' - * - * @param {object} [parameters.dnsSettings] The FQDN of the DNS record - * associated with the public IP address. - * - * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the - * Domain name label.The concatenation of the domain name label and the - * regionalized DNS zone make up the fully qualified domain name associated - * with the public IP address. If a domain name label is specified, an A DNS - * record is created for the public IP in the Microsoft Azure DNS system. - * - * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified - * domain name of the A DNS record associated with the public IP. This is the - * concatenation of the domainNameLabel and the regionalized DNS zone. - * - * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the - * Reverse FQDN. A user-visible, fully qualified domain name that resolves to - * this public IP address. If the reverseFqdn is specified, then a PTR DNS - * record is created pointing from the IP address in the in-addr.arpa domain to - * the reverse FQDN. - * - * @param {array} [parameters.ipTags] The list of tags associated with the - * public IP address. - * - * @param {string} [parameters.ipAddress] The IP address associated with the - * public IP address resource. - * - * @param {object} [parameters.publicIPPrefix] The Public IP Prefix this Public - * IP Address should be allocated from. - * - * @param {string} [parameters.publicIPPrefix.id] Resource ID. - * - * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the - * public IP address. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * public IP resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting the - * IP allocated for the resource needs to come from. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, publicIpAddressName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, publicIpAddressName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a static or dynamic public IP address. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the public IP address. - * - * @param {object} parameters Parameters supplied to the create or update - * public IP address operation. - * - * @param {object} [parameters.sku] The public IP address SKU. - * - * @param {string} [parameters.sku.name] Name of a public IP address SKU. - * Possible values include: 'Basic', 'Standard' - * - * @param {string} [parameters.publicIPAllocationMethod] The public IP - * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' - * - * @param {string} [parameters.publicIPAddressVersion] The public IP address - * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: - * 'IPv4', 'IPv6' - * - * @param {object} [parameters.dnsSettings] The FQDN of the DNS record - * associated with the public IP address. - * - * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the - * Domain name label.The concatenation of the domain name label and the - * regionalized DNS zone make up the fully qualified domain name associated - * with the public IP address. If a domain name label is specified, an A DNS - * record is created for the public IP in the Microsoft Azure DNS system. - * - * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified - * domain name of the A DNS record associated with the public IP. This is the - * concatenation of the domainNameLabel and the regionalized DNS zone. - * - * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the - * Reverse FQDN. A user-visible, fully qualified domain name that resolves to - * this public IP address. If the reverseFqdn is specified, then a PTR DNS - * record is created pointing from the IP address in the in-addr.arpa domain to - * the reverse FQDN. - * - * @param {array} [parameters.ipTags] The list of tags associated with the - * public IP address. - * - * @param {string} [parameters.ipAddress] The IP address associated with the - * public IP address resource. - * - * @param {object} [parameters.publicIPPrefix] The Public IP Prefix this Public - * IP Address should be allocated from. - * - * @param {string} [parameters.publicIPPrefix.id] Resource ID. - * - * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the - * public IP address. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * public IP resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting the - * IP allocated for the resource needs to come from. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {PublicIPAddress} - 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 PublicIPAddress} 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. - */ - createOrUpdate(resourceGroupName, publicIpAddressName, parameters, 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._createOrUpdate(resourceGroupName, publicIpAddressName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, publicIpAddressName, parameters, options, optionalCallback); - } - } - - /** - * Updates public IP address tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the public IP address. - * - * @param {object} parameters Parameters supplied to update public IP address - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName, publicIpAddressName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateTags(resourceGroupName, publicIpAddressName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates public IP address tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the public IP address. - * - * @param {object} parameters Parameters supplied to update public IP address - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {PublicIPAddress} - 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 PublicIPAddress} 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. - */ - updateTags(resourceGroupName, publicIpAddressName, parameters, 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._updateTags(resourceGroupName, publicIpAddressName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateTags(resourceGroupName, publicIpAddressName, parameters, options, optionalCallback); - } - } - - /** - * Gets all the public IP addresses in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAll(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 the public IP addresses in a subscription. - * - * @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 {PublicIPAddressListResult} - 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 PublicIPAddressListResult} 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. - */ - listAll(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._listAll(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAll(options, optionalCallback); - } - } - - /** - * Gets all public IP addresses in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, 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 public IP addresses in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {PublicIPAddressListResult} - 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 PublicIPAddressListResult} 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, 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, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, options, optionalCallback); - } - } - - /** - * Gets information about all public IP addresses on a virtual machine scale - * set level. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @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. - */ - listVirtualMachineScaleSetPublicIPAddressesWithHttpOperationResponse(resourceGroupName, virtualMachineScaleSetName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets information about all public IP addresses on a virtual machine scale - * set level. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @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 {PublicIPAddressListResult} - 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 PublicIPAddressListResult} 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. - */ - listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, 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._listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listVirtualMachineScaleSetPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, options, optionalCallback); - } - } - - /** - * Gets information about all public IP addresses in a virtual machine IP - * configuration in a virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @param {string} networkInterfaceName The network interface name. - * - * @param {string} ipConfigurationName The IP configuration name. - * - * @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. - */ - listVirtualMachineScaleSetVMPublicIPAddressesWithHttpOperationResponse(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets information about all public IP addresses in a virtual machine IP - * configuration in a virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @param {string} networkInterfaceName The network interface name. - * - * @param {string} ipConfigurationName The IP configuration name. - * - * @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 {PublicIPAddressListResult} - 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 PublicIPAddressListResult} 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. - */ - listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, 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._listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, options, optionalCallback); - } - } - - /** - * Get the specified public IP address in a virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} ipConfigurationName The name of the IP configuration. - * - * @param {string} publicIpAddressName The name of the public IP Address. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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. - */ - getVirtualMachineScaleSetPublicIPAddressWithHttpOperationResponse(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getVirtualMachineScaleSetPublicIPAddress(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Get the specified public IP address in a virtual machine scale set. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualMachineScaleSetName The name of the virtual machine - * scale set. - * - * @param {string} virtualmachineIndex The virtual machine index. - * - * @param {string} networkInterfaceName The name of the network interface. - * - * @param {string} ipConfigurationName The name of the IP configuration. - * - * @param {string} publicIpAddressName The name of the public IP Address. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {PublicIPAddress} - 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 PublicIPAddress} 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. - */ - getVirtualMachineScaleSetPublicIPAddress(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, 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._getVirtualMachineScaleSetPublicIPAddress(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getVirtualMachineScaleSetPublicIPAddress(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, options, optionalCallback); - } - } - - /** - * Deletes the specified public IP address. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the subnet. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, publicIpAddressName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, publicIpAddressName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified public IP address. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the subnet. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, publicIpAddressName, 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._beginDeleteMethod(resourceGroupName, publicIpAddressName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, publicIpAddressName, options, optionalCallback); - } - } - - /** - * Creates or updates a static or dynamic public IP address. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the public IP address. - * - * @param {object} parameters Parameters supplied to the create or update - * public IP address operation. - * - * @param {object} [parameters.sku] The public IP address SKU. - * - * @param {string} [parameters.sku.name] Name of a public IP address SKU. - * Possible values include: 'Basic', 'Standard' - * - * @param {string} [parameters.publicIPAllocationMethod] The public IP - * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' - * - * @param {string} [parameters.publicIPAddressVersion] The public IP address - * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: - * 'IPv4', 'IPv6' - * - * @param {object} [parameters.dnsSettings] The FQDN of the DNS record - * associated with the public IP address. - * - * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the - * Domain name label.The concatenation of the domain name label and the - * regionalized DNS zone make up the fully qualified domain name associated - * with the public IP address. If a domain name label is specified, an A DNS - * record is created for the public IP in the Microsoft Azure DNS system. - * - * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified - * domain name of the A DNS record associated with the public IP. This is the - * concatenation of the domainNameLabel and the regionalized DNS zone. - * - * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the - * Reverse FQDN. A user-visible, fully qualified domain name that resolves to - * this public IP address. If the reverseFqdn is specified, then a PTR DNS - * record is created pointing from the IP address in the in-addr.arpa domain to - * the reverse FQDN. - * - * @param {array} [parameters.ipTags] The list of tags associated with the - * public IP address. - * - * @param {string} [parameters.ipAddress] The IP address associated with the - * public IP address resource. - * - * @param {object} [parameters.publicIPPrefix] The Public IP Prefix this Public - * IP Address should be allocated from. - * - * @param {string} [parameters.publicIPPrefix.id] Resource ID. - * - * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the - * public IP address. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * public IP resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting the - * IP allocated for the resource needs to come from. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, publicIpAddressName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, publicIpAddressName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a static or dynamic public IP address. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the public IP address. - * - * @param {object} parameters Parameters supplied to the create or update - * public IP address operation. - * - * @param {object} [parameters.sku] The public IP address SKU. - * - * @param {string} [parameters.sku.name] Name of a public IP address SKU. - * Possible values include: 'Basic', 'Standard' - * - * @param {string} [parameters.publicIPAllocationMethod] The public IP - * allocation method. Possible values are: 'Static' and 'Dynamic'. Possible - * values include: 'Static', 'Dynamic' - * - * @param {string} [parameters.publicIPAddressVersion] The public IP address - * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: - * 'IPv4', 'IPv6' - * - * @param {object} [parameters.dnsSettings] The FQDN of the DNS record - * associated with the public IP address. - * - * @param {string} [parameters.dnsSettings.domainNameLabel] Gets or sets the - * Domain name label.The concatenation of the domain name label and the - * regionalized DNS zone make up the fully qualified domain name associated - * with the public IP address. If a domain name label is specified, an A DNS - * record is created for the public IP in the Microsoft Azure DNS system. - * - * @param {string} [parameters.dnsSettings.fqdn] Gets the FQDN, Fully qualified - * domain name of the A DNS record associated with the public IP. This is the - * concatenation of the domainNameLabel and the regionalized DNS zone. - * - * @param {string} [parameters.dnsSettings.reverseFqdn] Gets or Sets the - * Reverse FQDN. A user-visible, fully qualified domain name that resolves to - * this public IP address. If the reverseFqdn is specified, then a PTR DNS - * record is created pointing from the IP address in the in-addr.arpa domain to - * the reverse FQDN. - * - * @param {array} [parameters.ipTags] The list of tags associated with the - * public IP address. - * - * @param {string} [parameters.ipAddress] The IP address associated with the - * public IP address resource. - * - * @param {object} [parameters.publicIPPrefix] The Public IP Prefix this Public - * IP Address should be allocated from. - * - * @param {string} [parameters.publicIPPrefix.id] Resource ID. - * - * @param {number} [parameters.idleTimeoutInMinutes] The idle timeout of the - * public IP address. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * public IP resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting the - * IP allocated for the resource needs to come from. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {PublicIPAddress} - 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 PublicIPAddress} 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. - */ - beginCreateOrUpdate(resourceGroupName, publicIpAddressName, parameters, 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._beginCreateOrUpdate(resourceGroupName, publicIpAddressName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, publicIpAddressName, parameters, options, optionalCallback); - } - } - - /** - * Updates public IP address tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the public IP address. - * - * @param {object} parameters Parameters supplied to update public IP address - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName, publicIpAddressName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginUpdateTags(resourceGroupName, publicIpAddressName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates public IP address tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpAddressName The name of the public IP address. - * - * @param {object} parameters Parameters supplied to update public IP address - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {PublicIPAddress} - 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 PublicIPAddress} 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. - */ - beginUpdateTags(resourceGroupName, publicIpAddressName, parameters, 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._beginUpdateTags(resourceGroupName, publicIpAddressName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginUpdateTags(resourceGroupName, publicIpAddressName, parameters, options, optionalCallback); - } - } - - /** - * Gets all the public IP addresses in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAllNext(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 the public IP addresses in a subscription. - * - * @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 {PublicIPAddressListResult} - 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 PublicIPAddressListResult} 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. - */ - listAllNext(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._listAllNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAllNext(nextPageLink, options, optionalCallback); - } - } - - /** - * Gets all public IP addresses in a resource group. - * - * @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 public IP addresses in a resource group. - * - * @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 {PublicIPAddressListResult} - 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 PublicIPAddressListResult} 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); - } - } - - /** - * Gets information about all public IP addresses on a virtual machine scale - * set level. - * - * @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. - */ - listVirtualMachineScaleSetPublicIPAddressesNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listVirtualMachineScaleSetPublicIPAddressesNext(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 information about all public IP addresses on a virtual machine scale - * set level. - * - * @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 {PublicIPAddressListResult} - 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 PublicIPAddressListResult} 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. - */ - listVirtualMachineScaleSetPublicIPAddressesNext(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._listVirtualMachineScaleSetPublicIPAddressesNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listVirtualMachineScaleSetPublicIPAddressesNext(nextPageLink, options, optionalCallback); - } - } - - /** - * Gets information about all public IP addresses in a virtual machine IP - * configuration in a virtual machine scale set. - * - * @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. - */ - listVirtualMachineScaleSetVMPublicIPAddressesNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listVirtualMachineScaleSetVMPublicIPAddressesNext(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 information about all public IP addresses in a virtual machine IP - * configuration in a virtual machine scale set. - * - * @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 {PublicIPAddressListResult} - 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 PublicIPAddressListResult} 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. - */ - listVirtualMachineScaleSetVMPublicIPAddressesNext(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._listVirtualMachineScaleSetVMPublicIPAddressesNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listVirtualMachineScaleSetVMPublicIPAddressesNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = PublicIPAddresses; diff --git a/lib/services/networkManagement2/lib/operations/publicIPPrefixes.js b/lib/services/networkManagement2/lib/operations/publicIPPrefixes.js deleted file mode 100644 index e91ac2a11..000000000 --- a/lib/services/networkManagement2/lib/operations/publicIPPrefixes.js +++ /dev/null @@ -1,2617 +0,0 @@ -/* - * 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; - - -/** - * Deletes the specified public IP prefix. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the PublicIpPrefix. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, publicIpPrefixName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, publicIpPrefixName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets the specified public IP prefix in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the PublicIPPrefx. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 PublicIPPrefix} 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, publicIpPrefixName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2018-10-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 (publicIpPrefixName === null || publicIpPrefixName === undefined || typeof publicIpPrefixName.valueOf() !== 'string') { - throw new Error('publicIpPrefixName 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 (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand 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/publicIPPrefixes/{publicIpPrefixName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{publicIpPrefixName}', encodeURIComponent(publicIpPrefixName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } - 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['PublicIPPrefix']().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); - }); -} - - -/** - * Creates or updates a static or dynamic public IP prefix. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the public IP prefix. - * - * @param {object} parameters Parameters supplied to the create or update - * public IP prefix operation. - * - * @param {object} [parameters.sku] The public IP prefix SKU. - * - * @param {string} [parameters.sku.name] Name of a public IP prefix SKU. - * Possible values include: 'Standard' - * - * @param {string} [parameters.publicIPAddressVersion] The public IP address - * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: - * 'IPv4', 'IPv6' - * - * @param {array} [parameters.ipTags] The list of tags associated with the - * public IP prefix. - * - * @param {number} [parameters.prefixLength] The Length of the Public IP - * Prefix. - * - * @param {string} [parameters.ipPrefix] The allocated Prefix - * - * @param {array} [parameters.publicIPAddresses] The list of all referenced - * PublicIPAddresses - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * public IP prefix resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * Public IP prefix resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting the - * IP allocated for the resource needs to come from. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 PublicIPPrefix} 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 _createOrUpdate(resourceGroupName, publicIpPrefixName, parameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, publicIpPrefixName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PublicIPPrefix']().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); - }); - }); -} - - -/** - * Updates public IP prefix tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the public IP prefix. - * - * @param {object} parameters Parameters supplied to update public IP prefix - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 PublicIPPrefix} 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 _updateTags(resourceGroupName, publicIpPrefixName, parameters, 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.'); - } - - // Send request - this.beginUpdateTags(resourceGroupName, publicIpPrefixName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PublicIPPrefix']().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 the public IP prefixes in a subscription. - * - * @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 PublicIPPrefixListResult} 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 _listAll(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/publicIPPrefixes'; - 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['PublicIPPrefixListResult']().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 public IP prefixes in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 PublicIPPrefixListResult} 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, 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-10-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 (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/publicIPPrefixes'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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['PublicIPPrefixListResult']().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); - }); -} - -/** - * Deletes the specified public IP prefix. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the PublicIpPrefix. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, publicIpPrefixName, 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-10-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 (publicIpPrefixName === null || publicIpPrefixName === undefined || typeof publicIpPrefixName.valueOf() !== 'string') { - throw new Error('publicIpPrefixName 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/publicIPPrefixes/{publicIpPrefixName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{publicIpPrefixName}', encodeURIComponent(publicIpPrefixName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates a static or dynamic public IP prefix. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the public IP prefix. - * - * @param {object} parameters Parameters supplied to the create or update - * public IP prefix operation. - * - * @param {object} [parameters.sku] The public IP prefix SKU. - * - * @param {string} [parameters.sku.name] Name of a public IP prefix SKU. - * Possible values include: 'Standard' - * - * @param {string} [parameters.publicIPAddressVersion] The public IP address - * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: - * 'IPv4', 'IPv6' - * - * @param {array} [parameters.ipTags] The list of tags associated with the - * public IP prefix. - * - * @param {number} [parameters.prefixLength] The Length of the Public IP - * Prefix. - * - * @param {string} [parameters.ipPrefix] The allocated Prefix - * - * @param {array} [parameters.publicIPAddresses] The list of all referenced - * PublicIPAddresses - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * public IP prefix resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * Public IP prefix resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting the - * IP allocated for the resource needs to come from. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 PublicIPPrefix} 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 _beginCreateOrUpdate(resourceGroupName, publicIpPrefixName, parameters, 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-10-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 (publicIpPrefixName === null || publicIpPrefixName === undefined || typeof publicIpPrefixName.valueOf() !== 'string') { - throw new Error('publicIpPrefixName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/publicIPPrefixes/{publicIpPrefixName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{publicIpPrefixName}', encodeURIComponent(publicIpPrefixName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['PublicIPPrefix']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['PublicIPPrefix']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PublicIPPrefix']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Updates public IP prefix tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the public IP prefix. - * - * @param {object} parameters Parameters supplied to update public IP prefix - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 PublicIPPrefix} 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 _beginUpdateTags(resourceGroupName, publicIpPrefixName, parameters, 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-10-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 (publicIpPrefixName === null || publicIpPrefixName === undefined || typeof publicIpPrefixName.valueOf() !== 'string') { - throw new Error('publicIpPrefixName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/publicIPPrefixes/{publicIpPrefixName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{publicIpPrefixName}', encodeURIComponent(publicIpPrefixName)); - 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 = 'PATCH'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['TagsObject']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // 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['PublicIPPrefix']().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 the public IP prefixes in a subscription. - * - * @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 PublicIPPrefixListResult} 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 _listAllNext(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['PublicIPPrefixListResult']().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 public IP prefixes in a resource group. - * - * @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 PublicIPPrefixListResult} 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['PublicIPPrefixListResult']().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 PublicIPPrefixes. */ -class PublicIPPrefixes { - /** - * Create a PublicIPPrefixes. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._updateTags = _updateTags; - this._listAll = _listAll; - this._list = _list; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdateTags = _beginUpdateTags; - this._listAllNext = _listAllNext; - this._listNext = _listNext; - } - - /** - * Deletes the specified public IP prefix. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the PublicIpPrefix. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, publicIpPrefixName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, publicIpPrefixName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified public IP prefix. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the PublicIpPrefix. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, publicIpPrefixName, 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._deleteMethod(resourceGroupName, publicIpPrefixName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, publicIpPrefixName, options, optionalCallback); - } - } - - /** - * Gets the specified public IP prefix in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the PublicIPPrefx. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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, publicIpPrefixName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, publicIpPrefixName, 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 public IP prefix in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the PublicIPPrefx. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {PublicIPPrefix} - 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 PublicIPPrefix} 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, publicIpPrefixName, 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, publicIpPrefixName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, publicIpPrefixName, options, optionalCallback); - } - } - - /** - * Creates or updates a static or dynamic public IP prefix. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the public IP prefix. - * - * @param {object} parameters Parameters supplied to the create or update - * public IP prefix operation. - * - * @param {object} [parameters.sku] The public IP prefix SKU. - * - * @param {string} [parameters.sku.name] Name of a public IP prefix SKU. - * Possible values include: 'Standard' - * - * @param {string} [parameters.publicIPAddressVersion] The public IP address - * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: - * 'IPv4', 'IPv6' - * - * @param {array} [parameters.ipTags] The list of tags associated with the - * public IP prefix. - * - * @param {number} [parameters.prefixLength] The Length of the Public IP - * Prefix. - * - * @param {string} [parameters.ipPrefix] The allocated Prefix - * - * @param {array} [parameters.publicIPAddresses] The list of all referenced - * PublicIPAddresses - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * public IP prefix resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * Public IP prefix resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting the - * IP allocated for the resource needs to come from. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, publicIpPrefixName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, publicIpPrefixName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a static or dynamic public IP prefix. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the public IP prefix. - * - * @param {object} parameters Parameters supplied to the create or update - * public IP prefix operation. - * - * @param {object} [parameters.sku] The public IP prefix SKU. - * - * @param {string} [parameters.sku.name] Name of a public IP prefix SKU. - * Possible values include: 'Standard' - * - * @param {string} [parameters.publicIPAddressVersion] The public IP address - * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: - * 'IPv4', 'IPv6' - * - * @param {array} [parameters.ipTags] The list of tags associated with the - * public IP prefix. - * - * @param {number} [parameters.prefixLength] The Length of the Public IP - * Prefix. - * - * @param {string} [parameters.ipPrefix] The allocated Prefix - * - * @param {array} [parameters.publicIPAddresses] The list of all referenced - * PublicIPAddresses - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * public IP prefix resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * Public IP prefix resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting the - * IP allocated for the resource needs to come from. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {PublicIPPrefix} - 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 PublicIPPrefix} 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. - */ - createOrUpdate(resourceGroupName, publicIpPrefixName, parameters, 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._createOrUpdate(resourceGroupName, publicIpPrefixName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, publicIpPrefixName, parameters, options, optionalCallback); - } - } - - /** - * Updates public IP prefix tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the public IP prefix. - * - * @param {object} parameters Parameters supplied to update public IP prefix - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName, publicIpPrefixName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateTags(resourceGroupName, publicIpPrefixName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates public IP prefix tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the public IP prefix. - * - * @param {object} parameters Parameters supplied to update public IP prefix - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {PublicIPPrefix} - 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 PublicIPPrefix} 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. - */ - updateTags(resourceGroupName, publicIpPrefixName, parameters, 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._updateTags(resourceGroupName, publicIpPrefixName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateTags(resourceGroupName, publicIpPrefixName, parameters, options, optionalCallback); - } - } - - /** - * Gets all the public IP prefixes in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAll(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 the public IP prefixes in a subscription. - * - * @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 {PublicIPPrefixListResult} - 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 PublicIPPrefixListResult} 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. - */ - listAll(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._listAll(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAll(options, optionalCallback); - } - } - - /** - * Gets all public IP prefixes in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, 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 public IP prefixes in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {PublicIPPrefixListResult} - 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 PublicIPPrefixListResult} 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, 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, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, options, optionalCallback); - } - } - - /** - * Deletes the specified public IP prefix. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the PublicIpPrefix. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, publicIpPrefixName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, publicIpPrefixName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified public IP prefix. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the PublicIpPrefix. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, publicIpPrefixName, 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._beginDeleteMethod(resourceGroupName, publicIpPrefixName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, publicIpPrefixName, options, optionalCallback); - } - } - - /** - * Creates or updates a static or dynamic public IP prefix. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the public IP prefix. - * - * @param {object} parameters Parameters supplied to the create or update - * public IP prefix operation. - * - * @param {object} [parameters.sku] The public IP prefix SKU. - * - * @param {string} [parameters.sku.name] Name of a public IP prefix SKU. - * Possible values include: 'Standard' - * - * @param {string} [parameters.publicIPAddressVersion] The public IP address - * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: - * 'IPv4', 'IPv6' - * - * @param {array} [parameters.ipTags] The list of tags associated with the - * public IP prefix. - * - * @param {number} [parameters.prefixLength] The Length of the Public IP - * Prefix. - * - * @param {string} [parameters.ipPrefix] The allocated Prefix - * - * @param {array} [parameters.publicIPAddresses] The list of all referenced - * PublicIPAddresses - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * public IP prefix resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * Public IP prefix resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting the - * IP allocated for the resource needs to come from. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, publicIpPrefixName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, publicIpPrefixName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a static or dynamic public IP prefix. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the public IP prefix. - * - * @param {object} parameters Parameters supplied to the create or update - * public IP prefix operation. - * - * @param {object} [parameters.sku] The public IP prefix SKU. - * - * @param {string} [parameters.sku.name] Name of a public IP prefix SKU. - * Possible values include: 'Standard' - * - * @param {string} [parameters.publicIPAddressVersion] The public IP address - * version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: - * 'IPv4', 'IPv6' - * - * @param {array} [parameters.ipTags] The list of tags associated with the - * public IP prefix. - * - * @param {number} [parameters.prefixLength] The Length of the Public IP - * Prefix. - * - * @param {string} [parameters.ipPrefix] The allocated Prefix - * - * @param {array} [parameters.publicIPAddresses] The list of all referenced - * PublicIPAddresses - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * public IP prefix resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * Public IP prefix resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {array} [parameters.zones] A list of availability zones denoting the - * IP allocated for the resource needs to come from. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {PublicIPPrefix} - 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 PublicIPPrefix} 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. - */ - beginCreateOrUpdate(resourceGroupName, publicIpPrefixName, parameters, 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._beginCreateOrUpdate(resourceGroupName, publicIpPrefixName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, publicIpPrefixName, parameters, options, optionalCallback); - } - } - - /** - * Updates public IP prefix tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the public IP prefix. - * - * @param {object} parameters Parameters supplied to update public IP prefix - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName, publicIpPrefixName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginUpdateTags(resourceGroupName, publicIpPrefixName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates public IP prefix tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} publicIpPrefixName The name of the public IP prefix. - * - * @param {object} parameters Parameters supplied to update public IP prefix - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {PublicIPPrefix} - 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 PublicIPPrefix} 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. - */ - beginUpdateTags(resourceGroupName, publicIpPrefixName, parameters, 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._beginUpdateTags(resourceGroupName, publicIpPrefixName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginUpdateTags(resourceGroupName, publicIpPrefixName, parameters, options, optionalCallback); - } - } - - /** - * Gets all the public IP prefixes in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAllNext(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 the public IP prefixes in a subscription. - * - * @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 {PublicIPPrefixListResult} - 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 PublicIPPrefixListResult} 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. - */ - listAllNext(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._listAllNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAllNext(nextPageLink, options, optionalCallback); - } - } - - /** - * Gets all public IP prefixes in a resource group. - * - * @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 public IP prefixes in a resource group. - * - * @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 {PublicIPPrefixListResult} - 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 PublicIPPrefixListResult} 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 = PublicIPPrefixes; diff --git a/lib/services/networkManagement2/lib/operations/routeFilterRules.js b/lib/services/networkManagement2/lib/operations/routeFilterRules.js deleted file mode 100644 index c4ad4d0f9..000000000 --- a/lib/services/networkManagement2/lib/operations/routeFilterRules.js +++ /dev/null @@ -1,2152 +0,0 @@ -/* - * 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; - - -/** - * Deletes the specified rule from a route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the rule. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, routeFilterName, ruleName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, routeFilterName, ruleName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets the specified rule from a route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the rule. - * - * @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 RouteFilterRule} 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, routeFilterName, ruleName, 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-10-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 (routeFilterName === null || routeFilterName === undefined || typeof routeFilterName.valueOf() !== 'string') { - throw new Error('routeFilterName cannot be null or undefined and it must be of type string.'); - } - if (ruleName === null || ruleName === undefined || typeof ruleName.valueOf() !== 'string') { - throw new Error('ruleName 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/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{routeFilterName}', encodeURIComponent(routeFilterName)); - requestUrl = requestUrl.replace('{ruleName}', encodeURIComponent(ruleName)); - 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['RouteFilterRule']().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); - }); -} - - -/** - * Creates or updates a route in the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the route filter rule. - * - * @param {object} routeFilterRuleParameters Parameters supplied to the create - * or update route filter rule operation. - * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' - * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] - * - * @param {string} [routeFilterRuleParameters.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [routeFilterRuleParameters.location] Resource location. - * - * @param {string} [routeFilterRuleParameters.id] Resource ID. - * - * @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 RouteFilterRule} 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 _createOrUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RouteFilterRule']().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); - }); - }); -} - - -/** - * Updates a route in the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the route filter rule. - * - * @param {object} routeFilterRuleParameters Parameters supplied to the update - * route filter rule operation. - * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' - * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] - * - * @param {string} [routeFilterRuleParameters.id] Resource ID. - * - * @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 RouteFilterRule} 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 _update(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, 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.'); - } - - // Send request - this.beginUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RouteFilterRule']().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 RouteFilterRules in a route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @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 RouteFilterRuleListResult} 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 _listByRouteFilter(resourceGroupName, routeFilterName, 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-10-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 (routeFilterName === null || routeFilterName === undefined || typeof routeFilterName.valueOf() !== 'string') { - throw new Error('routeFilterName 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/routeFilters/{routeFilterName}/routeFilterRules'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{routeFilterName}', encodeURIComponent(routeFilterName)); - 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['RouteFilterRuleListResult']().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); - }); -} - -/** - * Deletes the specified rule from a route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the rule. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, routeFilterName, ruleName, 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-10-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 (routeFilterName === null || routeFilterName === undefined || typeof routeFilterName.valueOf() !== 'string') { - throw new Error('routeFilterName cannot be null or undefined and it must be of type string.'); - } - if (ruleName === null || ruleName === undefined || typeof ruleName.valueOf() !== 'string') { - throw new Error('ruleName 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/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{routeFilterName}', encodeURIComponent(routeFilterName)); - requestUrl = requestUrl.replace('{ruleName}', encodeURIComponent(ruleName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates a route in the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the route filter rule. - * - * @param {object} routeFilterRuleParameters Parameters supplied to the create - * or update route filter rule operation. - * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' - * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] - * - * @param {string} [routeFilterRuleParameters.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [routeFilterRuleParameters.location] Resource location. - * - * @param {string} [routeFilterRuleParameters.id] Resource ID. - * - * @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 RouteFilterRule} 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 _beginCreateOrUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, 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.'); - } - if (routeFilterRuleParameters === null || routeFilterRuleParameters === undefined) - { - routeFilterRuleParameters = {}; - } - let apiVersion = '2018-10-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 (routeFilterName === null || routeFilterName === undefined || typeof routeFilterName.valueOf() !== 'string') { - throw new Error('routeFilterName cannot be null or undefined and it must be of type string.'); - } - if (ruleName === null || ruleName === undefined || typeof ruleName.valueOf() !== 'string') { - throw new Error('ruleName cannot be null or undefined and it must be of type string.'); - } - if (routeFilterRuleParameters === null || routeFilterRuleParameters === undefined) { - throw new Error('routeFilterRuleParameters cannot be null or undefined.'); - } - 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/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{routeFilterName}', encodeURIComponent(routeFilterName)); - requestUrl = requestUrl.replace('{ruleName}', encodeURIComponent(ruleName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (routeFilterRuleParameters !== null && routeFilterRuleParameters !== undefined) { - let requestModelMapper = new client.models['RouteFilterRule']().mapper(); - requestModel = client.serialize(requestModelMapper, routeFilterRuleParameters, 'routeFilterRuleParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(routeFilterRuleParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['RouteFilterRule']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RouteFilterRule']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Updates a route in the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the route filter rule. - * - * @param {object} routeFilterRuleParameters Parameters supplied to the update - * route filter rule operation. - * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' - * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] - * - * @param {string} [routeFilterRuleParameters.id] Resource ID. - * - * @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 RouteFilterRule} 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 _beginUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, 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.'); - } - if (routeFilterRuleParameters === null || routeFilterRuleParameters === undefined) - { - routeFilterRuleParameters = {}; - } - let apiVersion = '2018-10-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 (routeFilterName === null || routeFilterName === undefined || typeof routeFilterName.valueOf() !== 'string') { - throw new Error('routeFilterName cannot be null or undefined and it must be of type string.'); - } - if (ruleName === null || ruleName === undefined || typeof ruleName.valueOf() !== 'string') { - throw new Error('ruleName cannot be null or undefined and it must be of type string.'); - } - if (routeFilterRuleParameters === null || routeFilterRuleParameters === undefined) { - throw new Error('routeFilterRuleParameters cannot be null or undefined.'); - } - 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/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{routeFilterName}', encodeURIComponent(routeFilterName)); - requestUrl = requestUrl.replace('{ruleName}', encodeURIComponent(ruleName)); - 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 = 'PATCH'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (routeFilterRuleParameters !== null && routeFilterRuleParameters !== undefined) { - let requestModelMapper = new client.models['PatchRouteFilterRule']().mapper(); - requestModel = client.serialize(requestModelMapper, routeFilterRuleParameters, 'routeFilterRuleParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(routeFilterRuleParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // 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['RouteFilterRule']().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 RouteFilterRules in a route filter. - * - * @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 RouteFilterRuleListResult} 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 _listByRouteFilterNext(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['RouteFilterRuleListResult']().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 RouteFilterRules. */ -class RouteFilterRules { - /** - * Create a RouteFilterRules. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._update = _update; - this._listByRouteFilter = _listByRouteFilter; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdate = _beginUpdate; - this._listByRouteFilterNext = _listByRouteFilterNext; - } - - /** - * Deletes the specified rule from a route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the rule. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, routeFilterName, ruleName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, routeFilterName, ruleName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified rule from a route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the rule. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, routeFilterName, ruleName, 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._deleteMethod(resourceGroupName, routeFilterName, ruleName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, routeFilterName, ruleName, options, optionalCallback); - } - } - - /** - * Gets the specified rule from a route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the rule. - * - * @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, routeFilterName, ruleName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, routeFilterName, ruleName, 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 rule from a route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the rule. - * - * @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 {RouteFilterRule} - 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 RouteFilterRule} 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, routeFilterName, ruleName, 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, routeFilterName, ruleName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, routeFilterName, ruleName, options, optionalCallback); - } - } - - /** - * Creates or updates a route in the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the route filter rule. - * - * @param {object} routeFilterRuleParameters Parameters supplied to the create - * or update route filter rule operation. - * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' - * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] - * - * @param {string} [routeFilterRuleParameters.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [routeFilterRuleParameters.location] Resource location. - * - * @param {string} [routeFilterRuleParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a route in the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the route filter rule. - * - * @param {object} routeFilterRuleParameters Parameters supplied to the create - * or update route filter rule operation. - * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' - * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] - * - * @param {string} [routeFilterRuleParameters.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [routeFilterRuleParameters.location] Resource location. - * - * @param {string} [routeFilterRuleParameters.id] Resource ID. - * - * @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 {RouteFilterRule} - 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 RouteFilterRule} 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. - */ - createOrUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, 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._createOrUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options, optionalCallback); - } - } - - /** - * Updates a route in the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the route filter rule. - * - * @param {object} routeFilterRuleParameters Parameters supplied to the update - * route filter rule operation. - * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' - * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] - * - * @param {string} [routeFilterRuleParameters.id] Resource ID. - * - * @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. - */ - updateWithHttpOperationResponse(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._update(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates a route in the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the route filter rule. - * - * @param {object} routeFilterRuleParameters Parameters supplied to the update - * route filter rule operation. - * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' - * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] - * - * @param {string} [routeFilterRuleParameters.id] Resource ID. - * - * @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 {RouteFilterRule} - 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 RouteFilterRule} 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. - */ - update(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, 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._update(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._update(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options, optionalCallback); - } - } - - /** - * Gets all RouteFilterRules in a route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @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. - */ - listByRouteFilterWithHttpOperationResponse(resourceGroupName, routeFilterName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByRouteFilter(resourceGroupName, routeFilterName, 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 RouteFilterRules in a route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @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 {RouteFilterRuleListResult} - 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 RouteFilterRuleListResult} 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. - */ - listByRouteFilter(resourceGroupName, routeFilterName, 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._listByRouteFilter(resourceGroupName, routeFilterName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByRouteFilter(resourceGroupName, routeFilterName, options, optionalCallback); - } - } - - /** - * Deletes the specified rule from a route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the rule. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, routeFilterName, ruleName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, routeFilterName, ruleName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified rule from a route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the rule. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, routeFilterName, ruleName, 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._beginDeleteMethod(resourceGroupName, routeFilterName, ruleName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, routeFilterName, ruleName, options, optionalCallback); - } - } - - /** - * Creates or updates a route in the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the route filter rule. - * - * @param {object} routeFilterRuleParameters Parameters supplied to the create - * or update route filter rule operation. - * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' - * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] - * - * @param {string} [routeFilterRuleParameters.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [routeFilterRuleParameters.location] Resource location. - * - * @param {string} [routeFilterRuleParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a route in the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the route filter rule. - * - * @param {object} routeFilterRuleParameters Parameters supplied to the create - * or update route filter rule operation. - * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' - * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] - * - * @param {string} [routeFilterRuleParameters.name] The name of the resource - * that is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [routeFilterRuleParameters.location] Resource location. - * - * @param {string} [routeFilterRuleParameters.id] Resource ID. - * - * @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 {RouteFilterRule} - 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 RouteFilterRule} 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. - */ - beginCreateOrUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, 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._beginCreateOrUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options, optionalCallback); - } - } - - /** - * Updates a route in the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the route filter rule. - * - * @param {object} routeFilterRuleParameters Parameters supplied to the update - * route filter rule operation. - * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' - * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] - * - * @param {string} [routeFilterRuleParameters.id] Resource ID. - * - * @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. - */ - beginUpdateWithHttpOperationResponse(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates a route in the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {string} ruleName The name of the route filter rule. - * - * @param {object} routeFilterRuleParameters Parameters supplied to the update - * route filter rule operation. - * - * @param {string} routeFilterRuleParameters.access The access type of the - * rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', - * 'Deny' - * - * @param {array} routeFilterRuleParameters.communities The collection for bgp - * community values to filter on. e.g. ['12076:5010','12076:5020'] - * - * @param {string} [routeFilterRuleParameters.id] Resource ID. - * - * @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 {RouteFilterRule} - 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 RouteFilterRule} 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. - */ - beginUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, 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._beginUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginUpdate(resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters, options, optionalCallback); - } - } - - /** - * Gets all RouteFilterRules in a route filter. - * - * @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. - */ - listByRouteFilterNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByRouteFilterNext(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 RouteFilterRules in a route filter. - * - * @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 {RouteFilterRuleListResult} - 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 RouteFilterRuleListResult} 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. - */ - listByRouteFilterNext(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._listByRouteFilterNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByRouteFilterNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = RouteFilterRules; diff --git a/lib/services/networkManagement2/lib/operations/routeFilters.js b/lib/services/networkManagement2/lib/operations/routeFilters.js deleted file mode 100644 index 668f33841..000000000 --- a/lib/services/networkManagement2/lib/operations/routeFilters.js +++ /dev/null @@ -1,2498 +0,0 @@ -/* - * 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; - - -/** - * Deletes the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, routeFilterName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, routeFilterName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced express route bgp - * peering resources. - * - * @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 RouteFilter} 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, routeFilterName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2018-10-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 (routeFilterName === null || routeFilterName === undefined || typeof routeFilterName.valueOf() !== 'string') { - throw new Error('routeFilterName 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 (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand 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/routeFilters/{routeFilterName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{routeFilterName}', encodeURIComponent(routeFilterName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } - 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['RouteFilter']().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); - }); -} - - -/** - * Creates or updates a route filter in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} routeFilterParameters Parameters supplied to the create or - * update route filter operation. - * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. - * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. - * - * @param {string} [routeFilterParameters.id] Resource ID. - * - * @param {string} [routeFilterParameters.location] Resource location. - * - * @param {object} [routeFilterParameters.tags] Resource tags. - * - * @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 RouteFilter} 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 _createOrUpdate(resourceGroupName, routeFilterName, routeFilterParameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, routeFilterName, routeFilterParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RouteFilter']().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); - }); - }); -} - - -/** - * Updates a route filter in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} routeFilterParameters Parameters supplied to the update - * route filter operation. - * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. - * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. - * - * @param {object} [routeFilterParameters.tags] Resource tags. - * - * @param {string} [routeFilterParameters.id] Resource ID. - * - * @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 RouteFilter} 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 _update(resourceGroupName, routeFilterName, routeFilterParameters, 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.'); - } - - // Send request - this.beginUpdate(resourceGroupName, routeFilterName, routeFilterParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RouteFilter']().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 route filters in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 RouteFilterListResult} 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 _listByResourceGroup(resourceGroupName, 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-10-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 (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/routeFilters'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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['RouteFilterListResult']().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 route filters in a subscription. - * - * @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 RouteFilterListResult} 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(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/routeFilters'; - 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['RouteFilterListResult']().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); - }); -} - -/** - * Deletes the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, routeFilterName, 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-10-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 (routeFilterName === null || routeFilterName === undefined || typeof routeFilterName.valueOf() !== 'string') { - throw new Error('routeFilterName 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/routeFilters/{routeFilterName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{routeFilterName}', encodeURIComponent(routeFilterName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates a route filter in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} routeFilterParameters Parameters supplied to the create or - * update route filter operation. - * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. - * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. - * - * @param {string} [routeFilterParameters.id] Resource ID. - * - * @param {string} [routeFilterParameters.location] Resource location. - * - * @param {object} [routeFilterParameters.tags] Resource tags. - * - * @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 RouteFilter} 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 _beginCreateOrUpdate(resourceGroupName, routeFilterName, routeFilterParameters, 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-10-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 (routeFilterName === null || routeFilterName === undefined || typeof routeFilterName.valueOf() !== 'string') { - throw new Error('routeFilterName cannot be null or undefined and it must be of type string.'); - } - if (routeFilterParameters === null || routeFilterParameters === undefined) { - throw new Error('routeFilterParameters cannot be null or undefined.'); - } - 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/routeFilters/{routeFilterName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{routeFilterName}', encodeURIComponent(routeFilterName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (routeFilterParameters !== null && routeFilterParameters !== undefined) { - let requestModelMapper = new client.models['RouteFilter']().mapper(); - requestModel = client.serialize(requestModelMapper, routeFilterParameters, 'routeFilterParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(routeFilterParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['RouteFilter']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RouteFilter']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Updates a route filter in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} routeFilterParameters Parameters supplied to the update - * route filter operation. - * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. - * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. - * - * @param {object} [routeFilterParameters.tags] Resource tags. - * - * @param {string} [routeFilterParameters.id] Resource ID. - * - * @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 RouteFilter} 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 _beginUpdate(resourceGroupName, routeFilterName, routeFilterParameters, 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-10-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 (routeFilterName === null || routeFilterName === undefined || typeof routeFilterName.valueOf() !== 'string') { - throw new Error('routeFilterName cannot be null or undefined and it must be of type string.'); - } - if (routeFilterParameters === null || routeFilterParameters === undefined) { - throw new Error('routeFilterParameters cannot be null or undefined.'); - } - 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/routeFilters/{routeFilterName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{routeFilterName}', encodeURIComponent(routeFilterName)); - 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 = 'PATCH'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (routeFilterParameters !== null && routeFilterParameters !== undefined) { - let requestModelMapper = new client.models['PatchRouteFilter']().mapper(); - requestModel = client.serialize(requestModelMapper, routeFilterParameters, 'routeFilterParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(routeFilterParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // 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['RouteFilter']().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 route filters in a resource group. - * - * @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 RouteFilterListResult} 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 _listByResourceGroupNext(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['RouteFilterListResult']().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 route filters in a subscription. - * - * @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 RouteFilterListResult} 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['RouteFilterListResult']().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 RouteFilters. */ -class RouteFilters { - /** - * Create a RouteFilters. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._update = _update; - this._listByResourceGroup = _listByResourceGroup; - this._list = _list; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdate = _beginUpdate; - this._listByResourceGroupNext = _listByResourceGroupNext; - this._listNext = _listNext; - } - - /** - * Deletes the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, routeFilterName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, routeFilterName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, routeFilterName, 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._deleteMethod(resourceGroupName, routeFilterName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, routeFilterName, options, optionalCallback); - } - } - - /** - * Gets the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced express route bgp - * peering resources. - * - * @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, routeFilterName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, routeFilterName, 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 route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced express route bgp - * peering resources. - * - * @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 {RouteFilter} - 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 RouteFilter} 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, routeFilterName, 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, routeFilterName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, routeFilterName, options, optionalCallback); - } - } - - /** - * Creates or updates a route filter in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} routeFilterParameters Parameters supplied to the create or - * update route filter operation. - * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. - * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. - * - * @param {string} [routeFilterParameters.id] Resource ID. - * - * @param {string} [routeFilterParameters.location] Resource location. - * - * @param {object} [routeFilterParameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, routeFilterName, routeFilterParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, routeFilterName, routeFilterParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a route filter in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} routeFilterParameters Parameters supplied to the create or - * update route filter operation. - * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. - * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. - * - * @param {string} [routeFilterParameters.id] Resource ID. - * - * @param {string} [routeFilterParameters.location] Resource location. - * - * @param {object} [routeFilterParameters.tags] Resource tags. - * - * @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 {RouteFilter} - 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 RouteFilter} 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. - */ - createOrUpdate(resourceGroupName, routeFilterName, routeFilterParameters, 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._createOrUpdate(resourceGroupName, routeFilterName, routeFilterParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, routeFilterName, routeFilterParameters, options, optionalCallback); - } - } - - /** - * Updates a route filter in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} routeFilterParameters Parameters supplied to the update - * route filter operation. - * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. - * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. - * - * @param {object} [routeFilterParameters.tags] Resource tags. - * - * @param {string} [routeFilterParameters.id] Resource ID. - * - * @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. - */ - updateWithHttpOperationResponse(resourceGroupName, routeFilterName, routeFilterParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._update(resourceGroupName, routeFilterName, routeFilterParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates a route filter in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} routeFilterParameters Parameters supplied to the update - * route filter operation. - * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. - * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. - * - * @param {object} [routeFilterParameters.tags] Resource tags. - * - * @param {string} [routeFilterParameters.id] Resource ID. - * - * @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 {RouteFilter} - 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 RouteFilter} 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. - */ - update(resourceGroupName, routeFilterName, routeFilterParameters, 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._update(resourceGroupName, routeFilterName, routeFilterParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._update(resourceGroupName, routeFilterName, routeFilterParameters, options, optionalCallback); - } - } - - /** - * Gets all route filters in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, 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 route filters in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {RouteFilterListResult} - 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 RouteFilterListResult} 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. - */ - listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroup(resourceGroupName, options, optionalCallback); - } - } - - /** - * Gets all route filters in a subscription. - * - * @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(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(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 route filters in a subscription. - * - * @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 {RouteFilterListResult} - 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 RouteFilterListResult} 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(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(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(options, optionalCallback); - } - } - - /** - * Deletes the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, routeFilterName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, routeFilterName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified route filter. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, routeFilterName, 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._beginDeleteMethod(resourceGroupName, routeFilterName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, routeFilterName, options, optionalCallback); - } - } - - /** - * Creates or updates a route filter in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} routeFilterParameters Parameters supplied to the create or - * update route filter operation. - * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. - * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. - * - * @param {string} [routeFilterParameters.id] Resource ID. - * - * @param {string} [routeFilterParameters.location] Resource location. - * - * @param {object} [routeFilterParameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, routeFilterName, routeFilterParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, routeFilterName, routeFilterParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a route filter in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} routeFilterParameters Parameters supplied to the create or - * update route filter operation. - * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. - * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. - * - * @param {string} [routeFilterParameters.id] Resource ID. - * - * @param {string} [routeFilterParameters.location] Resource location. - * - * @param {object} [routeFilterParameters.tags] Resource tags. - * - * @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 {RouteFilter} - 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 RouteFilter} 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. - */ - beginCreateOrUpdate(resourceGroupName, routeFilterName, routeFilterParameters, 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._beginCreateOrUpdate(resourceGroupName, routeFilterName, routeFilterParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, routeFilterName, routeFilterParameters, options, optionalCallback); - } - } - - /** - * Updates a route filter in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} routeFilterParameters Parameters supplied to the update - * route filter operation. - * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. - * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. - * - * @param {object} [routeFilterParameters.tags] Resource tags. - * - * @param {string} [routeFilterParameters.id] Resource ID. - * - * @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. - */ - beginUpdateWithHttpOperationResponse(resourceGroupName, routeFilterName, routeFilterParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginUpdate(resourceGroupName, routeFilterName, routeFilterParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates a route filter in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeFilterName The name of the route filter. - * - * @param {object} routeFilterParameters Parameters supplied to the update - * route filter operation. - * - * @param {array} [routeFilterParameters.rules] Collection of RouteFilterRules - * contained within a route filter. - * - * @param {array} [routeFilterParameters.peerings] A collection of references - * to express route circuit peerings. - * - * @param {object} [routeFilterParameters.tags] Resource tags. - * - * @param {string} [routeFilterParameters.id] Resource ID. - * - * @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 {RouteFilter} - 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 RouteFilter} 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. - */ - beginUpdate(resourceGroupName, routeFilterName, routeFilterParameters, 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._beginUpdate(resourceGroupName, routeFilterName, routeFilterParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginUpdate(resourceGroupName, routeFilterName, routeFilterParameters, options, optionalCallback); - } - } - - /** - * Gets all route filters in a resource group. - * - * @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. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroupNext(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 route filters in a resource group. - * - * @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 {RouteFilterListResult} - 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 RouteFilterListResult} 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. - */ - listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); - } - } - - /** - * Gets all route filters in a subscription. - * - * @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 route filters in a subscription. - * - * @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 {RouteFilterListResult} - 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 RouteFilterListResult} 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 = RouteFilters; diff --git a/lib/services/networkManagement2/lib/operations/routeTables.js b/lib/services/networkManagement2/lib/operations/routeTables.js deleted file mode 100644 index 3820157ee..000000000 --- a/lib/services/networkManagement2/lib/operations/routeTables.js +++ /dev/null @@ -1,2483 +0,0 @@ -/* - * 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; - - -/** - * Deletes the specified route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, routeTableName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, routeTableName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets the specified route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 RouteTable} 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, routeTableName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2018-10-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 (routeTableName === null || routeTableName === undefined || typeof routeTableName.valueOf() !== 'string') { - throw new Error('routeTableName 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 (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand 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/routeTables/{routeTableName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{routeTableName}', encodeURIComponent(routeTableName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } - 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['RouteTable']().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); - }); -} - - -/** - * Create or updates a route table in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {object} parameters Parameters supplied to the create or update route - * table operation. - * - * @param {array} [parameters.routes] Collection of routes contained within a - * route table. - * - * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets - * whether to disable the routes learned by BGP on that route table. True means - * disable. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 RouteTable} 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 _createOrUpdate(resourceGroupName, routeTableName, parameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, routeTableName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RouteTable']().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); - }); - }); -} - - -/** - * Updates a route table tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {object} parameters Parameters supplied to update route table tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 RouteTable} 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 _updateTags(resourceGroupName, routeTableName, parameters, 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.'); - } - - // Send request - this.beginUpdateTags(resourceGroupName, routeTableName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RouteTable']().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 route tables in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 RouteTableListResult} 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, 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-10-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 (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/routeTables'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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['RouteTableListResult']().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 route tables in a subscription. - * - * @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 RouteTableListResult} 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 _listAll(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/routeTables'; - 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['RouteTableListResult']().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); - }); -} - -/** - * Deletes the specified route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, routeTableName, 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-10-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 (routeTableName === null || routeTableName === undefined || typeof routeTableName.valueOf() !== 'string') { - throw new Error('routeTableName 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/routeTables/{routeTableName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{routeTableName}', encodeURIComponent(routeTableName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Create or updates a route table in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {object} parameters Parameters supplied to the create or update route - * table operation. - * - * @param {array} [parameters.routes] Collection of routes contained within a - * route table. - * - * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets - * whether to disable the routes learned by BGP on that route table. True means - * disable. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 RouteTable} 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 _beginCreateOrUpdate(resourceGroupName, routeTableName, parameters, 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-10-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 (routeTableName === null || routeTableName === undefined || typeof routeTableName.valueOf() !== 'string') { - throw new Error('routeTableName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/routeTables/{routeTableName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{routeTableName}', encodeURIComponent(routeTableName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['RouteTable']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['RouteTable']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RouteTable']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Updates a route table tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {object} parameters Parameters supplied to update route table tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 RouteTable} 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 _beginUpdateTags(resourceGroupName, routeTableName, parameters, 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-10-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 (routeTableName === null || routeTableName === undefined || typeof routeTableName.valueOf() !== 'string') { - throw new Error('routeTableName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/routeTables/{routeTableName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{routeTableName}', encodeURIComponent(routeTableName)); - 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 = 'PATCH'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['TagsObject']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // 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['RouteTable']().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 route tables in a resource group. - * - * @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 RouteTableListResult} 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['RouteTableListResult']().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 route tables in a subscription. - * - * @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 RouteTableListResult} 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 _listAllNext(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['RouteTableListResult']().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 RouteTables. */ -class RouteTables { - /** - * Create a RouteTables. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._updateTags = _updateTags; - this._list = _list; - this._listAll = _listAll; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdateTags = _beginUpdateTags; - this._listNext = _listNext; - this._listAllNext = _listAllNext; - } - - /** - * Deletes the specified route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, routeTableName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, routeTableName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, routeTableName, 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._deleteMethod(resourceGroupName, routeTableName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, routeTableName, options, optionalCallback); - } - } - - /** - * Gets the specified route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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, routeTableName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, routeTableName, 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 route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {RouteTable} - 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 RouteTable} 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, routeTableName, 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, routeTableName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, routeTableName, options, optionalCallback); - } - } - - /** - * Create or updates a route table in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {object} parameters Parameters supplied to the create or update route - * table operation. - * - * @param {array} [parameters.routes] Collection of routes contained within a - * route table. - * - * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets - * whether to disable the routes learned by BGP on that route table. True means - * disable. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, routeTableName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, routeTableName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Create or updates a route table in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {object} parameters Parameters supplied to the create or update route - * table operation. - * - * @param {array} [parameters.routes] Collection of routes contained within a - * route table. - * - * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets - * whether to disable the routes learned by BGP on that route table. True means - * disable. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {RouteTable} - 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 RouteTable} 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. - */ - createOrUpdate(resourceGroupName, routeTableName, parameters, 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._createOrUpdate(resourceGroupName, routeTableName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, routeTableName, parameters, options, optionalCallback); - } - } - - /** - * Updates a route table tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {object} parameters Parameters supplied to update route table tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName, routeTableName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateTags(resourceGroupName, routeTableName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates a route table tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {object} parameters Parameters supplied to update route table tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {RouteTable} - 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 RouteTable} 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. - */ - updateTags(resourceGroupName, routeTableName, parameters, 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._updateTags(resourceGroupName, routeTableName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateTags(resourceGroupName, routeTableName, parameters, options, optionalCallback); - } - } - - /** - * Gets all route tables in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, 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 route tables in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {RouteTableListResult} - 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 RouteTableListResult} 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, 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, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, options, optionalCallback); - } - } - - /** - * Gets all route tables in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAll(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 route tables in a subscription. - * - * @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 {RouteTableListResult} - 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 RouteTableListResult} 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. - */ - listAll(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._listAll(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAll(options, optionalCallback); - } - } - - /** - * Deletes the specified route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, routeTableName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, routeTableName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, routeTableName, 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._beginDeleteMethod(resourceGroupName, routeTableName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, routeTableName, options, optionalCallback); - } - } - - /** - * Create or updates a route table in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {object} parameters Parameters supplied to the create or update route - * table operation. - * - * @param {array} [parameters.routes] Collection of routes contained within a - * route table. - * - * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets - * whether to disable the routes learned by BGP on that route table. True means - * disable. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, routeTableName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, routeTableName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Create or updates a route table in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {object} parameters Parameters supplied to the create or update route - * table operation. - * - * @param {array} [parameters.routes] Collection of routes contained within a - * route table. - * - * @param {boolean} [parameters.disableBgpRoutePropagation] Gets or sets - * whether to disable the routes learned by BGP on that route table. True means - * disable. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {RouteTable} - 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 RouteTable} 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. - */ - beginCreateOrUpdate(resourceGroupName, routeTableName, parameters, 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._beginCreateOrUpdate(resourceGroupName, routeTableName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, routeTableName, parameters, options, optionalCallback); - } - } - - /** - * Updates a route table tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {object} parameters Parameters supplied to update route table tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName, routeTableName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginUpdateTags(resourceGroupName, routeTableName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates a route table tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {object} parameters Parameters supplied to update route table tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {RouteTable} - 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 RouteTable} 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. - */ - beginUpdateTags(resourceGroupName, routeTableName, parameters, 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._beginUpdateTags(resourceGroupName, routeTableName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginUpdateTags(resourceGroupName, routeTableName, parameters, options, optionalCallback); - } - } - - /** - * Gets all route tables in a resource group. - * - * @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 route tables in a resource group. - * - * @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 {RouteTableListResult} - 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 RouteTableListResult} 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); - } - } - - /** - * Gets all route tables in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAllNext(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 route tables in a subscription. - * - * @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 {RouteTableListResult} - 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 RouteTableListResult} 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. - */ - listAllNext(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._listAllNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAllNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = RouteTables; diff --git a/lib/services/networkManagement2/lib/operations/routes.js b/lib/services/networkManagement2/lib/operations/routes.js deleted file mode 100644 index 4ae9b61e2..000000000 --- a/lib/services/networkManagement2/lib/operations/routes.js +++ /dev/null @@ -1,1700 +0,0 @@ -/* - * 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; - - -/** - * Deletes the specified route from a route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, routeTableName, routeName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, routeTableName, routeName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets the specified route from a route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @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 Route} 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, routeTableName, routeName, 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-10-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 (routeTableName === null || routeTableName === undefined || typeof routeTableName.valueOf() !== 'string') { - throw new Error('routeTableName cannot be null or undefined and it must be of type string.'); - } - if (routeName === null || routeName === undefined || typeof routeName.valueOf() !== 'string') { - throw new Error('routeName 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/routeTables/{routeTableName}/routes/{routeName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{routeTableName}', encodeURIComponent(routeTableName)); - requestUrl = requestUrl.replace('{routeName}', encodeURIComponent(routeName)); - 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['Route']().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); - }); -} - - -/** - * Creates or updates a route in the specified route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @param {object} routeParameters Parameters supplied to the create or update - * route operation. - * - * @param {string} [routeParameters.addressPrefix] The destination CIDR to - * which the route applies. - * - * @param {string} routeParameters.nextHopType The type of Azure hop the packet - * should be sent to. Possible values are: 'VirtualNetworkGateway', - * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values - * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', - * 'VirtualAppliance', 'None' - * - * @param {string} [routeParameters.nextHopIpAddress] The IP address packets - * should be forwarded to. Next hop values are only allowed in routes where the - * next hop type is VirtualAppliance. - * - * @param {string} [routeParameters.provisioningState] The provisioning state - * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [routeParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [routeParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [routeParameters.id] Resource ID. - * - * @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 Route} 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 _createOrUpdate(resourceGroupName, routeTableName, routeName, routeParameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, routeTableName, routeName, routeParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Route']().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 routes in a route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @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 RouteListResult} 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, routeTableName, 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-10-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 (routeTableName === null || routeTableName === undefined || typeof routeTableName.valueOf() !== 'string') { - throw new Error('routeTableName 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/routeTables/{routeTableName}/routes'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{routeTableName}', encodeURIComponent(routeTableName)); - 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['RouteListResult']().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); - }); -} - -/** - * Deletes the specified route from a route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, routeTableName, routeName, 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-10-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 (routeTableName === null || routeTableName === undefined || typeof routeTableName.valueOf() !== 'string') { - throw new Error('routeTableName cannot be null or undefined and it must be of type string.'); - } - if (routeName === null || routeName === undefined || typeof routeName.valueOf() !== 'string') { - throw new Error('routeName 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/routeTables/{routeTableName}/routes/{routeName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{routeTableName}', encodeURIComponent(routeTableName)); - requestUrl = requestUrl.replace('{routeName}', encodeURIComponent(routeName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates a route in the specified route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @param {object} routeParameters Parameters supplied to the create or update - * route operation. - * - * @param {string} [routeParameters.addressPrefix] The destination CIDR to - * which the route applies. - * - * @param {string} routeParameters.nextHopType The type of Azure hop the packet - * should be sent to. Possible values are: 'VirtualNetworkGateway', - * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values - * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', - * 'VirtualAppliance', 'None' - * - * @param {string} [routeParameters.nextHopIpAddress] The IP address packets - * should be forwarded to. Next hop values are only allowed in routes where the - * next hop type is VirtualAppliance. - * - * @param {string} [routeParameters.provisioningState] The provisioning state - * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [routeParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [routeParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [routeParameters.id] Resource ID. - * - * @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 Route} 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 _beginCreateOrUpdate(resourceGroupName, routeTableName, routeName, routeParameters, 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-10-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 (routeTableName === null || routeTableName === undefined || typeof routeTableName.valueOf() !== 'string') { - throw new Error('routeTableName cannot be null or undefined and it must be of type string.'); - } - if (routeName === null || routeName === undefined || typeof routeName.valueOf() !== 'string') { - throw new Error('routeName cannot be null or undefined and it must be of type string.'); - } - if (routeParameters === null || routeParameters === undefined) { - throw new Error('routeParameters cannot be null or undefined.'); - } - 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/routeTables/{routeTableName}/routes/{routeName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{routeTableName}', encodeURIComponent(routeTableName)); - requestUrl = requestUrl.replace('{routeName}', encodeURIComponent(routeName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (routeParameters !== null && routeParameters !== undefined) { - let requestModelMapper = new client.models['Route']().mapper(); - requestModel = client.serialize(requestModelMapper, routeParameters, 'routeParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(routeParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['Route']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Route']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Gets all routes in a route table. - * - * @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 RouteListResult} 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['RouteListResult']().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 Routes. */ -class Routes { - /** - * Create a Routes. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._list = _list; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._listNext = _listNext; - } - - /** - * Deletes the specified route from a route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, routeTableName, routeName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, routeTableName, routeName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified route from a route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, routeTableName, routeName, 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._deleteMethod(resourceGroupName, routeTableName, routeName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, routeTableName, routeName, options, optionalCallback); - } - } - - /** - * Gets the specified route from a route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @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, routeTableName, routeName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, routeTableName, routeName, 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 route from a route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @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 {Route} - 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 Route} 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, routeTableName, routeName, 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, routeTableName, routeName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, routeTableName, routeName, options, optionalCallback); - } - } - - /** - * Creates or updates a route in the specified route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @param {object} routeParameters Parameters supplied to the create or update - * route operation. - * - * @param {string} [routeParameters.addressPrefix] The destination CIDR to - * which the route applies. - * - * @param {string} routeParameters.nextHopType The type of Azure hop the packet - * should be sent to. Possible values are: 'VirtualNetworkGateway', - * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values - * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', - * 'VirtualAppliance', 'None' - * - * @param {string} [routeParameters.nextHopIpAddress] The IP address packets - * should be forwarded to. Next hop values are only allowed in routes where the - * next hop type is VirtualAppliance. - * - * @param {string} [routeParameters.provisioningState] The provisioning state - * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [routeParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [routeParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [routeParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, routeTableName, routeName, routeParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, routeTableName, routeName, routeParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a route in the specified route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @param {object} routeParameters Parameters supplied to the create or update - * route operation. - * - * @param {string} [routeParameters.addressPrefix] The destination CIDR to - * which the route applies. - * - * @param {string} routeParameters.nextHopType The type of Azure hop the packet - * should be sent to. Possible values are: 'VirtualNetworkGateway', - * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values - * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', - * 'VirtualAppliance', 'None' - * - * @param {string} [routeParameters.nextHopIpAddress] The IP address packets - * should be forwarded to. Next hop values are only allowed in routes where the - * next hop type is VirtualAppliance. - * - * @param {string} [routeParameters.provisioningState] The provisioning state - * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [routeParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [routeParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [routeParameters.id] Resource ID. - * - * @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 {Route} - 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 Route} 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. - */ - createOrUpdate(resourceGroupName, routeTableName, routeName, routeParameters, 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._createOrUpdate(resourceGroupName, routeTableName, routeName, routeParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, routeTableName, routeName, routeParameters, options, optionalCallback); - } - } - - /** - * Gets all routes in a route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @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, routeTableName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, routeTableName, 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 routes in a route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @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 {RouteListResult} - 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 RouteListResult} 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, routeTableName, 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, routeTableName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, routeTableName, options, optionalCallback); - } - } - - /** - * Deletes the specified route from a route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, routeTableName, routeName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, routeTableName, routeName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified route from a route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, routeTableName, routeName, 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._beginDeleteMethod(resourceGroupName, routeTableName, routeName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, routeTableName, routeName, options, optionalCallback); - } - } - - /** - * Creates or updates a route in the specified route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @param {object} routeParameters Parameters supplied to the create or update - * route operation. - * - * @param {string} [routeParameters.addressPrefix] The destination CIDR to - * which the route applies. - * - * @param {string} routeParameters.nextHopType The type of Azure hop the packet - * should be sent to. Possible values are: 'VirtualNetworkGateway', - * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values - * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', - * 'VirtualAppliance', 'None' - * - * @param {string} [routeParameters.nextHopIpAddress] The IP address packets - * should be forwarded to. Next hop values are only allowed in routes where the - * next hop type is VirtualAppliance. - * - * @param {string} [routeParameters.provisioningState] The provisioning state - * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [routeParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [routeParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [routeParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, routeTableName, routeName, routeParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, routeTableName, routeName, routeParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a route in the specified route table. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} routeTableName The name of the route table. - * - * @param {string} routeName The name of the route. - * - * @param {object} routeParameters Parameters supplied to the create or update - * route operation. - * - * @param {string} [routeParameters.addressPrefix] The destination CIDR to - * which the route applies. - * - * @param {string} routeParameters.nextHopType The type of Azure hop the packet - * should be sent to. Possible values are: 'VirtualNetworkGateway', - * 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values - * include: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', - * 'VirtualAppliance', 'None' - * - * @param {string} [routeParameters.nextHopIpAddress] The IP address packets - * should be forwarded to. Next hop values are only allowed in routes where the - * next hop type is VirtualAppliance. - * - * @param {string} [routeParameters.provisioningState] The provisioning state - * of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [routeParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [routeParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [routeParameters.id] Resource ID. - * - * @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 {Route} - 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 Route} 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. - */ - beginCreateOrUpdate(resourceGroupName, routeTableName, routeName, routeParameters, 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._beginCreateOrUpdate(resourceGroupName, routeTableName, routeName, routeParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, routeTableName, routeName, routeParameters, options, optionalCallback); - } - } - - /** - * Gets all routes in a route table. - * - * @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 routes in a route table. - * - * @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 {RouteListResult} - 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 RouteListResult} 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 = Routes; diff --git a/lib/services/networkManagement2/lib/operations/securityRules.js b/lib/services/networkManagement2/lib/operations/securityRules.js deleted file mode 100644 index de8ea23ef..000000000 --- a/lib/services/networkManagement2/lib/operations/securityRules.js +++ /dev/null @@ -1,1998 +0,0 @@ -/* - * 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; - - -/** - * Deletes the specified network security rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} securityRuleName The name of the security rule. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, networkSecurityGroupName, securityRuleName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, networkSecurityGroupName, securityRuleName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Get the specified network security rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} securityRuleName The name of the security rule. - * - * @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 SecurityRule} 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, networkSecurityGroupName, securityRuleName, 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-10-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 (networkSecurityGroupName === null || networkSecurityGroupName === undefined || typeof networkSecurityGroupName.valueOf() !== 'string') { - throw new Error('networkSecurityGroupName cannot be null or undefined and it must be of type string.'); - } - if (securityRuleName === null || securityRuleName === undefined || typeof securityRuleName.valueOf() !== 'string') { - throw new Error('securityRuleName 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/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkSecurityGroupName}', encodeURIComponent(networkSecurityGroupName)); - requestUrl = requestUrl.replace('{securityRuleName}', encodeURIComponent(securityRuleName)); - 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['SecurityRule']().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); - }); -} - - -/** - * Creates or updates a security rule in the specified network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} securityRuleName The name of the security rule. - * - * @param {object} securityRuleParameters Parameters supplied to the create or - * update network security rule operation. - * - * @param {string} [securityRuleParameters.description] A description for this - * rule. Restricted to 140 chars. - * - * @param {string} securityRuleParameters.protocol Network protocol this rule - * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values - * include: 'Tcp', 'Udp', '*' - * - * @param {string} [securityRuleParameters.sourcePortRange] The source port or - * range. Integer or range between 0 and 65535. Asterix '*' can also be used to - * match all ports. - * - * @param {string} [securityRuleParameters.destinationPortRange] The - * destination port or range. Integer or range between 0 and 65535. Asterix '*' - * can also be used to match all ports. - * - * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or - * source IP range. Asterix '*' can also be used to match all source IPs. - * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' - * can also be used. If this is an ingress rule, specifies where network - * traffic originates from. - * - * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or - * source IP ranges. - * - * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The - * application security group specified as source. - * - * @param {string} [securityRuleParameters.destinationAddressPrefix] The - * destination address prefix. CIDR or destination IP range. Asterix '*' can - * also be used to match all source IPs. Default tags such as 'VirtualNetwork', - * 'AzureLoadBalancer' and 'Internet' can also be used. - * - * @param {array} [securityRuleParameters.destinationAddressPrefixes] The - * destination address prefixes. CIDR or destination IP ranges. - * - * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] - * The application security group specified as destination. - * - * @param {array} [securityRuleParameters.sourcePortRanges] The source port - * ranges. - * - * @param {array} [securityRuleParameters.destinationPortRanges] The - * destination port ranges. - * - * @param {string} securityRuleParameters.access The network traffic is allowed - * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: - * 'Allow', 'Deny' - * - * @param {number} [securityRuleParameters.priority] The priority of the rule. - * The value can be between 100 and 4096. The priority number must be unique - * for each rule in the collection. The lower the priority number, the higher - * the priority of the rule. - * - * @param {string} securityRuleParameters.direction The direction of the rule. - * The direction specifies if rule will be evaluated on incoming or outcoming - * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values - * include: 'Inbound', 'Outbound' - * - * @param {string} [securityRuleParameters.provisioningState] The provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [securityRuleParameters.name] The name of the resource that - * is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [securityRuleParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [securityRuleParameters.id] Resource ID. - * - * @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 SecurityRule} 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 _createOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SecurityRule']().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 security rules in a network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @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 SecurityRuleListResult} 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, networkSecurityGroupName, 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-10-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 (networkSecurityGroupName === null || networkSecurityGroupName === undefined || typeof networkSecurityGroupName.valueOf() !== 'string') { - throw new Error('networkSecurityGroupName 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/networkSecurityGroups/{networkSecurityGroupName}/securityRules'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkSecurityGroupName}', encodeURIComponent(networkSecurityGroupName)); - 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['SecurityRuleListResult']().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); - }); -} - -/** - * Deletes the specified network security rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} securityRuleName The name of the security rule. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, networkSecurityGroupName, securityRuleName, 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-10-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 (networkSecurityGroupName === null || networkSecurityGroupName === undefined || typeof networkSecurityGroupName.valueOf() !== 'string') { - throw new Error('networkSecurityGroupName cannot be null or undefined and it must be of type string.'); - } - if (securityRuleName === null || securityRuleName === undefined || typeof securityRuleName.valueOf() !== 'string') { - throw new Error('securityRuleName 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/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkSecurityGroupName}', encodeURIComponent(networkSecurityGroupName)); - requestUrl = requestUrl.replace('{securityRuleName}', encodeURIComponent(securityRuleName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates a security rule in the specified network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} securityRuleName The name of the security rule. - * - * @param {object} securityRuleParameters Parameters supplied to the create or - * update network security rule operation. - * - * @param {string} [securityRuleParameters.description] A description for this - * rule. Restricted to 140 chars. - * - * @param {string} securityRuleParameters.protocol Network protocol this rule - * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values - * include: 'Tcp', 'Udp', '*' - * - * @param {string} [securityRuleParameters.sourcePortRange] The source port or - * range. Integer or range between 0 and 65535. Asterix '*' can also be used to - * match all ports. - * - * @param {string} [securityRuleParameters.destinationPortRange] The - * destination port or range. Integer or range between 0 and 65535. Asterix '*' - * can also be used to match all ports. - * - * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or - * source IP range. Asterix '*' can also be used to match all source IPs. - * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' - * can also be used. If this is an ingress rule, specifies where network - * traffic originates from. - * - * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or - * source IP ranges. - * - * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The - * application security group specified as source. - * - * @param {string} [securityRuleParameters.destinationAddressPrefix] The - * destination address prefix. CIDR or destination IP range. Asterix '*' can - * also be used to match all source IPs. Default tags such as 'VirtualNetwork', - * 'AzureLoadBalancer' and 'Internet' can also be used. - * - * @param {array} [securityRuleParameters.destinationAddressPrefixes] The - * destination address prefixes. CIDR or destination IP ranges. - * - * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] - * The application security group specified as destination. - * - * @param {array} [securityRuleParameters.sourcePortRanges] The source port - * ranges. - * - * @param {array} [securityRuleParameters.destinationPortRanges] The - * destination port ranges. - * - * @param {string} securityRuleParameters.access The network traffic is allowed - * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: - * 'Allow', 'Deny' - * - * @param {number} [securityRuleParameters.priority] The priority of the rule. - * The value can be between 100 and 4096. The priority number must be unique - * for each rule in the collection. The lower the priority number, the higher - * the priority of the rule. - * - * @param {string} securityRuleParameters.direction The direction of the rule. - * The direction specifies if rule will be evaluated on incoming or outcoming - * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values - * include: 'Inbound', 'Outbound' - * - * @param {string} [securityRuleParameters.provisioningState] The provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [securityRuleParameters.name] The name of the resource that - * is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [securityRuleParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [securityRuleParameters.id] Resource ID. - * - * @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 SecurityRule} 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 _beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, 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-10-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 (networkSecurityGroupName === null || networkSecurityGroupName === undefined || typeof networkSecurityGroupName.valueOf() !== 'string') { - throw new Error('networkSecurityGroupName cannot be null or undefined and it must be of type string.'); - } - if (securityRuleName === null || securityRuleName === undefined || typeof securityRuleName.valueOf() !== 'string') { - throw new Error('securityRuleName cannot be null or undefined and it must be of type string.'); - } - if (securityRuleParameters === null || securityRuleParameters === undefined) { - throw new Error('securityRuleParameters cannot be null or undefined.'); - } - 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/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{networkSecurityGroupName}', encodeURIComponent(networkSecurityGroupName)); - requestUrl = requestUrl.replace('{securityRuleName}', encodeURIComponent(securityRuleName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (securityRuleParameters !== null && securityRuleParameters !== undefined) { - let requestModelMapper = new client.models['SecurityRule']().mapper(); - requestModel = client.serialize(requestModelMapper, securityRuleParameters, 'securityRuleParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(securityRuleParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['SecurityRule']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SecurityRule']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Gets all security rules in a network security group. - * - * @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 SecurityRuleListResult} 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['SecurityRuleListResult']().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 SecurityRules. */ -class SecurityRules { - /** - * Create a SecurityRules. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._list = _list; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._listNext = _listNext; - } - - /** - * Deletes the specified network security rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} securityRuleName The name of the security rule. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, networkSecurityGroupName, securityRuleName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, networkSecurityGroupName, securityRuleName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified network security rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} securityRuleName The name of the security rule. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, networkSecurityGroupName, securityRuleName, 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._deleteMethod(resourceGroupName, networkSecurityGroupName, securityRuleName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, networkSecurityGroupName, securityRuleName, options, optionalCallback); - } - } - - /** - * Get the specified network security rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} securityRuleName The name of the security rule. - * - * @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, networkSecurityGroupName, securityRuleName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, networkSecurityGroupName, securityRuleName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Get the specified network security rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} securityRuleName The name of the security rule. - * - * @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 {SecurityRule} - 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 SecurityRule} 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, networkSecurityGroupName, securityRuleName, 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, networkSecurityGroupName, securityRuleName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, networkSecurityGroupName, securityRuleName, options, optionalCallback); - } - } - - /** - * Creates or updates a security rule in the specified network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} securityRuleName The name of the security rule. - * - * @param {object} securityRuleParameters Parameters supplied to the create or - * update network security rule operation. - * - * @param {string} [securityRuleParameters.description] A description for this - * rule. Restricted to 140 chars. - * - * @param {string} securityRuleParameters.protocol Network protocol this rule - * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values - * include: 'Tcp', 'Udp', '*' - * - * @param {string} [securityRuleParameters.sourcePortRange] The source port or - * range. Integer or range between 0 and 65535. Asterix '*' can also be used to - * match all ports. - * - * @param {string} [securityRuleParameters.destinationPortRange] The - * destination port or range. Integer or range between 0 and 65535. Asterix '*' - * can also be used to match all ports. - * - * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or - * source IP range. Asterix '*' can also be used to match all source IPs. - * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' - * can also be used. If this is an ingress rule, specifies where network - * traffic originates from. - * - * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or - * source IP ranges. - * - * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The - * application security group specified as source. - * - * @param {string} [securityRuleParameters.destinationAddressPrefix] The - * destination address prefix. CIDR or destination IP range. Asterix '*' can - * also be used to match all source IPs. Default tags such as 'VirtualNetwork', - * 'AzureLoadBalancer' and 'Internet' can also be used. - * - * @param {array} [securityRuleParameters.destinationAddressPrefixes] The - * destination address prefixes. CIDR or destination IP ranges. - * - * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] - * The application security group specified as destination. - * - * @param {array} [securityRuleParameters.sourcePortRanges] The source port - * ranges. - * - * @param {array} [securityRuleParameters.destinationPortRanges] The - * destination port ranges. - * - * @param {string} securityRuleParameters.access The network traffic is allowed - * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: - * 'Allow', 'Deny' - * - * @param {number} [securityRuleParameters.priority] The priority of the rule. - * The value can be between 100 and 4096. The priority number must be unique - * for each rule in the collection. The lower the priority number, the higher - * the priority of the rule. - * - * @param {string} securityRuleParameters.direction The direction of the rule. - * The direction specifies if rule will be evaluated on incoming or outcoming - * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values - * include: 'Inbound', 'Outbound' - * - * @param {string} [securityRuleParameters.provisioningState] The provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [securityRuleParameters.name] The name of the resource that - * is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [securityRuleParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [securityRuleParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a security rule in the specified network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} securityRuleName The name of the security rule. - * - * @param {object} securityRuleParameters Parameters supplied to the create or - * update network security rule operation. - * - * @param {string} [securityRuleParameters.description] A description for this - * rule. Restricted to 140 chars. - * - * @param {string} securityRuleParameters.protocol Network protocol this rule - * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values - * include: 'Tcp', 'Udp', '*' - * - * @param {string} [securityRuleParameters.sourcePortRange] The source port or - * range. Integer or range between 0 and 65535. Asterix '*' can also be used to - * match all ports. - * - * @param {string} [securityRuleParameters.destinationPortRange] The - * destination port or range. Integer or range between 0 and 65535. Asterix '*' - * can also be used to match all ports. - * - * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or - * source IP range. Asterix '*' can also be used to match all source IPs. - * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' - * can also be used. If this is an ingress rule, specifies where network - * traffic originates from. - * - * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or - * source IP ranges. - * - * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The - * application security group specified as source. - * - * @param {string} [securityRuleParameters.destinationAddressPrefix] The - * destination address prefix. CIDR or destination IP range. Asterix '*' can - * also be used to match all source IPs. Default tags such as 'VirtualNetwork', - * 'AzureLoadBalancer' and 'Internet' can also be used. - * - * @param {array} [securityRuleParameters.destinationAddressPrefixes] The - * destination address prefixes. CIDR or destination IP ranges. - * - * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] - * The application security group specified as destination. - * - * @param {array} [securityRuleParameters.sourcePortRanges] The source port - * ranges. - * - * @param {array} [securityRuleParameters.destinationPortRanges] The - * destination port ranges. - * - * @param {string} securityRuleParameters.access The network traffic is allowed - * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: - * 'Allow', 'Deny' - * - * @param {number} [securityRuleParameters.priority] The priority of the rule. - * The value can be between 100 and 4096. The priority number must be unique - * for each rule in the collection. The lower the priority number, the higher - * the priority of the rule. - * - * @param {string} securityRuleParameters.direction The direction of the rule. - * The direction specifies if rule will be evaluated on incoming or outcoming - * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values - * include: 'Inbound', 'Outbound' - * - * @param {string} [securityRuleParameters.provisioningState] The provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [securityRuleParameters.name] The name of the resource that - * is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [securityRuleParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [securityRuleParameters.id] Resource ID. - * - * @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 {SecurityRule} - 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 SecurityRule} 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. - */ - createOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, 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._createOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, options, optionalCallback); - } - } - - /** - * Gets all security rules in a network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @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, networkSecurityGroupName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, networkSecurityGroupName, 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 security rules in a network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @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 {SecurityRuleListResult} - 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 SecurityRuleListResult} 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, networkSecurityGroupName, 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, networkSecurityGroupName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, networkSecurityGroupName, options, optionalCallback); - } - } - - /** - * Deletes the specified network security rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} securityRuleName The name of the security rule. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, networkSecurityGroupName, securityRuleName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, networkSecurityGroupName, securityRuleName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified network security rule. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} securityRuleName The name of the security rule. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, networkSecurityGroupName, securityRuleName, 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._beginDeleteMethod(resourceGroupName, networkSecurityGroupName, securityRuleName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, networkSecurityGroupName, securityRuleName, options, optionalCallback); - } - } - - /** - * Creates or updates a security rule in the specified network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} securityRuleName The name of the security rule. - * - * @param {object} securityRuleParameters Parameters supplied to the create or - * update network security rule operation. - * - * @param {string} [securityRuleParameters.description] A description for this - * rule. Restricted to 140 chars. - * - * @param {string} securityRuleParameters.protocol Network protocol this rule - * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values - * include: 'Tcp', 'Udp', '*' - * - * @param {string} [securityRuleParameters.sourcePortRange] The source port or - * range. Integer or range between 0 and 65535. Asterix '*' can also be used to - * match all ports. - * - * @param {string} [securityRuleParameters.destinationPortRange] The - * destination port or range. Integer or range between 0 and 65535. Asterix '*' - * can also be used to match all ports. - * - * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or - * source IP range. Asterix '*' can also be used to match all source IPs. - * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' - * can also be used. If this is an ingress rule, specifies where network - * traffic originates from. - * - * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or - * source IP ranges. - * - * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The - * application security group specified as source. - * - * @param {string} [securityRuleParameters.destinationAddressPrefix] The - * destination address prefix. CIDR or destination IP range. Asterix '*' can - * also be used to match all source IPs. Default tags such as 'VirtualNetwork', - * 'AzureLoadBalancer' and 'Internet' can also be used. - * - * @param {array} [securityRuleParameters.destinationAddressPrefixes] The - * destination address prefixes. CIDR or destination IP ranges. - * - * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] - * The application security group specified as destination. - * - * @param {array} [securityRuleParameters.sourcePortRanges] The source port - * ranges. - * - * @param {array} [securityRuleParameters.destinationPortRanges] The - * destination port ranges. - * - * @param {string} securityRuleParameters.access The network traffic is allowed - * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: - * 'Allow', 'Deny' - * - * @param {number} [securityRuleParameters.priority] The priority of the rule. - * The value can be between 100 and 4096. The priority number must be unique - * for each rule in the collection. The lower the priority number, the higher - * the priority of the rule. - * - * @param {string} securityRuleParameters.direction The direction of the rule. - * The direction specifies if rule will be evaluated on incoming or outcoming - * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values - * include: 'Inbound', 'Outbound' - * - * @param {string} [securityRuleParameters.provisioningState] The provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [securityRuleParameters.name] The name of the resource that - * is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [securityRuleParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [securityRuleParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a security rule in the specified network security group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkSecurityGroupName The name of the network security - * group. - * - * @param {string} securityRuleName The name of the security rule. - * - * @param {object} securityRuleParameters Parameters supplied to the create or - * update network security rule operation. - * - * @param {string} [securityRuleParameters.description] A description for this - * rule. Restricted to 140 chars. - * - * @param {string} securityRuleParameters.protocol Network protocol this rule - * applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values - * include: 'Tcp', 'Udp', '*' - * - * @param {string} [securityRuleParameters.sourcePortRange] The source port or - * range. Integer or range between 0 and 65535. Asterix '*' can also be used to - * match all ports. - * - * @param {string} [securityRuleParameters.destinationPortRange] The - * destination port or range. Integer or range between 0 and 65535. Asterix '*' - * can also be used to match all ports. - * - * @param {string} [securityRuleParameters.sourceAddressPrefix] The CIDR or - * source IP range. Asterix '*' can also be used to match all source IPs. - * Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' - * can also be used. If this is an ingress rule, specifies where network - * traffic originates from. - * - * @param {array} [securityRuleParameters.sourceAddressPrefixes] The CIDR or - * source IP ranges. - * - * @param {array} [securityRuleParameters.sourceApplicationSecurityGroups] The - * application security group specified as source. - * - * @param {string} [securityRuleParameters.destinationAddressPrefix] The - * destination address prefix. CIDR or destination IP range. Asterix '*' can - * also be used to match all source IPs. Default tags such as 'VirtualNetwork', - * 'AzureLoadBalancer' and 'Internet' can also be used. - * - * @param {array} [securityRuleParameters.destinationAddressPrefixes] The - * destination address prefixes. CIDR or destination IP ranges. - * - * @param {array} [securityRuleParameters.destinationApplicationSecurityGroups] - * The application security group specified as destination. - * - * @param {array} [securityRuleParameters.sourcePortRanges] The source port - * ranges. - * - * @param {array} [securityRuleParameters.destinationPortRanges] The - * destination port ranges. - * - * @param {string} securityRuleParameters.access The network traffic is allowed - * or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: - * 'Allow', 'Deny' - * - * @param {number} [securityRuleParameters.priority] The priority of the rule. - * The value can be between 100 and 4096. The priority number must be unique - * for each rule in the collection. The lower the priority number, the higher - * the priority of the rule. - * - * @param {string} securityRuleParameters.direction The direction of the rule. - * The direction specifies if rule will be evaluated on incoming or outcoming - * traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values - * include: 'Inbound', 'Outbound' - * - * @param {string} [securityRuleParameters.provisioningState] The provisioning - * state of the public IP resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [securityRuleParameters.name] The name of the resource that - * is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [securityRuleParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [securityRuleParameters.id] Resource ID. - * - * @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 {SecurityRule} - 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 SecurityRule} 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. - */ - beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, 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._beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters, options, optionalCallback); - } - } - - /** - * Gets all security rules in a network security group. - * - * @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 security rules in a network security group. - * - * @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 {SecurityRuleListResult} - 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 SecurityRuleListResult} 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 = SecurityRules; diff --git a/lib/services/networkManagement2/lib/operations/serviceEndpointPolicies.js b/lib/services/networkManagement2/lib/operations/serviceEndpointPolicies.js deleted file mode 100644 index 7f4bcb01d..000000000 --- a/lib/services/networkManagement2/lib/operations/serviceEndpointPolicies.js +++ /dev/null @@ -1,2476 +0,0 @@ -/* - * 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; - - -/** - * Deletes the specified service endpoint policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, serviceEndpointPolicyName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, serviceEndpointPolicyName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets the specified service Endpoint Policies in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 ServiceEndpointPolicy} 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, serviceEndpointPolicyName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2018-10-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 (serviceEndpointPolicyName === null || serviceEndpointPolicyName === undefined || typeof serviceEndpointPolicyName.valueOf() !== 'string') { - throw new Error('serviceEndpointPolicyName 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 (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand 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/serviceEndpointPolicies/{serviceEndpointPolicyName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{serviceEndpointPolicyName}', encodeURIComponent(serviceEndpointPolicyName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } - 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['ServiceEndpointPolicy']().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); - }); -} - - -/** - * Creates or updates a service Endpoint Policies. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {object} parameters Parameters supplied to the create or update - * service endpoint policy operation. - * - * @param {array} [parameters.serviceEndpointPolicyDefinitions] A collection of - * service endpoint policy definitions of the service endpoint policy. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 ServiceEndpointPolicy} 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 _createOrUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ServiceEndpointPolicy']().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); - }); - }); -} - - -/** - * Updates service Endpoint Policies. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {object} parameters Parameters supplied to update service endpoint - * policy tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 ServiceEndpointPolicy} 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 _update(resourceGroupName, serviceEndpointPolicyName, parameters, 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.'); - } - - // Send request - this.beginUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ServiceEndpointPolicy']().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 the service endpoint policies in a subscription. - * - * @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 ServiceEndpointPolicyListResult} 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(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/ServiceEndpointPolicies'; - 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['ServiceEndpointPolicyListResult']().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 service endpoint Policies in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 ServiceEndpointPolicyListResult} 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 _listByResourceGroup(resourceGroupName, 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-10-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 (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/serviceEndpointPolicies'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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['ServiceEndpointPolicyListResult']().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); - }); -} - -/** - * Deletes the specified service endpoint policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, serviceEndpointPolicyName, 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-10-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 (serviceEndpointPolicyName === null || serviceEndpointPolicyName === undefined || typeof serviceEndpointPolicyName.valueOf() !== 'string') { - throw new Error('serviceEndpointPolicyName 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/serviceEndpointPolicies/{serviceEndpointPolicyName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{serviceEndpointPolicyName}', encodeURIComponent(serviceEndpointPolicyName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates a service Endpoint Policies. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {object} parameters Parameters supplied to the create or update - * service endpoint policy operation. - * - * @param {array} [parameters.serviceEndpointPolicyDefinitions] A collection of - * service endpoint policy definitions of the service endpoint policy. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 ServiceEndpointPolicy} 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 _beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, 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-10-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 (serviceEndpointPolicyName === null || serviceEndpointPolicyName === undefined || typeof serviceEndpointPolicyName.valueOf() !== 'string') { - throw new Error('serviceEndpointPolicyName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/serviceEndpointPolicies/{serviceEndpointPolicyName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{serviceEndpointPolicyName}', encodeURIComponent(serviceEndpointPolicyName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['ServiceEndpointPolicy']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['ServiceEndpointPolicy']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ServiceEndpointPolicy']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Updates service Endpoint Policies. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {object} parameters Parameters supplied to update service endpoint - * policy tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 ServiceEndpointPolicy} 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 _beginUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, 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-10-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 (serviceEndpointPolicyName === null || serviceEndpointPolicyName === undefined || typeof serviceEndpointPolicyName.valueOf() !== 'string') { - throw new Error('serviceEndpointPolicyName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/serviceEndpointPolicies/{serviceEndpointPolicyName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{serviceEndpointPolicyName}', encodeURIComponent(serviceEndpointPolicyName)); - 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 = 'PATCH'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['TagsObject']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // 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['ServiceEndpointPolicy']().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 the service endpoint policies in a subscription. - * - * @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 ServiceEndpointPolicyListResult} 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['ServiceEndpointPolicyListResult']().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 service endpoint Policies in a resource group. - * - * @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 ServiceEndpointPolicyListResult} 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 _listByResourceGroupNext(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['ServiceEndpointPolicyListResult']().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 ServiceEndpointPolicies. */ -class ServiceEndpointPolicies { - /** - * Create a ServiceEndpointPolicies. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._update = _update; - this._list = _list; - this._listByResourceGroup = _listByResourceGroup; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdate = _beginUpdate; - this._listNext = _listNext; - this._listByResourceGroupNext = _listByResourceGroupNext; - } - - /** - * Deletes the specified service endpoint policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, serviceEndpointPolicyName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, serviceEndpointPolicyName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified service endpoint policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, serviceEndpointPolicyName, 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._deleteMethod(resourceGroupName, serviceEndpointPolicyName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, serviceEndpointPolicyName, options, optionalCallback); - } - } - - /** - * Gets the specified service Endpoint Policies in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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, serviceEndpointPolicyName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, serviceEndpointPolicyName, 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 service Endpoint Policies in a specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {ServiceEndpointPolicy} - 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 ServiceEndpointPolicy} 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, serviceEndpointPolicyName, 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, serviceEndpointPolicyName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, serviceEndpointPolicyName, options, optionalCallback); - } - } - - /** - * Creates or updates a service Endpoint Policies. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {object} parameters Parameters supplied to the create or update - * service endpoint policy operation. - * - * @param {array} [parameters.serviceEndpointPolicyDefinitions] A collection of - * service endpoint policy definitions of the service endpoint policy. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, serviceEndpointPolicyName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a service Endpoint Policies. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {object} parameters Parameters supplied to the create or update - * service endpoint policy operation. - * - * @param {array} [parameters.serviceEndpointPolicyDefinitions] A collection of - * service endpoint policy definitions of the service endpoint policy. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ServiceEndpointPolicy} - 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 ServiceEndpointPolicy} 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. - */ - createOrUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, 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._createOrUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, optionalCallback); - } - } - - /** - * Updates service Endpoint Policies. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {object} parameters Parameters supplied to update service endpoint - * policy tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateWithHttpOperationResponse(resourceGroupName, serviceEndpointPolicyName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._update(resourceGroupName, serviceEndpointPolicyName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates service Endpoint Policies. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {object} parameters Parameters supplied to update service endpoint - * policy tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ServiceEndpointPolicy} - 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 ServiceEndpointPolicy} 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. - */ - update(resourceGroupName, serviceEndpointPolicyName, parameters, 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._update(resourceGroupName, serviceEndpointPolicyName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._update(resourceGroupName, serviceEndpointPolicyName, parameters, options, optionalCallback); - } - } - - /** - * Gets all the service endpoint policies in a subscription. - * - * @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(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(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 the service endpoint policies in a subscription. - * - * @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 {ServiceEndpointPolicyListResult} - 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 ServiceEndpointPolicyListResult} 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(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(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(options, optionalCallback); - } - } - - /** - * Gets all service endpoint Policies in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, 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 service endpoint Policies in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {ServiceEndpointPolicyListResult} - 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 ServiceEndpointPolicyListResult} 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. - */ - listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroup(resourceGroupName, options, optionalCallback); - } - } - - /** - * Deletes the specified service endpoint policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, serviceEndpointPolicyName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, serviceEndpointPolicyName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified service endpoint policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, serviceEndpointPolicyName, 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._beginDeleteMethod(resourceGroupName, serviceEndpointPolicyName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, serviceEndpointPolicyName, options, optionalCallback); - } - } - - /** - * Creates or updates a service Endpoint Policies. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {object} parameters Parameters supplied to the create or update - * service endpoint policy operation. - * - * @param {array} [parameters.serviceEndpointPolicyDefinitions] A collection of - * service endpoint policy definitions of the service endpoint policy. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, serviceEndpointPolicyName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a service Endpoint Policies. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {object} parameters Parameters supplied to the create or update - * service endpoint policy operation. - * - * @param {array} [parameters.serviceEndpointPolicyDefinitions] A collection of - * service endpoint policy definitions of the service endpoint policy. - * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ServiceEndpointPolicy} - 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 ServiceEndpointPolicy} 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. - */ - beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, 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._beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, optionalCallback); - } - } - - /** - * Updates service Endpoint Policies. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {object} parameters Parameters supplied to update service endpoint - * policy tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateWithHttpOperationResponse(resourceGroupName, serviceEndpointPolicyName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates service Endpoint Policies. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {object} parameters Parameters supplied to update service endpoint - * policy tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {ServiceEndpointPolicy} - 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 ServiceEndpointPolicy} 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. - */ - beginUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, 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._beginUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginUpdate(resourceGroupName, serviceEndpointPolicyName, parameters, options, optionalCallback); - } - } - - /** - * Gets all the service endpoint policies in a subscription. - * - * @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 the service endpoint policies in a subscription. - * - * @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 {ServiceEndpointPolicyListResult} - 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 ServiceEndpointPolicyListResult} 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); - } - } - - /** - * Gets all service endpoint Policies in a resource group. - * - * @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. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroupNext(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 service endpoint Policies in a resource group. - * - * @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 {ServiceEndpointPolicyListResult} - 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 ServiceEndpointPolicyListResult} 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. - */ - listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = ServiceEndpointPolicies; diff --git a/lib/services/networkManagement2/lib/operations/serviceEndpointPolicyDefinitions.js b/lib/services/networkManagement2/lib/operations/serviceEndpointPolicyDefinitions.js deleted file mode 100644 index 5753e68c4..000000000 --- a/lib/services/networkManagement2/lib/operations/serviceEndpointPolicyDefinitions.js +++ /dev/null @@ -1,1710 +0,0 @@ -/* - * 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; - - -/** - * Deletes the specified ServiceEndpoint policy definitions. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the Service Endpoint - * Policy. - * - * @param {string} serviceEndpointPolicyDefinitionName The name of the service - * endpoint policy definition. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Get the specified service endpoint policy definitions from service endpoint - * policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy name. - * - * @param {string} serviceEndpointPolicyDefinitionName The name of the service - * endpoint policy definition name. - * - * @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 ServiceEndpointPolicyDefinition} 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, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, 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-10-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 (serviceEndpointPolicyName === null || serviceEndpointPolicyName === undefined || typeof serviceEndpointPolicyName.valueOf() !== 'string') { - throw new Error('serviceEndpointPolicyName cannot be null or undefined and it must be of type string.'); - } - if (serviceEndpointPolicyDefinitionName === null || serviceEndpointPolicyDefinitionName === undefined || typeof serviceEndpointPolicyDefinitionName.valueOf() !== 'string') { - throw new Error('serviceEndpointPolicyDefinitionName 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/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{serviceEndpointPolicyName}', encodeURIComponent(serviceEndpointPolicyName)); - requestUrl = requestUrl.replace('{serviceEndpointPolicyDefinitionName}', encodeURIComponent(serviceEndpointPolicyDefinitionName)); - 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['ServiceEndpointPolicyDefinition']().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); - }); -} - - -/** - * Creates or updates a service endpoint policy definition in the specified - * service endpoint policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {string} serviceEndpointPolicyDefinitionName The name of the service - * endpoint policy definition name. - * - * @param {object} serviceEndpointPolicyDefinitions Parameters supplied to the - * create or update service endpoint policy operation. - * - * @param {string} [serviceEndpointPolicyDefinitions.description] A description - * for this rule. Restricted to 140 chars. - * - * @param {string} [serviceEndpointPolicyDefinitions.service] service endpoint - * name. - * - * @param {array} [serviceEndpointPolicyDefinitions.serviceResources] A list of - * service resources. - * - * @param {string} [serviceEndpointPolicyDefinitions.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [serviceEndpointPolicyDefinitions.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [serviceEndpointPolicyDefinitions.id] Resource ID. - * - * @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 ServiceEndpointPolicyDefinition} 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 _createOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ServiceEndpointPolicyDefinition']().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 service endpoint policy definitions in a service end point policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy name. - * - * @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 ServiceEndpointPolicyDefinitionListResult} - * 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 _listByResourceGroup(resourceGroupName, serviceEndpointPolicyName, 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-10-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 (serviceEndpointPolicyName === null || serviceEndpointPolicyName === undefined || typeof serviceEndpointPolicyName.valueOf() !== 'string') { - throw new Error('serviceEndpointPolicyName 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/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{serviceEndpointPolicyName}', encodeURIComponent(serviceEndpointPolicyName)); - 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['ServiceEndpointPolicyDefinitionListResult']().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); - }); -} - -/** - * Deletes the specified ServiceEndpoint policy definitions. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the Service Endpoint - * Policy. - * - * @param {string} serviceEndpointPolicyDefinitionName The name of the service - * endpoint policy definition. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, 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-10-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 (serviceEndpointPolicyName === null || serviceEndpointPolicyName === undefined || typeof serviceEndpointPolicyName.valueOf() !== 'string') { - throw new Error('serviceEndpointPolicyName cannot be null or undefined and it must be of type string.'); - } - if (serviceEndpointPolicyDefinitionName === null || serviceEndpointPolicyDefinitionName === undefined || typeof serviceEndpointPolicyDefinitionName.valueOf() !== 'string') { - throw new Error('serviceEndpointPolicyDefinitionName 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/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{serviceEndpointPolicyName}', encodeURIComponent(serviceEndpointPolicyName)); - requestUrl = requestUrl.replace('{serviceEndpointPolicyDefinitionName}', encodeURIComponent(serviceEndpointPolicyDefinitionName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates a service endpoint policy definition in the specified - * service endpoint policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {string} serviceEndpointPolicyDefinitionName The name of the service - * endpoint policy definition name. - * - * @param {object} serviceEndpointPolicyDefinitions Parameters supplied to the - * create or update service endpoint policy operation. - * - * @param {string} [serviceEndpointPolicyDefinitions.description] A description - * for this rule. Restricted to 140 chars. - * - * @param {string} [serviceEndpointPolicyDefinitions.service] service endpoint - * name. - * - * @param {array} [serviceEndpointPolicyDefinitions.serviceResources] A list of - * service resources. - * - * @param {string} [serviceEndpointPolicyDefinitions.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [serviceEndpointPolicyDefinitions.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [serviceEndpointPolicyDefinitions.id] Resource ID. - * - * @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 ServiceEndpointPolicyDefinition} 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 _beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, 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-10-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 (serviceEndpointPolicyName === null || serviceEndpointPolicyName === undefined || typeof serviceEndpointPolicyName.valueOf() !== 'string') { - throw new Error('serviceEndpointPolicyName cannot be null or undefined and it must be of type string.'); - } - if (serviceEndpointPolicyDefinitionName === null || serviceEndpointPolicyDefinitionName === undefined || typeof serviceEndpointPolicyDefinitionName.valueOf() !== 'string') { - throw new Error('serviceEndpointPolicyDefinitionName cannot be null or undefined and it must be of type string.'); - } - if (serviceEndpointPolicyDefinitions === null || serviceEndpointPolicyDefinitions === undefined) { - throw new Error('serviceEndpointPolicyDefinitions cannot be null or undefined.'); - } - 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/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{serviceEndpointPolicyName}', encodeURIComponent(serviceEndpointPolicyName)); - requestUrl = requestUrl.replace('{serviceEndpointPolicyDefinitionName}', encodeURIComponent(serviceEndpointPolicyDefinitionName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (serviceEndpointPolicyDefinitions !== null && serviceEndpointPolicyDefinitions !== undefined) { - let requestModelMapper = new client.models['ServiceEndpointPolicyDefinition']().mapper(); - requestModel = client.serialize(requestModelMapper, serviceEndpointPolicyDefinitions, 'serviceEndpointPolicyDefinitions'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(serviceEndpointPolicyDefinitions, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['ServiceEndpointPolicyDefinition']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ServiceEndpointPolicyDefinition']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Gets all service endpoint policy definitions in a service end point policy. - * - * @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 ServiceEndpointPolicyDefinitionListResult} - * 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 _listByResourceGroupNext(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['ServiceEndpointPolicyDefinitionListResult']().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 ServiceEndpointPolicyDefinitions. */ -class ServiceEndpointPolicyDefinitions { - /** - * Create a ServiceEndpointPolicyDefinitions. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._listByResourceGroup = _listByResourceGroup; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._listByResourceGroupNext = _listByResourceGroupNext; - } - - /** - * Deletes the specified ServiceEndpoint policy definitions. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the Service Endpoint - * Policy. - * - * @param {string} serviceEndpointPolicyDefinitionName The name of the service - * endpoint policy definition. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified ServiceEndpoint policy definitions. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the Service Endpoint - * Policy. - * - * @param {string} serviceEndpointPolicyDefinitionName The name of the service - * endpoint policy definition. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, 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._deleteMethod(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options, optionalCallback); - } - } - - /** - * Get the specified service endpoint policy definitions from service endpoint - * policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy name. - * - * @param {string} serviceEndpointPolicyDefinitionName The name of the service - * endpoint policy definition name. - * - * @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, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Get the specified service endpoint policy definitions from service endpoint - * policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy name. - * - * @param {string} serviceEndpointPolicyDefinitionName The name of the service - * endpoint policy definition name. - * - * @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 {ServiceEndpointPolicyDefinition} - 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 ServiceEndpointPolicyDefinition} 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, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, 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, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options, optionalCallback); - } - } - - /** - * Creates or updates a service endpoint policy definition in the specified - * service endpoint policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {string} serviceEndpointPolicyDefinitionName The name of the service - * endpoint policy definition name. - * - * @param {object} serviceEndpointPolicyDefinitions Parameters supplied to the - * create or update service endpoint policy operation. - * - * @param {string} [serviceEndpointPolicyDefinitions.description] A description - * for this rule. Restricted to 140 chars. - * - * @param {string} [serviceEndpointPolicyDefinitions.service] service endpoint - * name. - * - * @param {array} [serviceEndpointPolicyDefinitions.serviceResources] A list of - * service resources. - * - * @param {string} [serviceEndpointPolicyDefinitions.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [serviceEndpointPolicyDefinitions.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [serviceEndpointPolicyDefinitions.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a service endpoint policy definition in the specified - * service endpoint policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {string} serviceEndpointPolicyDefinitionName The name of the service - * endpoint policy definition name. - * - * @param {object} serviceEndpointPolicyDefinitions Parameters supplied to the - * create or update service endpoint policy operation. - * - * @param {string} [serviceEndpointPolicyDefinitions.description] A description - * for this rule. Restricted to 140 chars. - * - * @param {string} [serviceEndpointPolicyDefinitions.service] service endpoint - * name. - * - * @param {array} [serviceEndpointPolicyDefinitions.serviceResources] A list of - * service resources. - * - * @param {string} [serviceEndpointPolicyDefinitions.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [serviceEndpointPolicyDefinitions.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [serviceEndpointPolicyDefinitions.id] Resource ID. - * - * @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 {ServiceEndpointPolicyDefinition} - 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 ServiceEndpointPolicyDefinition} 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. - */ - createOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, 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._createOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, options, optionalCallback); - } - } - - /** - * Gets all service endpoint policy definitions in a service end point policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy name. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName, serviceEndpointPolicyName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, serviceEndpointPolicyName, 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 service endpoint policy definitions in a service end point policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy name. - * - * @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 {ServiceEndpointPolicyDefinitionListResult} - 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 ServiceEndpointPolicyDefinitionListResult} - * 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. - */ - listByResourceGroup(resourceGroupName, serviceEndpointPolicyName, 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._listByResourceGroup(resourceGroupName, serviceEndpointPolicyName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroup(resourceGroupName, serviceEndpointPolicyName, options, optionalCallback); - } - } - - /** - * Deletes the specified ServiceEndpoint policy definitions. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the Service Endpoint - * Policy. - * - * @param {string} serviceEndpointPolicyDefinitionName The name of the service - * endpoint policy definition. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified ServiceEndpoint policy definitions. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the Service Endpoint - * Policy. - * - * @param {string} serviceEndpointPolicyDefinitionName The name of the service - * endpoint policy definition. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, 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._beginDeleteMethod(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, options, optionalCallback); - } - } - - /** - * Creates or updates a service endpoint policy definition in the specified - * service endpoint policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {string} serviceEndpointPolicyDefinitionName The name of the service - * endpoint policy definition name. - * - * @param {object} serviceEndpointPolicyDefinitions Parameters supplied to the - * create or update service endpoint policy operation. - * - * @param {string} [serviceEndpointPolicyDefinitions.description] A description - * for this rule. Restricted to 140 chars. - * - * @param {string} [serviceEndpointPolicyDefinitions.service] service endpoint - * name. - * - * @param {array} [serviceEndpointPolicyDefinitions.serviceResources] A list of - * service resources. - * - * @param {string} [serviceEndpointPolicyDefinitions.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [serviceEndpointPolicyDefinitions.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [serviceEndpointPolicyDefinitions.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a service endpoint policy definition in the specified - * service endpoint policy. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} serviceEndpointPolicyName The name of the service endpoint - * policy. - * - * @param {string} serviceEndpointPolicyDefinitionName The name of the service - * endpoint policy definition name. - * - * @param {object} serviceEndpointPolicyDefinitions Parameters supplied to the - * create or update service endpoint policy operation. - * - * @param {string} [serviceEndpointPolicyDefinitions.description] A description - * for this rule. Restricted to 140 chars. - * - * @param {string} [serviceEndpointPolicyDefinitions.service] service endpoint - * name. - * - * @param {array} [serviceEndpointPolicyDefinitions.serviceResources] A list of - * service resources. - * - * @param {string} [serviceEndpointPolicyDefinitions.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [serviceEndpointPolicyDefinitions.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [serviceEndpointPolicyDefinitions.id] Resource ID. - * - * @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 {ServiceEndpointPolicyDefinition} - 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 ServiceEndpointPolicyDefinition} 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. - */ - beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, 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._beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions, options, optionalCallback); - } - } - - /** - * Gets all service endpoint policy definitions in a service end point policy. - * - * @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. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroupNext(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 service endpoint policy definitions in a service end point policy. - * - * @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 {ServiceEndpointPolicyDefinitionListResult} - 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 ServiceEndpointPolicyDefinitionListResult} - * 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. - */ - listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = ServiceEndpointPolicyDefinitions; diff --git a/lib/services/networkManagement2/lib/operations/subnets.js b/lib/services/networkManagement2/lib/operations/subnets.js deleted file mode 100644 index c2434e3f6..000000000 --- a/lib/services/networkManagement2/lib/operations/subnets.js +++ /dev/null @@ -1,2055 +0,0 @@ -/* - * 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; - - -/** - * Deletes the specified subnet. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, virtualNetworkName, subnetName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, virtualNetworkName, subnetName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets the specified subnet by virtual network and resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 Subnet} 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, virtualNetworkName, subnetName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2018-10-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 (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { - throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); - } - if (subnetName === null || subnetName === undefined || typeof subnetName.valueOf() !== 'string') { - throw new Error('subnetName 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 (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand 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/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); - requestUrl = requestUrl.replace('{subnetName}', encodeURIComponent(subnetName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } - 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['Subnet']().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); - }); -} - - -/** - * Creates or updates a subnet in the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. - * - * @param {object} subnetParameters Parameters supplied to the create or update - * subnet operation. - * - * @param {string} [subnetParameters.addressPrefix] The address prefix for the - * subnet. - * - * @param {array} [subnetParameters.addressPrefixes] List of address prefixes - * for the subnet. - * - * @param {object} [subnetParameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * - * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A - * collection of security rules of the network security group. - * - * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The - * resource GUID property of the network security group resource. - * - * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. - * - * @param {string} [subnetParameters.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. - * - * @param {object} [subnetParameters.routeTable] The reference of the - * RouteTable resource. - * - * @param {array} [subnetParameters.routeTable.routes] Collection of routes - * contained within a route table. - * - * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} [subnetParameters.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [subnetParameters.routeTable.id] Resource ID. - * - * @param {string} [subnetParameters.routeTable.location] Resource location. - * - * @param {object} [subnetParameters.routeTable.tags] Resource tags. - * - * @param {array} [subnetParameters.serviceEndpoints] An array of service - * endpoints. - * - * @param {array} [subnetParameters.serviceEndpointPolicies] An array of - * service endpoint policies. - * - * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * - * @param {array} [subnetParameters.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * - * @param {array} [subnetParameters.delegations] Gets an array of references to - * the delegations on the subnet. - * - * @param {string} [subnetParameters.provisioningState] The provisioning state - * of the resource. - * - * @param {string} [subnetParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [subnetParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [subnetParameters.id] Resource ID. - * - * @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 Subnet} 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 _createOrUpdate(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Subnet']().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 subnets in a virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @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 SubnetListResult} 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, virtualNetworkName, 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-10-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 (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { - throw new Error('virtualNetworkName 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/virtualNetworks/{virtualNetworkName}/subnets'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); - 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['SubnetListResult']().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); - }); -} - -/** - * Deletes the specified subnet. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, virtualNetworkName, subnetName, 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-10-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 (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { - throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); - } - if (subnetName === null || subnetName === undefined || typeof subnetName.valueOf() !== 'string') { - throw new Error('subnetName 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/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); - requestUrl = requestUrl.replace('{subnetName}', encodeURIComponent(subnetName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates a subnet in the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. - * - * @param {object} subnetParameters Parameters supplied to the create or update - * subnet operation. - * - * @param {string} [subnetParameters.addressPrefix] The address prefix for the - * subnet. - * - * @param {array} [subnetParameters.addressPrefixes] List of address prefixes - * for the subnet. - * - * @param {object} [subnetParameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * - * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A - * collection of security rules of the network security group. - * - * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The - * resource GUID property of the network security group resource. - * - * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. - * - * @param {string} [subnetParameters.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. - * - * @param {object} [subnetParameters.routeTable] The reference of the - * RouteTable resource. - * - * @param {array} [subnetParameters.routeTable.routes] Collection of routes - * contained within a route table. - * - * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} [subnetParameters.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [subnetParameters.routeTable.id] Resource ID. - * - * @param {string} [subnetParameters.routeTable.location] Resource location. - * - * @param {object} [subnetParameters.routeTable.tags] Resource tags. - * - * @param {array} [subnetParameters.serviceEndpoints] An array of service - * endpoints. - * - * @param {array} [subnetParameters.serviceEndpointPolicies] An array of - * service endpoint policies. - * - * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * - * @param {array} [subnetParameters.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * - * @param {array} [subnetParameters.delegations] Gets an array of references to - * the delegations on the subnet. - * - * @param {string} [subnetParameters.provisioningState] The provisioning state - * of the resource. - * - * @param {string} [subnetParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [subnetParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [subnetParameters.id] Resource ID. - * - * @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 Subnet} 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 _beginCreateOrUpdate(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, 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-10-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 (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { - throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); - } - if (subnetName === null || subnetName === undefined || typeof subnetName.valueOf() !== 'string') { - throw new Error('subnetName cannot be null or undefined and it must be of type string.'); - } - if (subnetParameters === null || subnetParameters === undefined) { - throw new Error('subnetParameters cannot be null or undefined.'); - } - 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/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); - requestUrl = requestUrl.replace('{subnetName}', encodeURIComponent(subnetName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (subnetParameters !== null && subnetParameters !== undefined) { - let requestModelMapper = new client.models['Subnet']().mapper(); - requestModel = client.serialize(requestModelMapper, subnetParameters, 'subnetParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(subnetParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['Subnet']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Subnet']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Gets all subnets in a virtual network. - * - * @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 SubnetListResult} 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['SubnetListResult']().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 Subnets. */ -class Subnets { - /** - * Create a Subnets. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._list = _list; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._listNext = _listNext; - } - - /** - * Deletes the specified subnet. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, virtualNetworkName, subnetName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, virtualNetworkName, subnetName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified subnet. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, virtualNetworkName, subnetName, 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._deleteMethod(resourceGroupName, virtualNetworkName, subnetName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, virtualNetworkName, subnetName, options, optionalCallback); - } - } - - /** - * Gets the specified subnet by virtual network and resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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, virtualNetworkName, subnetName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, virtualNetworkName, subnetName, 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 subnet by virtual network and resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {Subnet} - 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 Subnet} 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, virtualNetworkName, subnetName, 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, virtualNetworkName, subnetName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, virtualNetworkName, subnetName, options, optionalCallback); - } - } - - /** - * Creates or updates a subnet in the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. - * - * @param {object} subnetParameters Parameters supplied to the create or update - * subnet operation. - * - * @param {string} [subnetParameters.addressPrefix] The address prefix for the - * subnet. - * - * @param {array} [subnetParameters.addressPrefixes] List of address prefixes - * for the subnet. - * - * @param {object} [subnetParameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * - * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A - * collection of security rules of the network security group. - * - * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The - * resource GUID property of the network security group resource. - * - * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. - * - * @param {string} [subnetParameters.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. - * - * @param {object} [subnetParameters.routeTable] The reference of the - * RouteTable resource. - * - * @param {array} [subnetParameters.routeTable.routes] Collection of routes - * contained within a route table. - * - * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} [subnetParameters.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [subnetParameters.routeTable.id] Resource ID. - * - * @param {string} [subnetParameters.routeTable.location] Resource location. - * - * @param {object} [subnetParameters.routeTable.tags] Resource tags. - * - * @param {array} [subnetParameters.serviceEndpoints] An array of service - * endpoints. - * - * @param {array} [subnetParameters.serviceEndpointPolicies] An array of - * service endpoint policies. - * - * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * - * @param {array} [subnetParameters.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * - * @param {array} [subnetParameters.delegations] Gets an array of references to - * the delegations on the subnet. - * - * @param {string} [subnetParameters.provisioningState] The provisioning state - * of the resource. - * - * @param {string} [subnetParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [subnetParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [subnetParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a subnet in the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. - * - * @param {object} subnetParameters Parameters supplied to the create or update - * subnet operation. - * - * @param {string} [subnetParameters.addressPrefix] The address prefix for the - * subnet. - * - * @param {array} [subnetParameters.addressPrefixes] List of address prefixes - * for the subnet. - * - * @param {object} [subnetParameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * - * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A - * collection of security rules of the network security group. - * - * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The - * resource GUID property of the network security group resource. - * - * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. - * - * @param {string} [subnetParameters.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. - * - * @param {object} [subnetParameters.routeTable] The reference of the - * RouteTable resource. - * - * @param {array} [subnetParameters.routeTable.routes] Collection of routes - * contained within a route table. - * - * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} [subnetParameters.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [subnetParameters.routeTable.id] Resource ID. - * - * @param {string} [subnetParameters.routeTable.location] Resource location. - * - * @param {object} [subnetParameters.routeTable.tags] Resource tags. - * - * @param {array} [subnetParameters.serviceEndpoints] An array of service - * endpoints. - * - * @param {array} [subnetParameters.serviceEndpointPolicies] An array of - * service endpoint policies. - * - * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * - * @param {array} [subnetParameters.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * - * @param {array} [subnetParameters.delegations] Gets an array of references to - * the delegations on the subnet. - * - * @param {string} [subnetParameters.provisioningState] The provisioning state - * of the resource. - * - * @param {string} [subnetParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [subnetParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [subnetParameters.id] Resource ID. - * - * @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 {Subnet} - 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 Subnet} 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. - */ - createOrUpdate(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, 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._createOrUpdate(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, options, optionalCallback); - } - } - - /** - * Gets all subnets in a virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @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, virtualNetworkName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, virtualNetworkName, 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 subnets in a virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @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 {SubnetListResult} - 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 SubnetListResult} 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, virtualNetworkName, 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, virtualNetworkName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, virtualNetworkName, options, optionalCallback); - } - } - - /** - * Deletes the specified subnet. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, virtualNetworkName, subnetName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, virtualNetworkName, subnetName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified subnet. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, virtualNetworkName, subnetName, 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._beginDeleteMethod(resourceGroupName, virtualNetworkName, subnetName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, virtualNetworkName, subnetName, options, optionalCallback); - } - } - - /** - * Creates or updates a subnet in the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. - * - * @param {object} subnetParameters Parameters supplied to the create or update - * subnet operation. - * - * @param {string} [subnetParameters.addressPrefix] The address prefix for the - * subnet. - * - * @param {array} [subnetParameters.addressPrefixes] List of address prefixes - * for the subnet. - * - * @param {object} [subnetParameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * - * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A - * collection of security rules of the network security group. - * - * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The - * resource GUID property of the network security group resource. - * - * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. - * - * @param {string} [subnetParameters.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. - * - * @param {object} [subnetParameters.routeTable] The reference of the - * RouteTable resource. - * - * @param {array} [subnetParameters.routeTable.routes] Collection of routes - * contained within a route table. - * - * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} [subnetParameters.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [subnetParameters.routeTable.id] Resource ID. - * - * @param {string} [subnetParameters.routeTable.location] Resource location. - * - * @param {object} [subnetParameters.routeTable.tags] Resource tags. - * - * @param {array} [subnetParameters.serviceEndpoints] An array of service - * endpoints. - * - * @param {array} [subnetParameters.serviceEndpointPolicies] An array of - * service endpoint policies. - * - * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * - * @param {array} [subnetParameters.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * - * @param {array} [subnetParameters.delegations] Gets an array of references to - * the delegations on the subnet. - * - * @param {string} [subnetParameters.provisioningState] The provisioning state - * of the resource. - * - * @param {string} [subnetParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [subnetParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [subnetParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a subnet in the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} subnetName The name of the subnet. - * - * @param {object} subnetParameters Parameters supplied to the create or update - * subnet operation. - * - * @param {string} [subnetParameters.addressPrefix] The address prefix for the - * subnet. - * - * @param {array} [subnetParameters.addressPrefixes] List of address prefixes - * for the subnet. - * - * @param {object} [subnetParameters.networkSecurityGroup] The reference of the - * NetworkSecurityGroup resource. - * - * @param {array} [subnetParameters.networkSecurityGroup.securityRules] A - * collection of security rules of the network security group. - * - * @param {array} [subnetParameters.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} [subnetParameters.networkSecurityGroup.resourceGuid] The - * resource GUID property of the network security group resource. - * - * @param {string} [subnetParameters.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [subnetParameters.networkSecurityGroup.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [subnetParameters.networkSecurityGroup.id] Resource ID. - * - * @param {string} [subnetParameters.networkSecurityGroup.location] Resource - * location. - * - * @param {object} [subnetParameters.networkSecurityGroup.tags] Resource tags. - * - * @param {object} [subnetParameters.routeTable] The reference of the - * RouteTable resource. - * - * @param {array} [subnetParameters.routeTable.routes] Collection of routes - * contained within a route table. - * - * @param {boolean} [subnetParameters.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} [subnetParameters.routeTable.provisioningState] The - * provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} [subnetParameters.routeTable.etag] Gets a unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [subnetParameters.routeTable.id] Resource ID. - * - * @param {string} [subnetParameters.routeTable.location] Resource location. - * - * @param {object} [subnetParameters.routeTable.tags] Resource tags. - * - * @param {array} [subnetParameters.serviceEndpoints] An array of service - * endpoints. - * - * @param {array} [subnetParameters.serviceEndpointPolicies] An array of - * service endpoint policies. - * - * @param {array} [subnetParameters.resourceNavigationLinks] Gets an array of - * references to the external resources using subnet. - * - * @param {array} [subnetParameters.serviceAssociationLinks] Gets an array of - * references to services injecting into this subnet. - * - * @param {array} [subnetParameters.delegations] Gets an array of references to - * the delegations on the subnet. - * - * @param {string} [subnetParameters.provisioningState] The provisioning state - * of the resource. - * - * @param {string} [subnetParameters.name] The name of the resource that is - * unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [subnetParameters.etag] A unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [subnetParameters.id] Resource ID. - * - * @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 {Subnet} - 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 Subnet} 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. - */ - beginCreateOrUpdate(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, 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._beginCreateOrUpdate(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, virtualNetworkName, subnetName, subnetParameters, options, optionalCallback); - } - } - - /** - * Gets all subnets in a virtual network. - * - * @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 subnets in a virtual network. - * - * @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 {SubnetListResult} - 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 SubnetListResult} 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 = Subnets; diff --git a/lib/services/networkManagement2/lib/operations/usages.js b/lib/services/networkManagement2/lib/operations/usages.js deleted file mode 100644 index 01254efcd..000000000 --- a/lib/services/networkManagement2/lib/operations/usages.js +++ /dev/null @@ -1,467 +0,0 @@ -/* - * 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; - -/** - * List network usages for a subscription. - * - * @param {string} location The location where resource usage is queried. - * - * @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 UsagesListResult} 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(location, 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-10-01'; - // Validate - try { - if (location === null || location === undefined || typeof location.valueOf() !== 'string') { - throw new Error('location cannot be null or undefined and it must be of type string.'); - } - if (location !== null && location !== undefined) { - if (location.match(/^[-\w\._ ]+$/) === null) - { - throw new Error('"location" should satisfy the constraint - "Pattern": /^[-\w\._ ]+$/'); - } - } - 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}/providers/Microsoft.Network/locations/{location}/usages'; - requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); - 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['UsagesListResult']().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); - }); -} - -/** - * List network usages for a subscription. - * - * @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 UsagesListResult} 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['UsagesListResult']().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 Usages. */ -class Usages { - /** - * Create a Usages. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._list = _list; - this._listNext = _listNext; - } - - /** - * List network usages for a subscription. - * - * @param {string} location The location where resource usage is queried. - * - * @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(location, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(location, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * List network usages for a subscription. - * - * @param {string} location The location where resource usage is queried. - * - * @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 {UsagesListResult} - 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 UsagesListResult} 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(location, 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(location, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(location, options, optionalCallback); - } - } - - /** - * List network usages for a subscription. - * - * @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; - }); - }); - } - - /** - * List network usages for a subscription. - * - * @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 {UsagesListResult} - 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 UsagesListResult} 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 = Usages; diff --git a/lib/services/networkManagement2/lib/operations/virtualHubs.js b/lib/services/networkManagement2/lib/operations/virtualHubs.js deleted file mode 100644 index 50b0b1132..000000000 --- a/lib/services/networkManagement2/lib/operations/virtualHubs.js +++ /dev/null @@ -1,2603 +0,0 @@ -/* - * 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; - -/** - * Retrieves the details of a VirtualHub. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @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 VirtualHub} 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, virtualHubName, 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-10-01'; - // Validate - try { - 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 (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 (virtualHubName === null || virtualHubName === undefined || typeof virtualHubName.valueOf() !== 'string') { - throw new Error('virtualHubName 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/virtualHubs/{virtualHubName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualHubName}', encodeURIComponent(virtualHubName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['VirtualHub']().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); - }); -} - - -/** - * Creates a VirtualHub resource if it doesn't exist else updates the existing - * VirtualHub. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @param {object} virtualHubParameters Parameters supplied to create or update - * VirtualHub. - * - * @param {object} [virtualHubParameters.virtualWan] The VirtualWAN to which - * the VirtualHub belongs - * - * @param {object} [virtualHubParameters.vpnGateway] The VpnGateway associated - * with this VirtualHub - * - * @param {object} [virtualHubParameters.p2SVpnGateway] The P2SVpnGateway - * associated with this VirtualHub - * - * @param {object} [virtualHubParameters.expressRouteGateway] The - * expressRouteGateway associated with this VirtualHub - * - * @param {string} [virtualHubParameters.expressRouteGateway.id] Resource ID. - * - * @param {array} [virtualHubParameters.virtualNetworkConnections] list of all - * vnet connections with this VirtualHub. - * - * @param {string} [virtualHubParameters.addressPrefix] Address-prefix for this - * VirtualHub. - * - * @param {object} [virtualHubParameters.routeTable] The routeTable associated - * with this virtual hub. - * - * @param {array} [virtualHubParameters.routeTable.routes] list of all routes. - * - * @param {string} [virtualHubParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {string} [virtualHubParameters.id] Resource ID. - * - * @param {string} [virtualHubParameters.location] Resource location. - * - * @param {object} [virtualHubParameters.tags] Resource tags. - * - * @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 VirtualHub} 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 _createOrUpdate(resourceGroupName, virtualHubName, virtualHubParameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, virtualHubName, virtualHubParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualHub']().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); - }); - }); -} - - -/** - * Updates VirtualHub tags. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @param {object} virtualHubParameters Parameters supplied to update - * VirtualHub tags. - * - * @param {object} [virtualHubParameters.tags] Resource tags. - * - * @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 VirtualHub} 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 _updateTags(resourceGroupName, virtualHubName, virtualHubParameters, 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.'); - } - - // Send request - this.beginUpdateTags(resourceGroupName, virtualHubName, virtualHubParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualHub']().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); - }); - }); -} - - -/** - * Deletes a VirtualHub. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, virtualHubName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, virtualHubName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Lists all the VirtualHubs in a resource group. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @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 ListVirtualHubsResult} 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 _listByResourceGroup(resourceGroupName, 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-10-01'; - // Validate - try { - 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 (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 (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/virtualHubs'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListVirtualHubsResult']().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); - }); -} - -/** - * Lists all the VirtualHubs in a subscription. - * - * @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 ListVirtualHubsResult} 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(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/virtualHubs'; - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListVirtualHubsResult']().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); - }); -} - -/** - * Creates a VirtualHub resource if it doesn't exist else updates the existing - * VirtualHub. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @param {object} virtualHubParameters Parameters supplied to create or update - * VirtualHub. - * - * @param {object} [virtualHubParameters.virtualWan] The VirtualWAN to which - * the VirtualHub belongs - * - * @param {object} [virtualHubParameters.vpnGateway] The VpnGateway associated - * with this VirtualHub - * - * @param {object} [virtualHubParameters.p2SVpnGateway] The P2SVpnGateway - * associated with this VirtualHub - * - * @param {object} [virtualHubParameters.expressRouteGateway] The - * expressRouteGateway associated with this VirtualHub - * - * @param {string} [virtualHubParameters.expressRouteGateway.id] Resource ID. - * - * @param {array} [virtualHubParameters.virtualNetworkConnections] list of all - * vnet connections with this VirtualHub. - * - * @param {string} [virtualHubParameters.addressPrefix] Address-prefix for this - * VirtualHub. - * - * @param {object} [virtualHubParameters.routeTable] The routeTable associated - * with this virtual hub. - * - * @param {array} [virtualHubParameters.routeTable.routes] list of all routes. - * - * @param {string} [virtualHubParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {string} [virtualHubParameters.id] Resource ID. - * - * @param {string} [virtualHubParameters.location] Resource location. - * - * @param {object} [virtualHubParameters.tags] Resource tags. - * - * @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 VirtualHub} 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 _beginCreateOrUpdate(resourceGroupName, virtualHubName, virtualHubParameters, 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-10-01'; - // Validate - try { - 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 (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 (virtualHubName === null || virtualHubName === undefined || typeof virtualHubName.valueOf() !== 'string') { - throw new Error('virtualHubName cannot be null or undefined and it must be of type string.'); - } - if (virtualHubParameters === null || virtualHubParameters === undefined) { - throw new Error('virtualHubParameters cannot be null or undefined.'); - } - 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/virtualHubs/{virtualHubName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualHubName}', encodeURIComponent(virtualHubName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (virtualHubParameters !== null && virtualHubParameters !== undefined) { - let requestModelMapper = new client.models['VirtualHub']().mapper(); - requestModel = client.serialize(requestModelMapper, virtualHubParameters, 'virtualHubParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(virtualHubParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['VirtualHub']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualHub']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Updates VirtualHub tags. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @param {object} virtualHubParameters Parameters supplied to update - * VirtualHub tags. - * - * @param {object} [virtualHubParameters.tags] Resource tags. - * - * @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 VirtualHub} 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 _beginUpdateTags(resourceGroupName, virtualHubName, virtualHubParameters, 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-10-01'; - // Validate - try { - 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 (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 (virtualHubName === null || virtualHubName === undefined || typeof virtualHubName.valueOf() !== 'string') { - throw new Error('virtualHubName cannot be null or undefined and it must be of type string.'); - } - if (virtualHubParameters === null || virtualHubParameters === undefined) { - throw new Error('virtualHubParameters cannot be null or undefined.'); - } - 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/virtualHubs/{virtualHubName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualHubName}', encodeURIComponent(virtualHubName)); - 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 = 'PATCH'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (virtualHubParameters !== null && virtualHubParameters !== undefined) { - let requestModelMapper = new client.models['TagsObject']().mapper(); - requestModel = client.serialize(requestModelMapper, virtualHubParameters, 'virtualHubParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(virtualHubParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['VirtualHub']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualHub']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Deletes a VirtualHub. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, virtualHubName, 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-10-01'; - // Validate - try { - 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 (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 (virtualHubName === null || virtualHubName === undefined || typeof virtualHubName.valueOf() !== 'string') { - throw new Error('virtualHubName 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/virtualHubs/{virtualHubName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualHubName}', encodeURIComponent(virtualHubName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Lists all the VirtualHubs in a resource group. - * - * @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 ListVirtualHubsResult} 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 _listByResourceGroupNext(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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListVirtualHubsResult']().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); - }); -} - -/** - * Lists all the VirtualHubs in a subscription. - * - * @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 ListVirtualHubsResult} 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListVirtualHubsResult']().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 VirtualHubs. */ -class VirtualHubs { - /** - * Create a VirtualHubs. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._updateTags = _updateTags; - this._deleteMethod = _deleteMethod; - this._listByResourceGroup = _listByResourceGroup; - this._list = _list; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdateTags = _beginUpdateTags; - this._beginDeleteMethod = _beginDeleteMethod; - this._listByResourceGroupNext = _listByResourceGroupNext; - this._listNext = _listNext; - } - - /** - * Retrieves the details of a VirtualHub. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @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, virtualHubName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, virtualHubName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves the details of a VirtualHub. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @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 {VirtualHub} - 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 VirtualHub} 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, virtualHubName, 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, virtualHubName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, virtualHubName, options, optionalCallback); - } - } - - /** - * Creates a VirtualHub resource if it doesn't exist else updates the existing - * VirtualHub. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @param {object} virtualHubParameters Parameters supplied to create or update - * VirtualHub. - * - * @param {object} [virtualHubParameters.virtualWan] The VirtualWAN to which - * the VirtualHub belongs - * - * @param {object} [virtualHubParameters.vpnGateway] The VpnGateway associated - * with this VirtualHub - * - * @param {object} [virtualHubParameters.p2SVpnGateway] The P2SVpnGateway - * associated with this VirtualHub - * - * @param {object} [virtualHubParameters.expressRouteGateway] The - * expressRouteGateway associated with this VirtualHub - * - * @param {string} [virtualHubParameters.expressRouteGateway.id] Resource ID. - * - * @param {array} [virtualHubParameters.virtualNetworkConnections] list of all - * vnet connections with this VirtualHub. - * - * @param {string} [virtualHubParameters.addressPrefix] Address-prefix for this - * VirtualHub. - * - * @param {object} [virtualHubParameters.routeTable] The routeTable associated - * with this virtual hub. - * - * @param {array} [virtualHubParameters.routeTable.routes] list of all routes. - * - * @param {string} [virtualHubParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {string} [virtualHubParameters.id] Resource ID. - * - * @param {string} [virtualHubParameters.location] Resource location. - * - * @param {object} [virtualHubParameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, virtualHubName, virtualHubParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, virtualHubName, virtualHubParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates a VirtualHub resource if it doesn't exist else updates the existing - * VirtualHub. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @param {object} virtualHubParameters Parameters supplied to create or update - * VirtualHub. - * - * @param {object} [virtualHubParameters.virtualWan] The VirtualWAN to which - * the VirtualHub belongs - * - * @param {object} [virtualHubParameters.vpnGateway] The VpnGateway associated - * with this VirtualHub - * - * @param {object} [virtualHubParameters.p2SVpnGateway] The P2SVpnGateway - * associated with this VirtualHub - * - * @param {object} [virtualHubParameters.expressRouteGateway] The - * expressRouteGateway associated with this VirtualHub - * - * @param {string} [virtualHubParameters.expressRouteGateway.id] Resource ID. - * - * @param {array} [virtualHubParameters.virtualNetworkConnections] list of all - * vnet connections with this VirtualHub. - * - * @param {string} [virtualHubParameters.addressPrefix] Address-prefix for this - * VirtualHub. - * - * @param {object} [virtualHubParameters.routeTable] The routeTable associated - * with this virtual hub. - * - * @param {array} [virtualHubParameters.routeTable.routes] list of all routes. - * - * @param {string} [virtualHubParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {string} [virtualHubParameters.id] Resource ID. - * - * @param {string} [virtualHubParameters.location] Resource location. - * - * @param {object} [virtualHubParameters.tags] Resource tags. - * - * @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 {VirtualHub} - 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 VirtualHub} 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. - */ - createOrUpdate(resourceGroupName, virtualHubName, virtualHubParameters, 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._createOrUpdate(resourceGroupName, virtualHubName, virtualHubParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, virtualHubName, virtualHubParameters, options, optionalCallback); - } - } - - /** - * Updates VirtualHub tags. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @param {object} virtualHubParameters Parameters supplied to update - * VirtualHub tags. - * - * @param {object} [virtualHubParameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName, virtualHubName, virtualHubParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateTags(resourceGroupName, virtualHubName, virtualHubParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates VirtualHub tags. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @param {object} virtualHubParameters Parameters supplied to update - * VirtualHub tags. - * - * @param {object} [virtualHubParameters.tags] Resource tags. - * - * @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 {VirtualHub} - 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 VirtualHub} 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. - */ - updateTags(resourceGroupName, virtualHubName, virtualHubParameters, 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._updateTags(resourceGroupName, virtualHubName, virtualHubParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateTags(resourceGroupName, virtualHubName, virtualHubParameters, options, optionalCallback); - } - } - - /** - * Deletes a VirtualHub. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, virtualHubName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, virtualHubName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes a VirtualHub. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, virtualHubName, 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._deleteMethod(resourceGroupName, virtualHubName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, virtualHubName, options, optionalCallback); - } - } - - /** - * Lists all the VirtualHubs in a resource group. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all the VirtualHubs in a resource group. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @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 {ListVirtualHubsResult} - 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 ListVirtualHubsResult} 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. - */ - listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroup(resourceGroupName, options, optionalCallback); - } - } - - /** - * Lists all the VirtualHubs in a subscription. - * - * @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(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all the VirtualHubs in a subscription. - * - * @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 {ListVirtualHubsResult} - 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 ListVirtualHubsResult} 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(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(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(options, optionalCallback); - } - } - - /** - * Creates a VirtualHub resource if it doesn't exist else updates the existing - * VirtualHub. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @param {object} virtualHubParameters Parameters supplied to create or update - * VirtualHub. - * - * @param {object} [virtualHubParameters.virtualWan] The VirtualWAN to which - * the VirtualHub belongs - * - * @param {object} [virtualHubParameters.vpnGateway] The VpnGateway associated - * with this VirtualHub - * - * @param {object} [virtualHubParameters.p2SVpnGateway] The P2SVpnGateway - * associated with this VirtualHub - * - * @param {object} [virtualHubParameters.expressRouteGateway] The - * expressRouteGateway associated with this VirtualHub - * - * @param {string} [virtualHubParameters.expressRouteGateway.id] Resource ID. - * - * @param {array} [virtualHubParameters.virtualNetworkConnections] list of all - * vnet connections with this VirtualHub. - * - * @param {string} [virtualHubParameters.addressPrefix] Address-prefix for this - * VirtualHub. - * - * @param {object} [virtualHubParameters.routeTable] The routeTable associated - * with this virtual hub. - * - * @param {array} [virtualHubParameters.routeTable.routes] list of all routes. - * - * @param {string} [virtualHubParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {string} [virtualHubParameters.id] Resource ID. - * - * @param {string} [virtualHubParameters.location] Resource location. - * - * @param {object} [virtualHubParameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, virtualHubName, virtualHubParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, virtualHubName, virtualHubParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates a VirtualHub resource if it doesn't exist else updates the existing - * VirtualHub. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @param {object} virtualHubParameters Parameters supplied to create or update - * VirtualHub. - * - * @param {object} [virtualHubParameters.virtualWan] The VirtualWAN to which - * the VirtualHub belongs - * - * @param {object} [virtualHubParameters.vpnGateway] The VpnGateway associated - * with this VirtualHub - * - * @param {object} [virtualHubParameters.p2SVpnGateway] The P2SVpnGateway - * associated with this VirtualHub - * - * @param {object} [virtualHubParameters.expressRouteGateway] The - * expressRouteGateway associated with this VirtualHub - * - * @param {string} [virtualHubParameters.expressRouteGateway.id] Resource ID. - * - * @param {array} [virtualHubParameters.virtualNetworkConnections] list of all - * vnet connections with this VirtualHub. - * - * @param {string} [virtualHubParameters.addressPrefix] Address-prefix for this - * VirtualHub. - * - * @param {object} [virtualHubParameters.routeTable] The routeTable associated - * with this virtual hub. - * - * @param {array} [virtualHubParameters.routeTable.routes] list of all routes. - * - * @param {string} [virtualHubParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {string} [virtualHubParameters.id] Resource ID. - * - * @param {string} [virtualHubParameters.location] Resource location. - * - * @param {object} [virtualHubParameters.tags] Resource tags. - * - * @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 {VirtualHub} - 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 VirtualHub} 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. - */ - beginCreateOrUpdate(resourceGroupName, virtualHubName, virtualHubParameters, 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._beginCreateOrUpdate(resourceGroupName, virtualHubName, virtualHubParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, virtualHubName, virtualHubParameters, options, optionalCallback); - } - } - - /** - * Updates VirtualHub tags. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @param {object} virtualHubParameters Parameters supplied to update - * VirtualHub tags. - * - * @param {object} [virtualHubParameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName, virtualHubName, virtualHubParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginUpdateTags(resourceGroupName, virtualHubName, virtualHubParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates VirtualHub tags. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @param {object} virtualHubParameters Parameters supplied to update - * VirtualHub tags. - * - * @param {object} [virtualHubParameters.tags] Resource tags. - * - * @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 {VirtualHub} - 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 VirtualHub} 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. - */ - beginUpdateTags(resourceGroupName, virtualHubName, virtualHubParameters, 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._beginUpdateTags(resourceGroupName, virtualHubName, virtualHubParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginUpdateTags(resourceGroupName, virtualHubName, virtualHubParameters, options, optionalCallback); - } - } - - /** - * Deletes a VirtualHub. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, virtualHubName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, virtualHubName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes a VirtualHub. - * - * @param {string} resourceGroupName The resource group name of the VirtualHub. - * - * @param {string} virtualHubName The name of the VirtualHub. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, virtualHubName, 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._beginDeleteMethod(resourceGroupName, virtualHubName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, virtualHubName, options, optionalCallback); - } - } - - /** - * Lists all the VirtualHubs in a resource group. - * - * @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. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all the VirtualHubs in a resource group. - * - * @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 {ListVirtualHubsResult} - 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 ListVirtualHubsResult} 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. - */ - listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); - } - } - - /** - * Lists all the VirtualHubs in a subscription. - * - * @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; - }); - }); - } - - /** - * Lists all the VirtualHubs in a subscription. - * - * @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 {ListVirtualHubsResult} - 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 ListVirtualHubsResult} 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 = VirtualHubs; diff --git a/lib/services/networkManagement2/lib/operations/virtualNetworkGatewayConnections.js b/lib/services/networkManagement2/lib/operations/virtualNetworkGatewayConnections.js deleted file mode 100644 index 3013c3773..000000000 --- a/lib/services/networkManagement2/lib/operations/virtualNetworkGatewayConnections.js +++ /dev/null @@ -1,4265 +0,0 @@ -/* - * 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; - - -/** - * Creates or updates a virtual network gateway connection in the specified - * resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network gateway connection operation. - * - * @param {string} [parameters.authorizationKey] The authorizationKey. - * - * @param {object} parameters.virtualNetworkGateway1 The reference to virtual - * network gateway resource. - * - * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual - * network gateway resource. - * - * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP - * configurations for virtual network gateway. - * - * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of - * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. - * Possible values include: 'Vpn', 'ExpressRoute' - * - * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this - * virtual network gateway. Possible values are: 'PolicyBased' and - * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' - * - * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP - * is enabled for this virtual network gateway or not. - * - * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] - * ActiveActive flag - * - * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The - * reference of the LocalNetworkGateway resource which represents local network - * site having default routes. Assign Null value in case of removing existing - * default site setting. - * - * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. - * - * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU - * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * - * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU - * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * - * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The - * capacity. - * - * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] - * The reference of the VpnClientConfiguration resource which represents the - * P2S VpnClient configurations. - * - * @param {object} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] - * The reference of the address space resource which represents Address space - * for P2S VpnClient. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. - * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] - * The radius server address property of the VirtualNetworkGateway resource for - * vpn client connection. - * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] - * The radius secret property of the VirtualNetworkGateway resource for vpn - * client connection. - * - * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual - * network gateway's BGP speaker settings. - * - * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The - * resource GUID property of the VirtualNetworkGateway resource. - * - * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. - * - * @param {string} [parameters.virtualNetworkGateway2.location] Resource - * location. - * - * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. - * - * @param {object} [parameters.localNetworkGateway2] The reference to local - * network gateway resource. - * - * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] - * Local network site address space. - * - * @param {array} - * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP - * address of local network gateway. - * - * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network - * gateway's BGP speaker settings. - * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP - * speaker's ASN. - * - * @param {string} - * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The - * weight added to routes learned from this BGP speaker. - * - * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource - * GUID property of the LocalNetworkGateway resource. - * - * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.localNetworkGateway2.id] Resource ID. - * - * @param {string} [parameters.localNetworkGateway2.location] Resource - * location. - * - * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. - * - * @param {string} parameters.connectionType Gateway connection type. Possible - * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible - * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' - * - * @param {string} [parameters.connectionProtocol] Connection protocol used for - * this connection. Possible values include: 'IKEv2', 'IKEv1' - * - * @param {number} [parameters.routingWeight] The routing weight. - * - * @param {string} [parameters.sharedKey] The IPSec shared key. - * - * @param {object} [parameters.peer] The reference to peerings resource. - * - * @param {string} [parameters.peer.id] Resource ID. - * - * @param {boolean} [parameters.enableBgp] EnableBgp flag - * - * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable - * policy-based traffic selectors. - * - * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be - * considered by this connection. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGatewayConnection resource. - * - * @param {boolean} [parameters.expressRouteGatewayBypass] Bypass ExpressRoute - * Gateway for data forwarding - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 VirtualNetworkGatewayConnection} 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 _createOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualNetworkGatewayConnection']().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 the specified virtual network gateway connection by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway 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 VirtualNetworkGatewayConnection} 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, virtualNetworkGatewayConnectionName, 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-10-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 (virtualNetworkGatewayConnectionName === null || virtualNetworkGatewayConnectionName === undefined || typeof virtualNetworkGatewayConnectionName.valueOf() !== 'string') { - throw new Error('virtualNetworkGatewayConnectionName 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/connections/{virtualNetworkGatewayConnectionName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkGatewayConnectionName}', encodeURIComponent(virtualNetworkGatewayConnectionName)); - 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['VirtualNetworkGatewayConnection']().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); - }); -} - - -/** - * Deletes the specified virtual network Gateway connection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, virtualNetworkGatewayConnectionName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, virtualNetworkGatewayConnectionName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * Updates a virtual network gateway connection tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. - * - * @param {object} parameters Parameters supplied to update virtual network - * gateway connection tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 VirtualNetworkGatewayConnection} 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 _updateTags(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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.'); - } - - // Send request - this.beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualNetworkGatewayConnection']().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); - }); - }); -} - - -/** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual - * network gateway connection shared key for passed virtual network gateway - * connection in the specified resource group through Network resource - * provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection name. - * - * @param {object} parameters Parameters supplied to the Begin Set Virtual - * Network Gateway connection Shared key operation throughNetwork resource - * provider. - * - * @param {string} parameters.value The virtual network connection shared key - * value. - * - * @param {string} [parameters.id] Resource ID. - * - * @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 ConnectionSharedKey} 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 _setSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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.'); - } - - // Send request - this.beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ConnectionSharedKey']().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); - }); - }); -} - -/** - * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves - * information about the specified virtual network gateway connection shared - * key through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection shared key name. - * - * @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 ConnectionSharedKey} 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 _getSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, 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-10-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 (virtualNetworkGatewayConnectionName === null || virtualNetworkGatewayConnectionName === undefined || typeof virtualNetworkGatewayConnectionName.valueOf() !== 'string') { - throw new Error('virtualNetworkGatewayConnectionName 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/connections/{virtualNetworkGatewayConnectionName}/sharedkey'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkGatewayConnectionName}', encodeURIComponent(virtualNetworkGatewayConnectionName)); - 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['ConnectionSharedKey']().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); - }); -} - -/** - * The List VirtualNetworkGatewayConnections operation retrieves all the - * virtual network gateways connections created. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 VirtualNetworkGatewayConnectionListResult} - * 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, 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-10-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 (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/connections'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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['VirtualNetworkGatewayConnectionListResult']().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); - }); -} - - -/** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the - * virtual network gateway connection shared key for passed virtual network - * gateway connection in the specified resource group through Network resource - * provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection reset shared key Name. - * - * @param {object} parameters Parameters supplied to the begin reset virtual - * network gateway connection shared key operation through network resource - * provider. - * - * @param {number} parameters.keyLength The virtual network connection reset - * shared key length, should between 1 and 128. - * - * @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 ConnectionResetSharedKey} 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 _resetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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.'); - } - - // Send request - this.beginResetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ConnectionResetSharedKey']().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); - }); - }); -} - -/** - * Creates or updates a virtual network gateway connection in the specified - * resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network gateway connection operation. - * - * @param {string} [parameters.authorizationKey] The authorizationKey. - * - * @param {object} parameters.virtualNetworkGateway1 The reference to virtual - * network gateway resource. - * - * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual - * network gateway resource. - * - * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP - * configurations for virtual network gateway. - * - * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of - * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. - * Possible values include: 'Vpn', 'ExpressRoute' - * - * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this - * virtual network gateway. Possible values are: 'PolicyBased' and - * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' - * - * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP - * is enabled for this virtual network gateway or not. - * - * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] - * ActiveActive flag - * - * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The - * reference of the LocalNetworkGateway resource which represents local network - * site having default routes. Assign Null value in case of removing existing - * default site setting. - * - * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. - * - * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU - * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * - * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU - * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * - * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The - * capacity. - * - * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] - * The reference of the VpnClientConfiguration resource which represents the - * P2S VpnClient configurations. - * - * @param {object} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] - * The reference of the address space resource which represents Address space - * for P2S VpnClient. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. - * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] - * The radius server address property of the VirtualNetworkGateway resource for - * vpn client connection. - * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] - * The radius secret property of the VirtualNetworkGateway resource for vpn - * client connection. - * - * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual - * network gateway's BGP speaker settings. - * - * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The - * resource GUID property of the VirtualNetworkGateway resource. - * - * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. - * - * @param {string} [parameters.virtualNetworkGateway2.location] Resource - * location. - * - * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. - * - * @param {object} [parameters.localNetworkGateway2] The reference to local - * network gateway resource. - * - * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] - * Local network site address space. - * - * @param {array} - * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP - * address of local network gateway. - * - * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network - * gateway's BGP speaker settings. - * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP - * speaker's ASN. - * - * @param {string} - * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The - * weight added to routes learned from this BGP speaker. - * - * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource - * GUID property of the LocalNetworkGateway resource. - * - * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.localNetworkGateway2.id] Resource ID. - * - * @param {string} [parameters.localNetworkGateway2.location] Resource - * location. - * - * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. - * - * @param {string} parameters.connectionType Gateway connection type. Possible - * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible - * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' - * - * @param {string} [parameters.connectionProtocol] Connection protocol used for - * this connection. Possible values include: 'IKEv2', 'IKEv1' - * - * @param {number} [parameters.routingWeight] The routing weight. - * - * @param {string} [parameters.sharedKey] The IPSec shared key. - * - * @param {object} [parameters.peer] The reference to peerings resource. - * - * @param {string} [parameters.peer.id] Resource ID. - * - * @param {boolean} [parameters.enableBgp] EnableBgp flag - * - * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable - * policy-based traffic selectors. - * - * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be - * considered by this connection. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGatewayConnection resource. - * - * @param {boolean} [parameters.expressRouteGatewayBypass] Bypass ExpressRoute - * Gateway for data forwarding - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 VirtualNetworkGatewayConnection} 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 _beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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-10-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 (virtualNetworkGatewayConnectionName === null || virtualNetworkGatewayConnectionName === undefined || typeof virtualNetworkGatewayConnectionName.valueOf() !== 'string') { - throw new Error('virtualNetworkGatewayConnectionName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/connections/{virtualNetworkGatewayConnectionName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkGatewayConnectionName}', encodeURIComponent(virtualNetworkGatewayConnectionName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['VirtualNetworkGatewayConnection']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['VirtualNetworkGatewayConnection']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualNetworkGatewayConnection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Deletes the specified virtual network Gateway connection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, virtualNetworkGatewayConnectionName, 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-10-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 (virtualNetworkGatewayConnectionName === null || virtualNetworkGatewayConnectionName === undefined || typeof virtualNetworkGatewayConnectionName.valueOf() !== 'string') { - throw new Error('virtualNetworkGatewayConnectionName 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/connections/{virtualNetworkGatewayConnectionName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkGatewayConnectionName}', encodeURIComponent(virtualNetworkGatewayConnectionName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Updates a virtual network gateway connection tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. - * - * @param {object} parameters Parameters supplied to update virtual network - * gateway connection tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 VirtualNetworkGatewayConnection} 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 _beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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-10-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 (virtualNetworkGatewayConnectionName === null || virtualNetworkGatewayConnectionName === undefined || typeof virtualNetworkGatewayConnectionName.valueOf() !== 'string') { - throw new Error('virtualNetworkGatewayConnectionName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/connections/{virtualNetworkGatewayConnectionName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkGatewayConnectionName}', encodeURIComponent(virtualNetworkGatewayConnectionName)); - 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 = 'PATCH'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['TagsObject']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // 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['VirtualNetworkGatewayConnection']().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); - }); -} - -/** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual - * network gateway connection shared key for passed virtual network gateway - * connection in the specified resource group through Network resource - * provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection name. - * - * @param {object} parameters Parameters supplied to the Begin Set Virtual - * Network Gateway connection Shared key operation throughNetwork resource - * provider. - * - * @param {string} parameters.value The virtual network connection shared key - * value. - * - * @param {string} [parameters.id] Resource ID. - * - * @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 ConnectionSharedKey} 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 _beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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-10-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 (virtualNetworkGatewayConnectionName === null || virtualNetworkGatewayConnectionName === undefined || typeof virtualNetworkGatewayConnectionName.valueOf() !== 'string') { - throw new Error('virtualNetworkGatewayConnectionName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/connections/{virtualNetworkGatewayConnectionName}/sharedkey'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkGatewayConnectionName}', encodeURIComponent(virtualNetworkGatewayConnectionName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['ConnectionSharedKey']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['ConnectionSharedKey']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ConnectionSharedKey']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the - * virtual network gateway connection shared key for passed virtual network - * gateway connection in the specified resource group through Network resource - * provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection reset shared key Name. - * - * @param {object} parameters Parameters supplied to the begin reset virtual - * network gateway connection shared key operation through network resource - * provider. - * - * @param {number} parameters.keyLength The virtual network connection reset - * shared key length, should between 1 and 128. - * - * @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 ConnectionResetSharedKey} 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 _beginResetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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-10-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 (virtualNetworkGatewayConnectionName === null || virtualNetworkGatewayConnectionName === undefined || typeof virtualNetworkGatewayConnectionName.valueOf() !== 'string') { - throw new Error('virtualNetworkGatewayConnectionName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkGatewayConnectionName}', encodeURIComponent(virtualNetworkGatewayConnectionName)); - 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 = 'POST'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['ConnectionResetSharedKey']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { - 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['ConnectionResetSharedKey']().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); - }); -} - -/** - * The List VirtualNetworkGatewayConnections operation retrieves all the - * virtual network gateways connections created. - * - * @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 VirtualNetworkGatewayConnectionListResult} - * 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['VirtualNetworkGatewayConnectionListResult']().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 VirtualNetworkGatewayConnections. */ -class VirtualNetworkGatewayConnections { - /** - * Create a VirtualNetworkGatewayConnections. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._createOrUpdate = _createOrUpdate; - this._get = _get; - this._deleteMethod = _deleteMethod; - this._updateTags = _updateTags; - this._setSharedKey = _setSharedKey; - this._getSharedKey = _getSharedKey; - this._list = _list; - this._resetSharedKey = _resetSharedKey; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginUpdateTags = _beginUpdateTags; - this._beginSetSharedKey = _beginSetSharedKey; - this._beginResetSharedKey = _beginResetSharedKey; - this._listNext = _listNext; - } - - /** - * Creates or updates a virtual network gateway connection in the specified - * resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network gateway connection operation. - * - * @param {string} [parameters.authorizationKey] The authorizationKey. - * - * @param {object} parameters.virtualNetworkGateway1 The reference to virtual - * network gateway resource. - * - * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual - * network gateway resource. - * - * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP - * configurations for virtual network gateway. - * - * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of - * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. - * Possible values include: 'Vpn', 'ExpressRoute' - * - * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this - * virtual network gateway. Possible values are: 'PolicyBased' and - * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' - * - * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP - * is enabled for this virtual network gateway or not. - * - * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] - * ActiveActive flag - * - * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The - * reference of the LocalNetworkGateway resource which represents local network - * site having default routes. Assign Null value in case of removing existing - * default site setting. - * - * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. - * - * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU - * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * - * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU - * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * - * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The - * capacity. - * - * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] - * The reference of the VpnClientConfiguration resource which represents the - * P2S VpnClient configurations. - * - * @param {object} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] - * The reference of the address space resource which represents Address space - * for P2S VpnClient. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. - * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] - * The radius server address property of the VirtualNetworkGateway resource for - * vpn client connection. - * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] - * The radius secret property of the VirtualNetworkGateway resource for vpn - * client connection. - * - * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual - * network gateway's BGP speaker settings. - * - * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The - * resource GUID property of the VirtualNetworkGateway resource. - * - * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. - * - * @param {string} [parameters.virtualNetworkGateway2.location] Resource - * location. - * - * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. - * - * @param {object} [parameters.localNetworkGateway2] The reference to local - * network gateway resource. - * - * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] - * Local network site address space. - * - * @param {array} - * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP - * address of local network gateway. - * - * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network - * gateway's BGP speaker settings. - * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP - * speaker's ASN. - * - * @param {string} - * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The - * weight added to routes learned from this BGP speaker. - * - * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource - * GUID property of the LocalNetworkGateway resource. - * - * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.localNetworkGateway2.id] Resource ID. - * - * @param {string} [parameters.localNetworkGateway2.location] Resource - * location. - * - * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. - * - * @param {string} parameters.connectionType Gateway connection type. Possible - * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible - * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' - * - * @param {string} [parameters.connectionProtocol] Connection protocol used for - * this connection. Possible values include: 'IKEv2', 'IKEv1' - * - * @param {number} [parameters.routingWeight] The routing weight. - * - * @param {string} [parameters.sharedKey] The IPSec shared key. - * - * @param {object} [parameters.peer] The reference to peerings resource. - * - * @param {string} [parameters.peer.id] Resource ID. - * - * @param {boolean} [parameters.enableBgp] EnableBgp flag - * - * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable - * policy-based traffic selectors. - * - * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be - * considered by this connection. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGatewayConnection resource. - * - * @param {boolean} [parameters.expressRouteGatewayBypass] Bypass ExpressRoute - * Gateway for data forwarding - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a virtual network gateway connection in the specified - * resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network gateway connection operation. - * - * @param {string} [parameters.authorizationKey] The authorizationKey. - * - * @param {object} parameters.virtualNetworkGateway1 The reference to virtual - * network gateway resource. - * - * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual - * network gateway resource. - * - * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP - * configurations for virtual network gateway. - * - * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of - * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. - * Possible values include: 'Vpn', 'ExpressRoute' - * - * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this - * virtual network gateway. Possible values are: 'PolicyBased' and - * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' - * - * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP - * is enabled for this virtual network gateway or not. - * - * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] - * ActiveActive flag - * - * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The - * reference of the LocalNetworkGateway resource which represents local network - * site having default routes. Assign Null value in case of removing existing - * default site setting. - * - * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. - * - * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU - * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * - * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU - * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * - * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The - * capacity. - * - * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] - * The reference of the VpnClientConfiguration resource which represents the - * P2S VpnClient configurations. - * - * @param {object} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] - * The reference of the address space resource which represents Address space - * for P2S VpnClient. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. - * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] - * The radius server address property of the VirtualNetworkGateway resource for - * vpn client connection. - * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] - * The radius secret property of the VirtualNetworkGateway resource for vpn - * client connection. - * - * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual - * network gateway's BGP speaker settings. - * - * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The - * resource GUID property of the VirtualNetworkGateway resource. - * - * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. - * - * @param {string} [parameters.virtualNetworkGateway2.location] Resource - * location. - * - * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. - * - * @param {object} [parameters.localNetworkGateway2] The reference to local - * network gateway resource. - * - * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] - * Local network site address space. - * - * @param {array} - * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP - * address of local network gateway. - * - * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network - * gateway's BGP speaker settings. - * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP - * speaker's ASN. - * - * @param {string} - * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The - * weight added to routes learned from this BGP speaker. - * - * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource - * GUID property of the LocalNetworkGateway resource. - * - * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.localNetworkGateway2.id] Resource ID. - * - * @param {string} [parameters.localNetworkGateway2.location] Resource - * location. - * - * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. - * - * @param {string} parameters.connectionType Gateway connection type. Possible - * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible - * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' - * - * @param {string} [parameters.connectionProtocol] Connection protocol used for - * this connection. Possible values include: 'IKEv2', 'IKEv1' - * - * @param {number} [parameters.routingWeight] The routing weight. - * - * @param {string} [parameters.sharedKey] The IPSec shared key. - * - * @param {object} [parameters.peer] The reference to peerings resource. - * - * @param {string} [parameters.peer.id] Resource ID. - * - * @param {boolean} [parameters.enableBgp] EnableBgp flag - * - * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable - * policy-based traffic selectors. - * - * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be - * considered by this connection. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGatewayConnection resource. - * - * @param {boolean} [parameters.expressRouteGatewayBypass] Bypass ExpressRoute - * Gateway for data forwarding - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetworkGatewayConnection} - 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 VirtualNetworkGatewayConnection} 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. - */ - createOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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._createOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, optionalCallback); - } - } - - /** - * Gets the specified virtual network gateway connection by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway 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, virtualNetworkGatewayConnectionName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, virtualNetworkGatewayConnectionName, 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 virtual network gateway connection by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway 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 {VirtualNetworkGatewayConnection} - 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 VirtualNetworkGatewayConnection} 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, virtualNetworkGatewayConnectionName, 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, virtualNetworkGatewayConnectionName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, virtualNetworkGatewayConnectionName, options, optionalCallback); - } - } - - /** - * Deletes the specified virtual network Gateway connection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway 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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayConnectionName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, virtualNetworkGatewayConnectionName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified virtual network Gateway connection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway 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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, virtualNetworkGatewayConnectionName, 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._deleteMethod(resourceGroupName, virtualNetworkGatewayConnectionName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, virtualNetworkGatewayConnectionName, options, optionalCallback); - } - } - - /** - * Updates a virtual network gateway connection tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. - * - * @param {object} parameters Parameters supplied to update virtual network - * gateway connection tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateTags(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates a virtual network gateway connection tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. - * - * @param {object} parameters Parameters supplied to update virtual network - * gateway connection tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetworkGatewayConnection} - 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 VirtualNetworkGatewayConnection} 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. - */ - updateTags(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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._updateTags(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateTags(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, optionalCallback); - } - } - - /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual - * network gateway connection shared key for passed virtual network gateway - * connection in the specified resource group through Network resource - * provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection name. - * - * @param {object} parameters Parameters supplied to the Begin Set Virtual - * Network Gateway connection Shared key operation throughNetwork resource - * provider. - * - * @param {string} parameters.value The virtual network connection shared key - * value. - * - * @param {string} [parameters.id] Resource ID. - * - * @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. - */ - setSharedKeyWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._setSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual - * network gateway connection shared key for passed virtual network gateway - * connection in the specified resource group through Network resource - * provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection name. - * - * @param {object} parameters Parameters supplied to the Begin Set Virtual - * Network Gateway connection Shared key operation throughNetwork resource - * provider. - * - * @param {string} parameters.value The virtual network connection shared key - * value. - * - * @param {string} [parameters.id] Resource ID. - * - * @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 {ConnectionSharedKey} - 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 ConnectionSharedKey} 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. - */ - setSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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._setSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._setSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, optionalCallback); - } - } - - /** - * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves - * information about the specified virtual network gateway connection shared - * key through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection shared key name. - * - * @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. - */ - getSharedKeyWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayConnectionName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves - * information about the specified virtual network gateway connection shared - * key through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection shared key name. - * - * @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 {ConnectionSharedKey} - 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 ConnectionSharedKey} 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. - */ - getSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, 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._getSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, options, optionalCallback); - } - } - - /** - * The List VirtualNetworkGatewayConnections operation retrieves all the - * virtual network gateways connections created. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * The List VirtualNetworkGatewayConnections operation retrieves all the - * virtual network gateways connections created. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {VirtualNetworkGatewayConnectionListResult} - 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 VirtualNetworkGatewayConnectionListResult} - * 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, 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, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, options, optionalCallback); - } - } - - /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the - * virtual network gateway connection shared key for passed virtual network - * gateway connection in the specified resource group through Network resource - * provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection reset shared key Name. - * - * @param {object} parameters Parameters supplied to the begin reset virtual - * network gateway connection shared key operation through network resource - * provider. - * - * @param {number} parameters.keyLength The virtual network connection reset - * shared key length, should between 1 and 128. - * - * @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. - */ - resetSharedKeyWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._resetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the - * virtual network gateway connection shared key for passed virtual network - * gateway connection in the specified resource group through Network resource - * provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection reset shared key Name. - * - * @param {object} parameters Parameters supplied to the begin reset virtual - * network gateway connection shared key operation through network resource - * provider. - * - * @param {number} parameters.keyLength The virtual network connection reset - * shared key length, should between 1 and 128. - * - * @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 {ConnectionResetSharedKey} - 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 ConnectionResetSharedKey} 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. - */ - resetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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._resetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._resetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, optionalCallback); - } - } - - /** - * Creates or updates a virtual network gateway connection in the specified - * resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network gateway connection operation. - * - * @param {string} [parameters.authorizationKey] The authorizationKey. - * - * @param {object} parameters.virtualNetworkGateway1 The reference to virtual - * network gateway resource. - * - * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual - * network gateway resource. - * - * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP - * configurations for virtual network gateway. - * - * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of - * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. - * Possible values include: 'Vpn', 'ExpressRoute' - * - * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this - * virtual network gateway. Possible values are: 'PolicyBased' and - * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' - * - * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP - * is enabled for this virtual network gateway or not. - * - * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] - * ActiveActive flag - * - * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The - * reference of the LocalNetworkGateway resource which represents local network - * site having default routes. Assign Null value in case of removing existing - * default site setting. - * - * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. - * - * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU - * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * - * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU - * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * - * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The - * capacity. - * - * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] - * The reference of the VpnClientConfiguration resource which represents the - * P2S VpnClient configurations. - * - * @param {object} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] - * The reference of the address space resource which represents Address space - * for P2S VpnClient. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. - * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] - * The radius server address property of the VirtualNetworkGateway resource for - * vpn client connection. - * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] - * The radius secret property of the VirtualNetworkGateway resource for vpn - * client connection. - * - * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual - * network gateway's BGP speaker settings. - * - * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The - * resource GUID property of the VirtualNetworkGateway resource. - * - * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. - * - * @param {string} [parameters.virtualNetworkGateway2.location] Resource - * location. - * - * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. - * - * @param {object} [parameters.localNetworkGateway2] The reference to local - * network gateway resource. - * - * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] - * Local network site address space. - * - * @param {array} - * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP - * address of local network gateway. - * - * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network - * gateway's BGP speaker settings. - * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP - * speaker's ASN. - * - * @param {string} - * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The - * weight added to routes learned from this BGP speaker. - * - * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource - * GUID property of the LocalNetworkGateway resource. - * - * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.localNetworkGateway2.id] Resource ID. - * - * @param {string} [parameters.localNetworkGateway2.location] Resource - * location. - * - * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. - * - * @param {string} parameters.connectionType Gateway connection type. Possible - * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible - * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' - * - * @param {string} [parameters.connectionProtocol] Connection protocol used for - * this connection. Possible values include: 'IKEv2', 'IKEv1' - * - * @param {number} [parameters.routingWeight] The routing weight. - * - * @param {string} [parameters.sharedKey] The IPSec shared key. - * - * @param {object} [parameters.peer] The reference to peerings resource. - * - * @param {string} [parameters.peer.id] Resource ID. - * - * @param {boolean} [parameters.enableBgp] EnableBgp flag - * - * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable - * policy-based traffic selectors. - * - * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be - * considered by this connection. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGatewayConnection resource. - * - * @param {boolean} [parameters.expressRouteGatewayBypass] Bypass ExpressRoute - * Gateway for data forwarding - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a virtual network gateway connection in the specified - * resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network gateway connection operation. - * - * @param {string} [parameters.authorizationKey] The authorizationKey. - * - * @param {object} parameters.virtualNetworkGateway1 The reference to virtual - * network gateway resource. - * - * @param {object} [parameters.virtualNetworkGateway2] The reference to virtual - * network gateway resource. - * - * @param {array} [parameters.virtualNetworkGateway2.ipConfigurations] IP - * configurations for virtual network gateway. - * - * @param {string} [parameters.virtualNetworkGateway2.gatewayType] The type of - * this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. - * Possible values include: 'Vpn', 'ExpressRoute' - * - * @param {string} [parameters.virtualNetworkGateway2.vpnType] The type of this - * virtual network gateway. Possible values are: 'PolicyBased' and - * 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' - * - * @param {boolean} [parameters.virtualNetworkGateway2.enableBgp] Whether BGP - * is enabled for this virtual network gateway or not. - * - * @param {boolean} [parameters.virtualNetworkGateway2.activeActive] - * ActiveActive flag - * - * @param {object} [parameters.virtualNetworkGateway2.gatewayDefaultSite] The - * reference of the LocalNetworkGateway resource which represents local network - * site having default routes. Assign Null value in case of removing existing - * default site setting. - * - * @param {object} [parameters.virtualNetworkGateway2.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. - * - * @param {string} [parameters.virtualNetworkGateway2.sku.name] Gateway SKU - * name. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * - * @param {string} [parameters.virtualNetworkGateway2.sku.tier] Gateway SKU - * tier. Possible values include: 'Basic', 'HighPerformance', 'Standard', - * 'UltraPerformance', 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', - * 'VpnGw3AZ', 'ErGw1AZ', 'ErGw2AZ', 'ErGw3AZ' - * - * @param {number} [parameters.virtualNetworkGateway2.sku.capacity] The - * capacity. - * - * @param {object} [parameters.virtualNetworkGateway2.vpnClientConfiguration] - * The reference of the VpnClientConfiguration resource which represents the - * P2S VpnClient configurations. - * - * @param {object} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientAddressPool] - * The reference of the address space resource which represents Address space - * for P2S VpnClient. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. - * - * @param {array} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. - * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerAddress] - * The radius server address property of the VirtualNetworkGateway resource for - * vpn client connection. - * - * @param {string} - * [parameters.virtualNetworkGateway2.vpnClientConfiguration.radiusServerSecret] - * The radius secret property of the VirtualNetworkGateway resource for vpn - * client connection. - * - * @param {object} [parameters.virtualNetworkGateway2.bgpSettings] Virtual - * network gateway's BGP speaker settings. - * - * @param {string} [parameters.virtualNetworkGateway2.resourceGuid] The - * resource GUID property of the VirtualNetworkGateway resource. - * - * @param {string} [parameters.virtualNetworkGateway2.etag] Gets a unique - * read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.virtualNetworkGateway2.id] Resource ID. - * - * @param {string} [parameters.virtualNetworkGateway2.location] Resource - * location. - * - * @param {object} [parameters.virtualNetworkGateway2.tags] Resource tags. - * - * @param {object} [parameters.localNetworkGateway2] The reference to local - * network gateway resource. - * - * @param {object} [parameters.localNetworkGateway2.localNetworkAddressSpace] - * Local network site address space. - * - * @param {array} - * [parameters.localNetworkGateway2.localNetworkAddressSpace.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [parameters.localNetworkGateway2.gatewayIpAddress] IP - * address of local network gateway. - * - * @param {object} [parameters.localNetworkGateway2.bgpSettings] Local network - * gateway's BGP speaker settings. - * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.asn] The BGP - * speaker's ASN. - * - * @param {string} - * [parameters.localNetworkGateway2.bgpSettings.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.localNetworkGateway2.bgpSettings.peerWeight] The - * weight added to routes learned from this BGP speaker. - * - * @param {string} [parameters.localNetworkGateway2.resourceGuid] The resource - * GUID property of the LocalNetworkGateway resource. - * - * @param {string} [parameters.localNetworkGateway2.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [parameters.localNetworkGateway2.id] Resource ID. - * - * @param {string} [parameters.localNetworkGateway2.location] Resource - * location. - * - * @param {object} [parameters.localNetworkGateway2.tags] Resource tags. - * - * @param {string} parameters.connectionType Gateway connection type. Possible - * values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible - * values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' - * - * @param {string} [parameters.connectionProtocol] Connection protocol used for - * this connection. Possible values include: 'IKEv2', 'IKEv1' - * - * @param {number} [parameters.routingWeight] The routing weight. - * - * @param {string} [parameters.sharedKey] The IPSec shared key. - * - * @param {object} [parameters.peer] The reference to peerings resource. - * - * @param {string} [parameters.peer.id] Resource ID. - * - * @param {boolean} [parameters.enableBgp] EnableBgp flag - * - * @param {boolean} [parameters.usePolicyBasedTrafficSelectors] Enable - * policy-based traffic selectors. - * - * @param {array} [parameters.ipsecPolicies] The IPSec Policies to be - * considered by this connection. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGatewayConnection resource. - * - * @param {boolean} [parameters.expressRouteGatewayBypass] Bypass ExpressRoute - * Gateway for data forwarding - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetworkGatewayConnection} - 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 VirtualNetworkGatewayConnection} 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. - */ - beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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._beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, optionalCallback); - } - } - - /** - * Deletes the specified virtual network Gateway connection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway 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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayConnectionName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, virtualNetworkGatewayConnectionName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified virtual network Gateway connection. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway 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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, virtualNetworkGatewayConnectionName, 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._beginDeleteMethod(resourceGroupName, virtualNetworkGatewayConnectionName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, virtualNetworkGatewayConnectionName, options, optionalCallback); - } - } - - /** - * Updates a virtual network gateway connection tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. - * - * @param {object} parameters Parameters supplied to update virtual network - * gateway connection tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates a virtual network gateway connection tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection. - * - * @param {object} parameters Parameters supplied to update virtual network - * gateway connection tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetworkGatewayConnection} - 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 VirtualNetworkGatewayConnection} 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. - */ - beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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._beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginUpdateTags(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, optionalCallback); - } - } - - /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual - * network gateway connection shared key for passed virtual network gateway - * connection in the specified resource group through Network resource - * provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection name. - * - * @param {object} parameters Parameters supplied to the Begin Set Virtual - * Network Gateway connection Shared key operation throughNetwork resource - * provider. - * - * @param {string} parameters.value The virtual network connection shared key - * value. - * - * @param {string} [parameters.id] Resource ID. - * - * @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. - */ - beginSetSharedKeyWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual - * network gateway connection shared key for passed virtual network gateway - * connection in the specified resource group through Network resource - * provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection name. - * - * @param {object} parameters Parameters supplied to the Begin Set Virtual - * Network Gateway connection Shared key operation throughNetwork resource - * provider. - * - * @param {string} parameters.value The virtual network connection shared key - * value. - * - * @param {string} [parameters.id] Resource ID. - * - * @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 {ConnectionSharedKey} - 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 ConnectionSharedKey} 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. - */ - beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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._beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginSetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, optionalCallback); - } - } - - /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the - * virtual network gateway connection shared key for passed virtual network - * gateway connection in the specified resource group through Network resource - * provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection reset shared key Name. - * - * @param {object} parameters Parameters supplied to the begin reset virtual - * network gateway connection shared key operation through network resource - * provider. - * - * @param {number} parameters.keyLength The virtual network connection reset - * shared key length, should between 1 and 128. - * - * @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. - */ - beginResetSharedKeyWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginResetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the - * virtual network gateway connection shared key for passed virtual network - * gateway connection in the specified resource group through Network resource - * provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The virtual network - * gateway connection reset shared key Name. - * - * @param {object} parameters Parameters supplied to the begin reset virtual - * network gateway connection shared key operation through network resource - * provider. - * - * @param {number} parameters.keyLength The virtual network connection reset - * shared key length, should between 1 and 128. - * - * @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 {ConnectionResetSharedKey} - 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 ConnectionResetSharedKey} 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. - */ - beginResetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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._beginResetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginResetSharedKey(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, optionalCallback); - } - } - - /** - * The List VirtualNetworkGatewayConnections operation retrieves all the - * virtual network gateways connections created. - * - * @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; - }); - }); - } - - /** - * The List VirtualNetworkGatewayConnections operation retrieves all the - * virtual network gateways connections created. - * - * @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 {VirtualNetworkGatewayConnectionListResult} - 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 VirtualNetworkGatewayConnectionListResult} - * 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 = VirtualNetworkGatewayConnections; diff --git a/lib/services/networkManagement2/lib/operations/virtualNetworkGateways.js b/lib/services/networkManagement2/lib/operations/virtualNetworkGateways.js deleted file mode 100644 index 0c2a15595..000000000 --- a/lib/services/networkManagement2/lib/operations/virtualNetworkGateways.js +++ /dev/null @@ -1,8172 +0,0 @@ -/* - * 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; - - -/** - * Creates or updates a virtual network gateway in the specified resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to create or update virtual - * network gateway operation. - * - * @param {array} [parameters.ipConfigurations] IP configurations for virtual - * network gateway. - * - * @param {string} [parameters.gatewayType] The type of this virtual network - * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values - * include: 'Vpn', 'ExpressRoute' - * - * @param {string} [parameters.vpnType] The type of this virtual network - * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible - * values include: 'PolicyBased', 'RouteBased' - * - * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this - * virtual network gateway or not. - * - * @param {boolean} [parameters.activeActive] ActiveActive flag - * - * @param {object} [parameters.gatewayDefaultSite] The reference of the - * LocalNetworkGateway resource which represents local network site having - * default routes. Assign Null value in case of removing existing default site - * setting. - * - * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. - * - * @param {object} [parameters.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. - * - * @param {string} [parameters.sku.name] Gateway SKU name. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * - * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * - * @param {number} [parameters.sku.capacity] The capacity. - * - * @param {object} [parameters.vpnClientConfiguration] The reference of the - * VpnClientConfiguration resource which represents the P2S VpnClient - * configurations. - * - * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The - * reference of the address space resource which represents Address space for - * P2S VpnClient. - * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. - * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. - * - * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The - * radius server address property of the VirtualNetworkGateway resource for vpn - * client connection. - * - * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The - * radius secret property of the VirtualNetworkGateway resource for vpn client - * connection. - * - * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP - * speaker settings. - * - * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. - * - * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.bgpSettings.peerWeight] The weight added to - * routes learned from this BGP speaker. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGateway resource. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 VirtualNetworkGateway} 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 _createOrUpdate(resourceGroupName, virtualNetworkGatewayName, parameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualNetworkGateway']().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 the specified virtual network gateway by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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 VirtualNetworkGateway} 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, virtualNetworkGatewayName, 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-10-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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { - throw new Error('virtualNetworkGatewayName 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/virtualNetworkGateways/{virtualNetworkGatewayName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); - 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['VirtualNetworkGateway']().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); - }); -} - - -/** - * Deletes the specified virtual network gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, virtualNetworkGatewayName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, virtualNetworkGatewayName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * Updates a virtual network gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to update virtual network - * gateway tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 VirtualNetworkGateway} 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 _updateTags(resourceGroupName, virtualNetworkGatewayName, parameters, 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.'); - } - - // Send request - this.beginUpdateTags(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualNetworkGateway']().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 virtual network gateways by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 VirtualNetworkGatewayListResult} 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, 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-10-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 (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/virtualNetworkGateways'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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['VirtualNetworkGatewayListResult']().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 the connections in a virtual network gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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 VirtualNetworkGatewayListConnectionsResult} - * 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 _listConnections(resourceGroupName, virtualNetworkGatewayName, 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-10-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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { - throw new Error('virtualNetworkGatewayName 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/virtualNetworkGateways/{virtualNetworkGatewayName}/connections'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); - 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['VirtualNetworkGatewayListConnectionsResult']().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); - }); -} - - -/** - * Resets the primary of the virtual network gateway in the specified resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.gatewayVip] Virtual network gateway vip address - * supplied to the begin reset of the active-active feature enabled gateway. - * - * @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 VirtualNetworkGateway} 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 _reset(resourceGroupName, virtualNetworkGatewayName, 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.'); - } - - // Send request - this.beginReset(resourceGroupName, virtualNetworkGatewayName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualNetworkGateway']().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); - }); - }); -} - - -/** - * Resets the VPN client shared key of the virtual network gateway in the - * specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _resetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName, 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.'); - } - - // Send request - this.beginResetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * Generates VPN client package for P2S client of the virtual network gateway - * in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. - * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. - * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. - * - * @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. - * - * {string} [result] - The deserialized result object if an error did not occur. - * - * {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 _generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters, 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.'); - } - - // Send request - this.beginGeneratevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; - 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); - }); - }); -} - - -/** - * Generates VPN profile for P2S client of the virtual network gateway in the - * specified resource group. Used for IKEV2 and radius based authentication. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. - * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. - * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. - * - * @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. - * - * {string} [result] - The deserialized result object if an error did not occur. - * - * {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 _generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters, 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.'); - } - - // Send request - this.beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; - 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 pre-generated VPN profile for P2S client of the virtual network gateway - * in the specified resource group. The profile needs to be generated first - * using generateVpnProfile. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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. - * - * {string} [result] - The deserialized result object if an error did not occur. - * - * {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 _getVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, 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.'); - } - - // Send request - this.beginGetVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; - 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); - }); - }); -} - - -/** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.peer] The IP address of the peer to retrieve the - * status of. - * - * @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 BgpPeerStatusListResult} 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 _getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, 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.'); - } - - // Send request - this.beginGetBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BgpPeerStatusListResult']().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 a xml format representation for supported vpn devices. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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. - * - * {string} [result] - The deserialized result object if an error did not occur. - * - * {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 _supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, 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-10-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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { - throw new Error('virtualNetworkGatewayName 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/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); - 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 = 'POST'; - 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 = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; - 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); - }); -} - - -/** - * This operation retrieves a list of routes the virtual network gateway has - * learned, including routes learned from BGP peers. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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 GatewayRouteListResult} 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 _getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, 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.'); - } - - // Send request - this.beginGetLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['GatewayRouteListResult']().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); - }); - }); -} - - -/** - * This operation retrieves a list of routes the virtual network gateway is - * advertising to the specified peer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {string} peer The IP address of the peer - * - * @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 GatewayRouteListResult} 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 _getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, 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.'); - } - - // Send request - this.beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['GatewayRouteListResult']().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); - }); - }); -} - - -/** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy - * for P2S client of virtual network gateway in the specified resource group - * through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set - * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation - * through Network resource provider. - * - * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for - * P2S client. - * - * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) payload size in KB for - * P2S client.. - * - * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption - * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', - * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' - * - * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity - * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'GCMAES128', 'GCMAES192', 'GCMAES256' - * - * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption - * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', - * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' - * - * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity - * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'SHA384', 'GCMAES256', 'GCMAES128' - * - * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase - * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', - * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' - * - * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE - * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', - * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' - * - * @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 VpnClientIPsecParameters} 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 _setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, 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.'); - } - - // Send request - this.beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VpnClientIPsecParameters']().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); - }); - }); -} - - -/** - * The Get VpnclientIpsecParameters operation retrieves information about the - * vpnclient ipsec policy for P2S client of virtual network gateway in the - * specified resource group through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The virtual network gateway name. - * - * @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 VpnClientIPsecParameters} 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 _getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, 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.'); - } - - // Send request - this.beginGetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VpnClientIPsecParameters']().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 a xml format representation for vpn device configuration script. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection for which the configuration script is generated. - * - * @param {object} parameters Parameters supplied to the generate vpn device - * script operation. - * - * @param {string} [parameters.vendor] The vendor for the vpn device. - * - * @param {string} [parameters.deviceFamily] The device family for the vpn - * device. - * - * @param {string} [parameters.firmwareVersion] The firmware version for the - * vpn device. - * - * @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. - * - * {string} [result] - The deserialized result object if an error did not occur. - * - * {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 _vpnDeviceConfigurationScript(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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-10-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 (virtualNetworkGatewayConnectionName === null || virtualNetworkGatewayConnectionName === undefined || typeof virtualNetworkGatewayConnectionName.valueOf() !== 'string') { - throw new Error('virtualNetworkGatewayConnectionName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkGatewayConnectionName}', encodeURIComponent(virtualNetworkGatewayConnectionName)); - 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 = 'POST'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['VpnDeviceScriptParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // 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 = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; - 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); - }); -} - -/** - * Creates or updates a virtual network gateway in the specified resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to create or update virtual - * network gateway operation. - * - * @param {array} [parameters.ipConfigurations] IP configurations for virtual - * network gateway. - * - * @param {string} [parameters.gatewayType] The type of this virtual network - * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values - * include: 'Vpn', 'ExpressRoute' - * - * @param {string} [parameters.vpnType] The type of this virtual network - * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible - * values include: 'PolicyBased', 'RouteBased' - * - * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this - * virtual network gateway or not. - * - * @param {boolean} [parameters.activeActive] ActiveActive flag - * - * @param {object} [parameters.gatewayDefaultSite] The reference of the - * LocalNetworkGateway resource which represents local network site having - * default routes. Assign Null value in case of removing existing default site - * setting. - * - * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. - * - * @param {object} [parameters.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. - * - * @param {string} [parameters.sku.name] Gateway SKU name. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * - * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * - * @param {number} [parameters.sku.capacity] The capacity. - * - * @param {object} [parameters.vpnClientConfiguration] The reference of the - * VpnClientConfiguration resource which represents the P2S VpnClient - * configurations. - * - * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The - * reference of the address space resource which represents Address space for - * P2S VpnClient. - * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. - * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. - * - * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The - * radius server address property of the VirtualNetworkGateway resource for vpn - * client connection. - * - * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The - * radius secret property of the VirtualNetworkGateway resource for vpn client - * connection. - * - * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP - * speaker settings. - * - * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. - * - * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.bgpSettings.peerWeight] The weight added to - * routes learned from this BGP speaker. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGateway resource. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 VirtualNetworkGateway} 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 _beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayName, parameters, 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-10-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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { - throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/virtualNetworkGateways/{virtualNetworkGatewayName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['VirtualNetworkGateway']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['VirtualNetworkGateway']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualNetworkGateway']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Deletes the specified virtual network gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, virtualNetworkGatewayName, 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-10-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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { - throw new Error('virtualNetworkGatewayName 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/virtualNetworkGateways/{virtualNetworkGatewayName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Updates a virtual network gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to update virtual network - * gateway tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 VirtualNetworkGateway} 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 _beginUpdateTags(resourceGroupName, virtualNetworkGatewayName, parameters, 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-10-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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { - throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/virtualNetworkGateways/{virtualNetworkGatewayName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); - 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 = 'PATCH'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['TagsObject']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // 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['VirtualNetworkGateway']().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); - }); -} - -/** - * Resets the primary of the virtual network gateway in the specified resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.gatewayVip] Virtual network gateway vip address - * supplied to the begin reset of the active-active feature enabled gateway. - * - * @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 VirtualNetworkGateway} 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 _beginReset(resourceGroupName, virtualNetworkGatewayName, 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 gatewayVip = (options && options.gatewayVip !== undefined) ? options.gatewayVip : undefined; - let apiVersion = '2018-10-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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { - throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); - } - if (gatewayVip !== null && gatewayVip !== undefined && typeof gatewayVip.valueOf() !== 'string') { - throw new Error('gatewayVip 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/virtualNetworkGateways/{virtualNetworkGatewayName}/reset'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - if (gatewayVip !== null && gatewayVip !== undefined) { - queryParameters.push('gatewayVip=' + encodeURIComponent(gatewayVip)); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'POST'; - 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 && statusCode !== 202) { - 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['VirtualNetworkGateway']().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); - }); -} - -/** - * Resets the VPN client shared key of the virtual network gateway in the - * specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginResetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName, 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-10-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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { - throw new Error('virtualNetworkGatewayName 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/virtualNetworkGateways/{virtualNetworkGatewayName}/resetvpnclientsharedkey'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); - 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 = 'POST'; - 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 && statusCode !== 202) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Generates VPN client package for P2S client of the virtual network gateway - * in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. - * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. - * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. - * - * @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. - * - * {string} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginGeneratevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters, 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-10-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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { - throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); - 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 = 'POST'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['VpnClientParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // 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 = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; - 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); - }); -} - -/** - * Generates VPN profile for P2S client of the virtual network gateway in the - * specified resource group. Used for IKEV2 and radius based authentication. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. - * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. - * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. - * - * @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. - * - * {string} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters, 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-10-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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { - throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); - 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 = 'POST'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['VpnClientParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { - 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 = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; - 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 pre-generated VPN profile for P2S client of the virtual network gateway - * in the specified resource group. The profile needs to be generated first - * using generateVpnProfile. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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. - * - * {string} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginGetVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, 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-10-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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { - throw new Error('virtualNetworkGatewayName 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/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); - 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 = 'POST'; - 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 && statusCode !== 202) { - 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 = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; - 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); - }); -} - -/** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.peer] The IP address of the peer to retrieve the - * status of. - * - * @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 BgpPeerStatusListResult} 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 _beginGetBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, 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 peer = (options && options.peer !== undefined) ? options.peer : undefined; - let apiVersion = '2018-10-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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { - throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); - } - if (peer !== null && peer !== undefined && typeof peer.valueOf() !== 'string') { - throw new Error('peer 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/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - if (peer !== null && peer !== undefined) { - queryParameters.push('peer=' + encodeURIComponent(peer)); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'POST'; - 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 && statusCode !== 202) { - 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['BgpPeerStatusListResult']().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); - }); -} - -/** - * This operation retrieves a list of routes the virtual network gateway has - * learned, including routes learned from BGP peers. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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 GatewayRouteListResult} 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 _beginGetLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, 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-10-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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { - throw new Error('virtualNetworkGatewayName 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/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); - 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 = 'POST'; - 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 && statusCode !== 202) { - 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['GatewayRouteListResult']().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); - }); -} - -/** - * This operation retrieves a list of routes the virtual network gateway is - * advertising to the specified peer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {string} peer The IP address of the peer - * - * @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 GatewayRouteListResult} 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 _beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, 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-10-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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { - throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); - } - if (peer === null || peer === undefined || typeof peer.valueOf() !== 'string') { - throw new Error('peer 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/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('peer=' + encodeURIComponent(peer)); - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'POST'; - 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 && statusCode !== 202) { - 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['GatewayRouteListResult']().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); - }); -} - -/** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy - * for P2S client of virtual network gateway in the specified resource group - * through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set - * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation - * through Network resource provider. - * - * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for - * P2S client. - * - * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) payload size in KB for - * P2S client.. - * - * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption - * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', - * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' - * - * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity - * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'GCMAES128', 'GCMAES192', 'GCMAES256' - * - * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption - * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', - * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' - * - * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity - * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'SHA384', 'GCMAES256', 'GCMAES128' - * - * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase - * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', - * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' - * - * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE - * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', - * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' - * - * @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 VpnClientIPsecParameters} 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 _beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, 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-10-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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { - throw new Error('virtualNetworkGatewayName cannot be null or undefined and it must be of type string.'); - } - if (vpnclientIpsecParams === null || vpnclientIpsecParams === undefined) { - throw new Error('vpnclientIpsecParams cannot be null or undefined.'); - } - 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/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); - 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 = 'POST'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (vpnclientIpsecParams !== null && vpnclientIpsecParams !== undefined) { - let requestModelMapper = new client.models['VpnClientIPsecParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, vpnclientIpsecParams, 'vpnclientIpsecParams'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(vpnclientIpsecParams, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { - 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['VpnClientIPsecParameters']().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); - }); -} - -/** - * The Get VpnclientIpsecParameters operation retrieves information about the - * vpnclient ipsec policy for P2S client of virtual network gateway in the - * specified resource group through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The virtual network gateway name. - * - * @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 VpnClientIPsecParameters} 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 _beginGetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, 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-10-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 (virtualNetworkGatewayName === null || virtualNetworkGatewayName === undefined || typeof virtualNetworkGatewayName.valueOf() !== 'string') { - throw new Error('virtualNetworkGatewayName 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/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnclientipsecparameters'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkGatewayName}', encodeURIComponent(virtualNetworkGatewayName)); - 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 = 'POST'; - 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['VpnClientIPsecParameters']().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 virtual network gateways by resource group. - * - * @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 VirtualNetworkGatewayListResult} 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['VirtualNetworkGatewayListResult']().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 the connections in a virtual network gateway. - * - * @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 VirtualNetworkGatewayListConnectionsResult} - * 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 _listConnectionsNext(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['VirtualNetworkGatewayListConnectionsResult']().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 VirtualNetworkGateways. */ -class VirtualNetworkGateways { - /** - * Create a VirtualNetworkGateways. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._createOrUpdate = _createOrUpdate; - this._get = _get; - this._deleteMethod = _deleteMethod; - this._updateTags = _updateTags; - this._list = _list; - this._listConnections = _listConnections; - this._reset = _reset; - this._resetVpnClientSharedKey = _resetVpnClientSharedKey; - this._generatevpnclientpackage = _generatevpnclientpackage; - this._generateVpnProfile = _generateVpnProfile; - this._getVpnProfilePackageUrl = _getVpnProfilePackageUrl; - this._getBgpPeerStatus = _getBgpPeerStatus; - this._supportedVpnDevices = _supportedVpnDevices; - this._getLearnedRoutes = _getLearnedRoutes; - this._getAdvertisedRoutes = _getAdvertisedRoutes; - this._setVpnclientIpsecParameters = _setVpnclientIpsecParameters; - this._getVpnclientIpsecParameters = _getVpnclientIpsecParameters; - this._vpnDeviceConfigurationScript = _vpnDeviceConfigurationScript; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginUpdateTags = _beginUpdateTags; - this._beginReset = _beginReset; - this._beginResetVpnClientSharedKey = _beginResetVpnClientSharedKey; - this._beginGeneratevpnclientpackage = _beginGeneratevpnclientpackage; - this._beginGenerateVpnProfile = _beginGenerateVpnProfile; - this._beginGetVpnProfilePackageUrl = _beginGetVpnProfilePackageUrl; - this._beginGetBgpPeerStatus = _beginGetBgpPeerStatus; - this._beginGetLearnedRoutes = _beginGetLearnedRoutes; - this._beginGetAdvertisedRoutes = _beginGetAdvertisedRoutes; - this._beginSetVpnclientIpsecParameters = _beginSetVpnclientIpsecParameters; - this._beginGetVpnclientIpsecParameters = _beginGetVpnclientIpsecParameters; - this._listNext = _listNext; - this._listConnectionsNext = _listConnectionsNext; - } - - /** - * Creates or updates a virtual network gateway in the specified resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to create or update virtual - * network gateway operation. - * - * @param {array} [parameters.ipConfigurations] IP configurations for virtual - * network gateway. - * - * @param {string} [parameters.gatewayType] The type of this virtual network - * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values - * include: 'Vpn', 'ExpressRoute' - * - * @param {string} [parameters.vpnType] The type of this virtual network - * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible - * values include: 'PolicyBased', 'RouteBased' - * - * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this - * virtual network gateway or not. - * - * @param {boolean} [parameters.activeActive] ActiveActive flag - * - * @param {object} [parameters.gatewayDefaultSite] The reference of the - * LocalNetworkGateway resource which represents local network site having - * default routes. Assign Null value in case of removing existing default site - * setting. - * - * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. - * - * @param {object} [parameters.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. - * - * @param {string} [parameters.sku.name] Gateway SKU name. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * - * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * - * @param {number} [parameters.sku.capacity] The capacity. - * - * @param {object} [parameters.vpnClientConfiguration] The reference of the - * VpnClientConfiguration resource which represents the P2S VpnClient - * configurations. - * - * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The - * reference of the address space resource which represents Address space for - * P2S VpnClient. - * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. - * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. - * - * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The - * radius server address property of the VirtualNetworkGateway resource for vpn - * client connection. - * - * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The - * radius secret property of the VirtualNetworkGateway resource for vpn client - * connection. - * - * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP - * speaker settings. - * - * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. - * - * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.bgpSettings.peerWeight] The weight added to - * routes learned from this BGP speaker. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGateway resource. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a virtual network gateway in the specified resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to create or update virtual - * network gateway operation. - * - * @param {array} [parameters.ipConfigurations] IP configurations for virtual - * network gateway. - * - * @param {string} [parameters.gatewayType] The type of this virtual network - * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values - * include: 'Vpn', 'ExpressRoute' - * - * @param {string} [parameters.vpnType] The type of this virtual network - * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible - * values include: 'PolicyBased', 'RouteBased' - * - * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this - * virtual network gateway or not. - * - * @param {boolean} [parameters.activeActive] ActiveActive flag - * - * @param {object} [parameters.gatewayDefaultSite] The reference of the - * LocalNetworkGateway resource which represents local network site having - * default routes. Assign Null value in case of removing existing default site - * setting. - * - * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. - * - * @param {object} [parameters.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. - * - * @param {string} [parameters.sku.name] Gateway SKU name. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * - * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * - * @param {number} [parameters.sku.capacity] The capacity. - * - * @param {object} [parameters.vpnClientConfiguration] The reference of the - * VpnClientConfiguration resource which represents the P2S VpnClient - * configurations. - * - * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The - * reference of the address space resource which represents Address space for - * P2S VpnClient. - * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. - * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. - * - * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The - * radius server address property of the VirtualNetworkGateway resource for vpn - * client connection. - * - * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The - * radius secret property of the VirtualNetworkGateway resource for vpn client - * connection. - * - * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP - * speaker settings. - * - * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. - * - * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.bgpSettings.peerWeight] The weight added to - * routes learned from this BGP speaker. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGateway resource. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetworkGateway} - 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 VirtualNetworkGateway} 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. - */ - createOrUpdate(resourceGroupName, virtualNetworkGatewayName, parameters, 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._createOrUpdate(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, virtualNetworkGatewayName, parameters, options, optionalCallback); - } - } - - /** - * Gets the specified virtual network gateway by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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, virtualNetworkGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, virtualNetworkGatewayName, 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 virtual network gateway by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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 {VirtualNetworkGateway} - 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 VirtualNetworkGateway} 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, virtualNetworkGatewayName, 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, virtualNetworkGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); - } - } - - /** - * Deletes the specified virtual network gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified virtual network gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, virtualNetworkGatewayName, 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._deleteMethod(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); - } - } - - /** - * Updates a virtual network gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to update virtual network - * gateway tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateTags(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates a virtual network gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to update virtual network - * gateway tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetworkGateway} - 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 VirtualNetworkGateway} 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. - */ - updateTags(resourceGroupName, virtualNetworkGatewayName, parameters, 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._updateTags(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateTags(resourceGroupName, virtualNetworkGatewayName, parameters, options, optionalCallback); - } - } - - /** - * Gets all virtual network gateways by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, 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 virtual network gateways by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {VirtualNetworkGatewayListResult} - 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 VirtualNetworkGatewayListResult} 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, 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, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, options, optionalCallback); - } - } - - /** - * Gets all the connections in a virtual network gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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. - */ - listConnectionsWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listConnections(resourceGroupName, virtualNetworkGatewayName, 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 the connections in a virtual network gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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 {VirtualNetworkGatewayListConnectionsResult} - 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 VirtualNetworkGatewayListConnectionsResult} - * 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. - */ - listConnections(resourceGroupName, virtualNetworkGatewayName, 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._listConnections(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listConnections(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); - } - } - - /** - * Resets the primary of the virtual network gateway in the specified resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.gatewayVip] Virtual network gateway vip address - * supplied to the begin reset of the active-active feature enabled gateway. - * - * @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. - */ - resetWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._reset(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Resets the primary of the virtual network gateway in the specified resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.gatewayVip] Virtual network gateway vip address - * supplied to the begin reset of the active-active feature enabled gateway. - * - * @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 {VirtualNetworkGateway} - 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 VirtualNetworkGateway} 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. - */ - reset(resourceGroupName, virtualNetworkGatewayName, 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._reset(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._reset(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); - } - } - - /** - * Resets the VPN client shared key of the virtual network gateway in the - * specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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. - */ - resetVpnClientSharedKeyWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._resetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Resets the VPN client shared key of the virtual network gateway in the - * specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - resetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName, 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._resetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._resetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); - } - } - - /** - * Generates VPN client package for P2S client of the virtual network gateway - * in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. - * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. - * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. - * - * @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. - */ - generatevpnclientpackageWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Generates VPN client package for P2S client of the virtual network gateway - * in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. - * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. - * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. - * - * @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 {String} - 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. - * - * {string} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters, 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._generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._generatevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters, options, optionalCallback); - } - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the - * specified resource group. Used for IKEV2 and radius based authentication. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. - * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. - * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. - * - * @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. - */ - generateVpnProfileWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the - * specified resource group. Used for IKEV2 and radius based authentication. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. - * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. - * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. - * - * @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 {String} - 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. - * - * {string} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters, 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._generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._generateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters, options, optionalCallback); - } - } - - /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway - * in the specified resource group. The profile needs to be generated first - * using generateVpnProfile. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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. - */ - getVpnProfilePackageUrlWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway - * in the specified resource group. The profile needs to be generated first - * using generateVpnProfile. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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 {String} - 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. - * - * {string} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, 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._getVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); - } - } - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.peer] The IP address of the peer to retrieve the - * status of. - * - * @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. - */ - getBgpPeerStatusWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.peer] The IP address of the peer to retrieve the - * status of. - * - * @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 {BgpPeerStatusListResult} - 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 BgpPeerStatusListResult} 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. - */ - getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, 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._getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); - } - } - - /** - * Gets a xml format representation for supported vpn devices. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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. - */ - supportedVpnDevicesWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets a xml format representation for supported vpn devices. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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 {String} - 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. - * - * {string} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, 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._supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); - } - } - - /** - * This operation retrieves a list of routes the virtual network gateway has - * learned, including routes learned from BGP peers. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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. - */ - getLearnedRoutesWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * This operation retrieves a list of routes the virtual network gateway has - * learned, including routes learned from BGP peers. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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 {GatewayRouteListResult} - 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 GatewayRouteListResult} 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. - */ - getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, 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._getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); - } - } - - /** - * This operation retrieves a list of routes the virtual network gateway is - * advertising to the specified peer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {string} peer The IP address of the peer - * - * @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. - */ - getAdvertisedRoutesWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, peer, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * This operation retrieves a list of routes the virtual network gateway is - * advertising to the specified peer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {string} peer The IP address of the peer - * - * @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 {GatewayRouteListResult} - 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 GatewayRouteListResult} 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. - */ - getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, 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._getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, optionalCallback); - } - } - - /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy - * for P2S client of virtual network gateway in the specified resource group - * through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set - * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation - * through Network resource provider. - * - * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for - * P2S client. - * - * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) payload size in KB for - * P2S client.. - * - * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption - * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', - * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' - * - * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity - * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'GCMAES128', 'GCMAES192', 'GCMAES256' - * - * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption - * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', - * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' - * - * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity - * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'SHA384', 'GCMAES256', 'GCMAES128' - * - * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase - * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', - * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' - * - * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE - * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', - * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' - * - * @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. - */ - setVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy - * for P2S client of virtual network gateway in the specified resource group - * through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set - * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation - * through Network resource provider. - * - * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for - * P2S client. - * - * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) payload size in KB for - * P2S client.. - * - * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption - * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', - * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' - * - * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity - * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'GCMAES128', 'GCMAES192', 'GCMAES256' - * - * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption - * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', - * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' - * - * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity - * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'SHA384', 'GCMAES256', 'GCMAES128' - * - * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase - * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', - * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' - * - * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE - * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', - * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' - * - * @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 {VpnClientIPsecParameters} - 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 VpnClientIPsecParameters} 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. - */ - setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, 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._setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._setVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options, optionalCallback); - } - } - - /** - * The Get VpnclientIpsecParameters operation retrieves information about the - * vpnclient ipsec policy for P2S client of virtual network gateway in the - * specified resource group through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The virtual network gateway name. - * - * @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. - */ - getVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * The Get VpnclientIpsecParameters operation retrieves information about the - * vpnclient ipsec policy for P2S client of virtual network gateway in the - * specified resource group through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The virtual network gateway name. - * - * @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 {VpnClientIPsecParameters} - 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 VpnClientIPsecParameters} 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. - */ - getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, 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._getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); - } - } - - /** - * Gets a xml format representation for vpn device configuration script. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection for which the configuration script is generated. - * - * @param {object} parameters Parameters supplied to the generate vpn device - * script operation. - * - * @param {string} [parameters.vendor] The vendor for the vpn device. - * - * @param {string} [parameters.deviceFamily] The device family for the vpn - * device. - * - * @param {string} [parameters.firmwareVersion] The firmware version for the - * vpn device. - * - * @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. - */ - vpnDeviceConfigurationScriptWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._vpnDeviceConfigurationScript(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets a xml format representation for vpn device configuration script. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayConnectionName The name of the virtual - * network gateway connection for which the configuration script is generated. - * - * @param {object} parameters Parameters supplied to the generate vpn device - * script operation. - * - * @param {string} [parameters.vendor] The vendor for the vpn device. - * - * @param {string} [parameters.deviceFamily] The device family for the vpn - * device. - * - * @param {string} [parameters.firmwareVersion] The firmware version for the - * vpn device. - * - * @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 {String} - 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. - * - * {string} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - vpnDeviceConfigurationScript(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, 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._vpnDeviceConfigurationScript(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._vpnDeviceConfigurationScript(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, options, optionalCallback); - } - } - - /** - * Creates or updates a virtual network gateway in the specified resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to create or update virtual - * network gateway operation. - * - * @param {array} [parameters.ipConfigurations] IP configurations for virtual - * network gateway. - * - * @param {string} [parameters.gatewayType] The type of this virtual network - * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values - * include: 'Vpn', 'ExpressRoute' - * - * @param {string} [parameters.vpnType] The type of this virtual network - * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible - * values include: 'PolicyBased', 'RouteBased' - * - * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this - * virtual network gateway or not. - * - * @param {boolean} [parameters.activeActive] ActiveActive flag - * - * @param {object} [parameters.gatewayDefaultSite] The reference of the - * LocalNetworkGateway resource which represents local network site having - * default routes. Assign Null value in case of removing existing default site - * setting. - * - * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. - * - * @param {object} [parameters.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. - * - * @param {string} [parameters.sku.name] Gateway SKU name. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * - * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * - * @param {number} [parameters.sku.capacity] The capacity. - * - * @param {object} [parameters.vpnClientConfiguration] The reference of the - * VpnClientConfiguration resource which represents the P2S VpnClient - * configurations. - * - * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The - * reference of the address space resource which represents Address space for - * P2S VpnClient. - * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. - * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. - * - * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The - * radius server address property of the VirtualNetworkGateway resource for vpn - * client connection. - * - * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The - * radius secret property of the VirtualNetworkGateway resource for vpn client - * connection. - * - * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP - * speaker settings. - * - * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. - * - * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.bgpSettings.peerWeight] The weight added to - * routes learned from this BGP speaker. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGateway resource. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a virtual network gateway in the specified resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to create or update virtual - * network gateway operation. - * - * @param {array} [parameters.ipConfigurations] IP configurations for virtual - * network gateway. - * - * @param {string} [parameters.gatewayType] The type of this virtual network - * gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values - * include: 'Vpn', 'ExpressRoute' - * - * @param {string} [parameters.vpnType] The type of this virtual network - * gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible - * values include: 'PolicyBased', 'RouteBased' - * - * @param {boolean} [parameters.enableBgp] Whether BGP is enabled for this - * virtual network gateway or not. - * - * @param {boolean} [parameters.activeActive] ActiveActive flag - * - * @param {object} [parameters.gatewayDefaultSite] The reference of the - * LocalNetworkGateway resource which represents local network site having - * default routes. Assign Null value in case of removing existing default site - * setting. - * - * @param {string} [parameters.gatewayDefaultSite.id] Resource ID. - * - * @param {object} [parameters.sku] The reference of the - * VirtualNetworkGatewaySku resource which represents the SKU selected for - * Virtual network gateway. - * - * @param {string} [parameters.sku.name] Gateway SKU name. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * - * @param {string} [parameters.sku.tier] Gateway SKU tier. Possible values - * include: 'Basic', 'HighPerformance', 'Standard', 'UltraPerformance', - * 'VpnGw1', 'VpnGw2', 'VpnGw3', 'VpnGw1AZ', 'VpnGw2AZ', 'VpnGw3AZ', 'ErGw1AZ', - * 'ErGw2AZ', 'ErGw3AZ' - * - * @param {number} [parameters.sku.capacity] The capacity. - * - * @param {object} [parameters.vpnClientConfiguration] The reference of the - * VpnClientConfiguration resource which represents the P2S VpnClient - * configurations. - * - * @param {object} [parameters.vpnClientConfiguration.vpnClientAddressPool] The - * reference of the address space resource which represents Address space for - * P2S VpnClient. - * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes] A - * list of address blocks reserved for this virtual network in CIDR notation. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientRootCertificates] - * VpnClientRootCertificate for virtual network gateway. - * - * @param {array} - * [parameters.vpnClientConfiguration.vpnClientRevokedCertificates] - * VpnClientRevokedCertificate for Virtual network gateway. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientProtocols] - * VpnClientProtocols for Virtual network gateway. - * - * @param {array} [parameters.vpnClientConfiguration.vpnClientIpsecPolicies] - * VpnClientIpsecPolicies for virtual network gateway P2S client. - * - * @param {string} [parameters.vpnClientConfiguration.radiusServerAddress] The - * radius server address property of the VirtualNetworkGateway resource for vpn - * client connection. - * - * @param {string} [parameters.vpnClientConfiguration.radiusServerSecret] The - * radius secret property of the VirtualNetworkGateway resource for vpn client - * connection. - * - * @param {object} [parameters.bgpSettings] Virtual network gateway's BGP - * speaker settings. - * - * @param {number} [parameters.bgpSettings.asn] The BGP speaker's ASN. - * - * @param {string} [parameters.bgpSettings.bgpPeeringAddress] The BGP peering - * address and BGP identifier of this BGP speaker. - * - * @param {number} [parameters.bgpSettings.peerWeight] The weight added to - * routes learned from this BGP speaker. - * - * @param {string} [parameters.resourceGuid] The resource GUID property of the - * VirtualNetworkGateway resource. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetworkGateway} - 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 VirtualNetworkGateway} 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. - */ - beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayName, parameters, 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._beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, virtualNetworkGatewayName, parameters, options, optionalCallback); - } - } - - /** - * Deletes the specified virtual network gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified virtual network gateway. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, virtualNetworkGatewayName, 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._beginDeleteMethod(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); - } - } - - /** - * Updates a virtual network gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to update virtual network - * gateway tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginUpdateTags(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates a virtual network gateway tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to update virtual network - * gateway tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetworkGateway} - 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 VirtualNetworkGateway} 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. - */ - beginUpdateTags(resourceGroupName, virtualNetworkGatewayName, parameters, 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._beginUpdateTags(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginUpdateTags(resourceGroupName, virtualNetworkGatewayName, parameters, options, optionalCallback); - } - } - - /** - * Resets the primary of the virtual network gateway in the specified resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.gatewayVip] Virtual network gateway vip address - * supplied to the begin reset of the active-active feature enabled gateway. - * - * @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. - */ - beginResetWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginReset(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Resets the primary of the virtual network gateway in the specified resource - * group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.gatewayVip] Virtual network gateway vip address - * supplied to the begin reset of the active-active feature enabled gateway. - * - * @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 {VirtualNetworkGateway} - 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 VirtualNetworkGateway} 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. - */ - beginReset(resourceGroupName, virtualNetworkGatewayName, 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._beginReset(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginReset(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); - } - } - - /** - * Resets the VPN client shared key of the virtual network gateway in the - * specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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. - */ - beginResetVpnClientSharedKeyWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginResetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Resets the VPN client shared key of the virtual network gateway in the - * specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginResetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName, 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._beginResetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginResetVpnClientSharedKey(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); - } - } - - /** - * Generates VPN client package for P2S client of the virtual network gateway - * in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. - * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. - * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. - * - * @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. - */ - beginGeneratevpnclientpackageWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginGeneratevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Generates VPN client package for P2S client of the virtual network gateway - * in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. - * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. - * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. - * - * @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 {String} - 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. - * - * {string} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginGeneratevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters, 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._beginGeneratevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginGeneratevpnclientpackage(resourceGroupName, virtualNetworkGatewayName, parameters, options, optionalCallback); - } - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the - * specified resource group. Used for IKEV2 and radius based authentication. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. - * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. - * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. - * - * @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. - */ - beginGenerateVpnProfileWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Generates VPN profile for P2S client of the virtual network gateway in the - * specified resource group. Used for IKEV2 and radius based authentication. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} parameters Parameters supplied to the generate virtual - * network gateway VPN client package operation. - * - * @param {string} [parameters.processorArchitecture] VPN client Processor - * Architecture. Possible values are: 'AMD64' and 'X86'. Possible values - * include: 'Amd64', 'X86' - * - * @param {string} [parameters.authenticationMethod] VPN client Authentication - * Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values - * include: 'EAPTLS', 'EAPMSCHAPv2' - * - * @param {string} [parameters.radiusServerAuthCertificate] The public - * certificate data for the radius server authentication certificate as a - * Base-64 encoded string. Required only if external radius authentication has - * been configured with EAPTLS authentication. - * - * @param {array} [parameters.clientRootCertificates] A list of client root - * certificates public certificate data encoded as Base-64 strings. Optional - * parameter for external radius based authentication with EAPTLS. - * - * @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 {String} - 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. - * - * {string} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters, 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._beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginGenerateVpnProfile(resourceGroupName, virtualNetworkGatewayName, parameters, options, optionalCallback); - } - } - - /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway - * in the specified resource group. The profile needs to be generated first - * using generateVpnProfile. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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. - */ - beginGetVpnProfilePackageUrlWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginGetVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets pre-generated VPN profile for P2S client of the virtual network gateway - * in the specified resource group. The profile needs to be generated first - * using generateVpnProfile. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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 {String} - 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. - * - * {string} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginGetVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, 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._beginGetVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginGetVpnProfilePackageUrl(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); - } - } - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.peer] The IP address of the peer to retrieve the - * status of. - * - * @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. - */ - beginGetBgpPeerStatusWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginGetBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * The GetBgpPeerStatus operation retrieves the status of all BGP peers. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.peer] The IP address of the peer to retrieve the - * status of. - * - * @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 {BgpPeerStatusListResult} - 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 BgpPeerStatusListResult} 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. - */ - beginGetBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, 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._beginGetBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginGetBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); - } - } - - /** - * This operation retrieves a list of routes the virtual network gateway has - * learned, including routes learned from BGP peers. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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. - */ - beginGetLearnedRoutesWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginGetLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * This operation retrieves a list of routes the virtual network gateway has - * learned, including routes learned from BGP peers. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @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 {GatewayRouteListResult} - 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 GatewayRouteListResult} 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. - */ - beginGetLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, 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._beginGetLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginGetLearnedRoutes(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); - } - } - - /** - * This operation retrieves a list of routes the virtual network gateway is - * advertising to the specified peer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {string} peer The IP address of the peer - * - * @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. - */ - beginGetAdvertisedRoutesWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, peer, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * This operation retrieves a list of routes the virtual network gateway is - * advertising to the specified peer. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {string} peer The IP address of the peer - * - * @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 {GatewayRouteListResult} - 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 GatewayRouteListResult} 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. - */ - beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, 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._beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginGetAdvertisedRoutes(resourceGroupName, virtualNetworkGatewayName, peer, options, optionalCallback); - } - } - - /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy - * for P2S client of virtual network gateway in the specified resource group - * through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set - * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation - * through Network resource provider. - * - * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for - * P2S client. - * - * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) payload size in KB for - * P2S client.. - * - * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption - * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', - * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' - * - * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity - * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'GCMAES128', 'GCMAES192', 'GCMAES256' - * - * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption - * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', - * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' - * - * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity - * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'SHA384', 'GCMAES256', 'GCMAES128' - * - * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase - * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', - * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' - * - * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE - * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', - * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' - * - * @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. - */ - beginSetVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy - * for P2S client of virtual network gateway in the specified resource group - * through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The name of the virtual network - * gateway. - * - * @param {object} vpnclientIpsecParams Parameters supplied to the Begin Set - * vpnclient ipsec parameters of Virtual Network Gateway P2S client operation - * through Network resource provider. - * - * @param {number} vpnclientIpsecParams.saLifeTimeSeconds The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for - * P2S client. - * - * @param {number} vpnclientIpsecParams.saDataSizeKilobytes The IPSec Security - * Association (also called Quick Mode or Phase 2 SA) payload size in KB for - * P2S client.. - * - * @param {string} vpnclientIpsecParams.ipsecEncryption The IPSec encryption - * algorithm (IKE phase 1). Possible values include: 'None', 'DES', 'DES3', - * 'AES128', 'AES192', 'AES256', 'GCMAES128', 'GCMAES192', 'GCMAES256' - * - * @param {string} vpnclientIpsecParams.ipsecIntegrity The IPSec integrity - * algorithm (IKE phase 1). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'GCMAES128', 'GCMAES192', 'GCMAES256' - * - * @param {string} vpnclientIpsecParams.ikeEncryption The IKE encryption - * algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', - * 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' - * - * @param {string} vpnclientIpsecParams.ikeIntegrity The IKE integrity - * algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', - * 'SHA384', 'GCMAES256', 'GCMAES128' - * - * @param {string} vpnclientIpsecParams.dhGroup The DH Groups used in IKE Phase - * 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', - * 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' - * - * @param {string} vpnclientIpsecParams.pfsGroup The Pfs Groups used in IKE - * Phase 2 for new child SA. Possible values include: 'None', 'PFS1', 'PFS2', - * 'PFS2048', 'ECP256', 'ECP384', 'PFS24', 'PFS14', 'PFSMM' - * - * @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 {VpnClientIPsecParameters} - 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 VpnClientIPsecParameters} 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. - */ - beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, 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._beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginSetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams, options, optionalCallback); - } - } - - /** - * The Get VpnclientIpsecParameters operation retrieves information about the - * vpnclient ipsec policy for P2S client of virtual network gateway in the - * specified resource group through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The virtual network gateway name. - * - * @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. - */ - beginGetVpnclientIpsecParametersWithHttpOperationResponse(resourceGroupName, virtualNetworkGatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginGetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * The Get VpnclientIpsecParameters operation retrieves information about the - * vpnclient ipsec policy for P2S client of virtual network gateway in the - * specified resource group through Network resource provider. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkGatewayName The virtual network gateway name. - * - * @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 {VpnClientIPsecParameters} - 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 VpnClientIPsecParameters} 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. - */ - beginGetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, 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._beginGetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginGetVpnclientIpsecParameters(resourceGroupName, virtualNetworkGatewayName, options, optionalCallback); - } - } - - /** - * Gets all virtual network gateways by resource group. - * - * @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 virtual network gateways by resource group. - * - * @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 {VirtualNetworkGatewayListResult} - 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 VirtualNetworkGatewayListResult} 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); - } - } - - /** - * Gets all the connections in a virtual network gateway. - * - * @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. - */ - listConnectionsNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listConnectionsNext(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 the connections in a virtual network gateway. - * - * @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 {VirtualNetworkGatewayListConnectionsResult} - 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 VirtualNetworkGatewayListConnectionsResult} - * 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. - */ - listConnectionsNext(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._listConnectionsNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listConnectionsNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = VirtualNetworkGateways; diff --git a/lib/services/networkManagement2/lib/operations/virtualNetworkPeerings.js b/lib/services/networkManagement2/lib/operations/virtualNetworkPeerings.js deleted file mode 100644 index 1cc1930e3..000000000 --- a/lib/services/networkManagement2/lib/operations/virtualNetworkPeerings.js +++ /dev/null @@ -1,1875 +0,0 @@ -/* - * 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; - - -/** - * Deletes the specified virtual network peering. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} virtualNetworkPeeringName The name of the virtual network - * 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets the specified virtual network peering. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} virtualNetworkPeeringName The name of the virtual network - * 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 VirtualNetworkPeering} 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, virtualNetworkName, virtualNetworkPeeringName, 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-10-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 (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { - throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); - } - if (virtualNetworkPeeringName === null || virtualNetworkPeeringName === undefined || typeof virtualNetworkPeeringName.valueOf() !== 'string') { - throw new Error('virtualNetworkPeeringName 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/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); - requestUrl = requestUrl.replace('{virtualNetworkPeeringName}', encodeURIComponent(virtualNetworkPeeringName)); - 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['VirtualNetworkPeering']().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); - }); -} - - -/** - * Creates or updates a peering in the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} virtualNetworkPeeringName The name of the peering. - * - * @param {object} virtualNetworkPeeringParameters Parameters supplied to the - * create or update virtual network peering operation. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] - * Whether the VMs in the linked virtual network space would be able to access - * all the VMs in local Virtual network space. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] - * Whether the forwarded traffic from the VMs in the remote virtual network - * will be allowed/disallowed. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If - * gateway links can be used in remote virtual networking to link to this - * virtual network. - * - * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If - * remote gateways can be used on this virtual network. If the flag is set to - * true, and allowGatewayTransit on remote peering is also true, virtual - * network will use gateways of remote virtual network for transit. Only one - * peering can have this flag set to true. This flag cannot be set if virtual - * network already has a gateway. - * - * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The - * reference of the remote virtual network. The remote virtual network can be - * in the same or different region (preview). See here to register for the - * preview and learn more - * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). - * - * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] - * Resource ID. - * - * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The - * reference of the remote virtual network address space. - * - * @param {array} - * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of - * the virtual network peering. Possible values are 'Initiated', 'Connected', - * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', - * 'Disconnected' - * - * @param {string} [virtualNetworkPeeringParameters.provisioningState] The - * provisioning state of the resource. - * - * @param {string} [virtualNetworkPeeringParameters.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. - * - * @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 VirtualNetworkPeering} 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 _createOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualNetworkPeering']().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 virtual network peerings in a virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @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 VirtualNetworkPeeringListResult} 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, virtualNetworkName, 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-10-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 (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { - throw new Error('virtualNetworkName 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/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); - 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['VirtualNetworkPeeringListResult']().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); - }); -} - -/** - * Deletes the specified virtual network peering. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} virtualNetworkPeeringName The name of the virtual network - * 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, 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-10-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 (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { - throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); - } - if (virtualNetworkPeeringName === null || virtualNetworkPeeringName === undefined || typeof virtualNetworkPeeringName.valueOf() !== 'string') { - throw new Error('virtualNetworkPeeringName 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/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); - requestUrl = requestUrl.replace('{virtualNetworkPeeringName}', encodeURIComponent(virtualNetworkPeeringName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates a peering in the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} virtualNetworkPeeringName The name of the peering. - * - * @param {object} virtualNetworkPeeringParameters Parameters supplied to the - * create or update virtual network peering operation. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] - * Whether the VMs in the linked virtual network space would be able to access - * all the VMs in local Virtual network space. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] - * Whether the forwarded traffic from the VMs in the remote virtual network - * will be allowed/disallowed. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If - * gateway links can be used in remote virtual networking to link to this - * virtual network. - * - * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If - * remote gateways can be used on this virtual network. If the flag is set to - * true, and allowGatewayTransit on remote peering is also true, virtual - * network will use gateways of remote virtual network for transit. Only one - * peering can have this flag set to true. This flag cannot be set if virtual - * network already has a gateway. - * - * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The - * reference of the remote virtual network. The remote virtual network can be - * in the same or different region (preview). See here to register for the - * preview and learn more - * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). - * - * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] - * Resource ID. - * - * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The - * reference of the remote virtual network address space. - * - * @param {array} - * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of - * the virtual network peering. Possible values are 'Initiated', 'Connected', - * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', - * 'Disconnected' - * - * @param {string} [virtualNetworkPeeringParameters.provisioningState] The - * provisioning state of the resource. - * - * @param {string} [virtualNetworkPeeringParameters.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. - * - * @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 VirtualNetworkPeering} 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 _beginCreateOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, 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-10-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 (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { - throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); - } - if (virtualNetworkPeeringName === null || virtualNetworkPeeringName === undefined || typeof virtualNetworkPeeringName.valueOf() !== 'string') { - throw new Error('virtualNetworkPeeringName cannot be null or undefined and it must be of type string.'); - } - if (virtualNetworkPeeringParameters === null || virtualNetworkPeeringParameters === undefined) { - throw new Error('virtualNetworkPeeringParameters cannot be null or undefined.'); - } - 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/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); - requestUrl = requestUrl.replace('{virtualNetworkPeeringName}', encodeURIComponent(virtualNetworkPeeringName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (virtualNetworkPeeringParameters !== null && virtualNetworkPeeringParameters !== undefined) { - let requestModelMapper = new client.models['VirtualNetworkPeering']().mapper(); - requestModel = client.serialize(requestModelMapper, virtualNetworkPeeringParameters, 'virtualNetworkPeeringParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(virtualNetworkPeeringParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['VirtualNetworkPeering']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualNetworkPeering']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Gets all virtual network peerings in a virtual network. - * - * @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 VirtualNetworkPeeringListResult} 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['VirtualNetworkPeeringListResult']().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 VirtualNetworkPeerings. */ -class VirtualNetworkPeerings { - /** - * Create a VirtualNetworkPeerings. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._list = _list; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._listNext = _listNext; - } - - /** - * Deletes the specified virtual network peering. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} virtualNetworkPeeringName The name of the virtual network - * 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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified virtual network peering. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} virtualNetworkPeeringName The name of the virtual network - * 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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, 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._deleteMethod(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options, optionalCallback); - } - } - - /** - * Gets the specified virtual network peering. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} virtualNetworkPeeringName The name of the virtual network - * 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. - */ - getWithHttpOperationResponse(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, 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 virtual network peering. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} virtualNetworkPeeringName The name of the virtual network - * 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 {VirtualNetworkPeering} - 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 VirtualNetworkPeering} 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, virtualNetworkName, virtualNetworkPeeringName, 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, virtualNetworkName, virtualNetworkPeeringName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options, optionalCallback); - } - } - - /** - * Creates or updates a peering in the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} virtualNetworkPeeringName The name of the peering. - * - * @param {object} virtualNetworkPeeringParameters Parameters supplied to the - * create or update virtual network peering operation. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] - * Whether the VMs in the linked virtual network space would be able to access - * all the VMs in local Virtual network space. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] - * Whether the forwarded traffic from the VMs in the remote virtual network - * will be allowed/disallowed. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If - * gateway links can be used in remote virtual networking to link to this - * virtual network. - * - * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If - * remote gateways can be used on this virtual network. If the flag is set to - * true, and allowGatewayTransit on remote peering is also true, virtual - * network will use gateways of remote virtual network for transit. Only one - * peering can have this flag set to true. This flag cannot be set if virtual - * network already has a gateway. - * - * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The - * reference of the remote virtual network. The remote virtual network can be - * in the same or different region (preview). See here to register for the - * preview and learn more - * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). - * - * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] - * Resource ID. - * - * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The - * reference of the remote virtual network address space. - * - * @param {array} - * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of - * the virtual network peering. Possible values are 'Initiated', 'Connected', - * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', - * 'Disconnected' - * - * @param {string} [virtualNetworkPeeringParameters.provisioningState] The - * provisioning state of the resource. - * - * @param {string} [virtualNetworkPeeringParameters.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a peering in the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} virtualNetworkPeeringName The name of the peering. - * - * @param {object} virtualNetworkPeeringParameters Parameters supplied to the - * create or update virtual network peering operation. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] - * Whether the VMs in the linked virtual network space would be able to access - * all the VMs in local Virtual network space. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] - * Whether the forwarded traffic from the VMs in the remote virtual network - * will be allowed/disallowed. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If - * gateway links can be used in remote virtual networking to link to this - * virtual network. - * - * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If - * remote gateways can be used on this virtual network. If the flag is set to - * true, and allowGatewayTransit on remote peering is also true, virtual - * network will use gateways of remote virtual network for transit. Only one - * peering can have this flag set to true. This flag cannot be set if virtual - * network already has a gateway. - * - * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The - * reference of the remote virtual network. The remote virtual network can be - * in the same or different region (preview). See here to register for the - * preview and learn more - * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). - * - * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] - * Resource ID. - * - * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The - * reference of the remote virtual network address space. - * - * @param {array} - * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of - * the virtual network peering. Possible values are 'Initiated', 'Connected', - * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', - * 'Disconnected' - * - * @param {string} [virtualNetworkPeeringParameters.provisioningState] The - * provisioning state of the resource. - * - * @param {string} [virtualNetworkPeeringParameters.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. - * - * @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 {VirtualNetworkPeering} - 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 VirtualNetworkPeering} 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. - */ - createOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, 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._createOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, options, optionalCallback); - } - } - - /** - * Gets all virtual network peerings in a virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @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, virtualNetworkName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, virtualNetworkName, 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 virtual network peerings in a virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @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 {VirtualNetworkPeeringListResult} - 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 VirtualNetworkPeeringListResult} 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, virtualNetworkName, 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, virtualNetworkName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, virtualNetworkName, options, optionalCallback); - } - } - - /** - * Deletes the specified virtual network peering. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} virtualNetworkPeeringName The name of the virtual network - * 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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified virtual network peering. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} virtualNetworkPeeringName The name of the virtual network - * 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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, 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._beginDeleteMethod(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, options, optionalCallback); - } - } - - /** - * Creates or updates a peering in the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} virtualNetworkPeeringName The name of the peering. - * - * @param {object} virtualNetworkPeeringParameters Parameters supplied to the - * create or update virtual network peering operation. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] - * Whether the VMs in the linked virtual network space would be able to access - * all the VMs in local Virtual network space. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] - * Whether the forwarded traffic from the VMs in the remote virtual network - * will be allowed/disallowed. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If - * gateway links can be used in remote virtual networking to link to this - * virtual network. - * - * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If - * remote gateways can be used on this virtual network. If the flag is set to - * true, and allowGatewayTransit on remote peering is also true, virtual - * network will use gateways of remote virtual network for transit. Only one - * peering can have this flag set to true. This flag cannot be set if virtual - * network already has a gateway. - * - * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The - * reference of the remote virtual network. The remote virtual network can be - * in the same or different region (preview). See here to register for the - * preview and learn more - * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). - * - * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] - * Resource ID. - * - * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The - * reference of the remote virtual network address space. - * - * @param {array} - * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of - * the virtual network peering. Possible values are 'Initiated', 'Connected', - * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', - * 'Disconnected' - * - * @param {string} [virtualNetworkPeeringParameters.provisioningState] The - * provisioning state of the resource. - * - * @param {string} [virtualNetworkPeeringParameters.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a peering in the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} virtualNetworkPeeringName The name of the peering. - * - * @param {object} virtualNetworkPeeringParameters Parameters supplied to the - * create or update virtual network peering operation. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowVirtualNetworkAccess] - * Whether the VMs in the linked virtual network space would be able to access - * all the VMs in local Virtual network space. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowForwardedTraffic] - * Whether the forwarded traffic from the VMs in the remote virtual network - * will be allowed/disallowed. - * - * @param {boolean} [virtualNetworkPeeringParameters.allowGatewayTransit] If - * gateway links can be used in remote virtual networking to link to this - * virtual network. - * - * @param {boolean} [virtualNetworkPeeringParameters.useRemoteGateways] If - * remote gateways can be used on this virtual network. If the flag is set to - * true, and allowGatewayTransit on remote peering is also true, virtual - * network will use gateways of remote virtual network for transit. Only one - * peering can have this flag set to true. This flag cannot be set if virtual - * network already has a gateway. - * - * @param {object} [virtualNetworkPeeringParameters.remoteVirtualNetwork] The - * reference of the remote virtual network. The remote virtual network can be - * in the same or different region (preview). See here to register for the - * preview and learn more - * (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). - * - * @param {string} [virtualNetworkPeeringParameters.remoteVirtualNetwork.id] - * Resource ID. - * - * @param {object} [virtualNetworkPeeringParameters.remoteAddressSpace] The - * reference of the remote virtual network address space. - * - * @param {array} - * [virtualNetworkPeeringParameters.remoteAddressSpace.addressPrefixes] A list - * of address blocks reserved for this virtual network in CIDR notation. - * - * @param {string} [virtualNetworkPeeringParameters.peeringState] The status of - * the virtual network peering. Possible values are 'Initiated', 'Connected', - * and 'Disconnected'. Possible values include: 'Initiated', 'Connected', - * 'Disconnected' - * - * @param {string} [virtualNetworkPeeringParameters.provisioningState] The - * provisioning state of the resource. - * - * @param {string} [virtualNetworkPeeringParameters.name] The name of the - * resource that is unique within a resource group. This name can be used to - * access the resource. - * - * @param {string} [virtualNetworkPeeringParameters.etag] A unique read-only - * string that changes whenever the resource is updated. - * - * @param {string} [virtualNetworkPeeringParameters.id] Resource ID. - * - * @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 {VirtualNetworkPeering} - 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 VirtualNetworkPeering} 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. - */ - beginCreateOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, 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._beginCreateOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, options, optionalCallback); - } - } - - /** - * Gets all virtual network peerings in a virtual network. - * - * @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 virtual network peerings in a virtual network. - * - * @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 {VirtualNetworkPeeringListResult} - 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 VirtualNetworkPeeringListResult} 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 = VirtualNetworkPeerings; diff --git a/lib/services/networkManagement2/lib/operations/virtualNetworkTaps.js b/lib/services/networkManagement2/lib/operations/virtualNetworkTaps.js deleted file mode 100644 index 83e005232..000000000 --- a/lib/services/networkManagement2/lib/operations/virtualNetworkTaps.js +++ /dev/null @@ -1,4392 +0,0 @@ -/* - * 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; - - -/** - * Deletes the specified virtual network tap. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the virtual network tap. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, tapName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, tapName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets information about the specified virtual network tap. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of virtual network tap. - * - * @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 VirtualNetworkTap} 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, tapName, 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-10-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 (tapName === null || tapName === undefined || typeof tapName.valueOf() !== 'string') { - throw new Error('tapName 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/virtualNetworkTaps/{tapName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{tapName}', encodeURIComponent(tapName)); - 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['VirtualNetworkTap']().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); - }); -} - - -/** - * Creates or updates a Virtual Network Tap. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the virtual network tap. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network tap operation. - * - * @param {object} [parameters.destinationNetworkInterfaceIPConfiguration] The - * reference to the private IP Address of the collector nic that will receive - * the tap - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.virtualNetworkTaps] - * The reference to Virtual Network Taps. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.applicationGatewayBackendAddressPools] - * The reference of ApplicationGatewayBackendAddressPool resource. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.loadBalancerBackendAddressPools] - * The reference of LoadBalancerBackendAddressPool resource. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.loadBalancerInboundNatRules] - * A list of references of LoadBalancerInboundNatRules. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAddress] - * Private IP address of the IP configuration. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAllocationMethod] - * Defines how a private IP address is assigned. Possible values are: 'Static' - * and 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAddressVersion] - * Available from Api-Version 2016-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * - * @param {object} - * [parameters.destinationNetworkInterfaceIPConfiguration.subnet] Subnet bound - * to the IP configuration. - * - * @param {boolean} - * [parameters.destinationNetworkInterfaceIPConfiguration.primary] Gets whether - * this is a primary customer address on the network interface. - * - * @param {object} - * [parameters.destinationNetworkInterfaceIPConfiguration.publicIPAddress] - * Public IP address bound to the IP configuration. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.applicationSecurityGroups] - * Application security groups in which the IP configuration is included. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.provisioningState] - * The provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.id] - * Resource ID. - * - * @param {object} [parameters.destinationLoadBalancerFrontEndIPConfiguration] - * The reference to the private IP address on the internal Load Balancer that - * will receive the tap - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.privateIPAllocationMethod] - * The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet] The - * reference of the subnet resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.tags] - * Resource tags. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * - * @param {boolean} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.tags] - * Resource tags. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.name] The - * name of the resource that is unique within a resource group. This name can - * be used to access the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.etag] A - * unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.id] - * Resource ID. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress] - * The reference of the Public IP resource. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku] - * The public IP address SKU. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku.name] - * Name of a public IP address SKU. Possible values include: 'Basic', - * 'Standard' - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is specified, - * an A DNS record is created for the public IP in the Microsoft Azure DNS - * system. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and the - * regionalized DNS zone. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipTags] - * The list of tags associated with the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipAddress] - * The IP address associated with the public IP address resource. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * - * @param {number} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.tags] - * Resource tags. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix] - * The reference of the Public IP Prefix resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.name] The name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.zones] A list of - * availability zones denoting the IP allocated for the resource needs to come - * from. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.id] Resource ID. - * - * @param {number} [parameters.destinationPort] The VXLAN destination port that - * will receive the tapped traffic. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 VirtualNetworkTap} 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 _createOrUpdate(resourceGroupName, tapName, parameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, tapName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualNetworkTap']().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); - }); - }); -} - - -/** - * Updates an VirtualNetworkTap tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the tap. - * - * @param {object} tapParameters Parameters supplied to update - * VirtualNetworkTap tags. - * - * @param {object} [tapParameters.tags] Resource tags. - * - * @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 VirtualNetworkTap} 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 _updateTags(resourceGroupName, tapName, tapParameters, 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.'); - } - - // Send request - this.beginUpdateTags(resourceGroupName, tapName, tapParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualNetworkTap']().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 the VirtualNetworkTaps in a subscription. - * - * @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 VirtualNetworkTapListResult} 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 _listAll(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/virtualNetworkTaps'; - 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['VirtualNetworkTapListResult']().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 the VirtualNetworkTaps in a subscription. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 VirtualNetworkTapListResult} 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 _listByResourceGroup(resourceGroupName, 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-10-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 (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/virtualNetworkTaps'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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['VirtualNetworkTapListResult']().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); - }); -} - -/** - * Deletes the specified virtual network tap. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the virtual network tap. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, tapName, 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-10-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 (tapName === null || tapName === undefined || typeof tapName.valueOf() !== 'string') { - throw new Error('tapName 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/virtualNetworkTaps/{tapName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{tapName}', encodeURIComponent(tapName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates a Virtual Network Tap. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the virtual network tap. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network tap operation. - * - * @param {object} [parameters.destinationNetworkInterfaceIPConfiguration] The - * reference to the private IP Address of the collector nic that will receive - * the tap - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.virtualNetworkTaps] - * The reference to Virtual Network Taps. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.applicationGatewayBackendAddressPools] - * The reference of ApplicationGatewayBackendAddressPool resource. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.loadBalancerBackendAddressPools] - * The reference of LoadBalancerBackendAddressPool resource. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.loadBalancerInboundNatRules] - * A list of references of LoadBalancerInboundNatRules. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAddress] - * Private IP address of the IP configuration. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAllocationMethod] - * Defines how a private IP address is assigned. Possible values are: 'Static' - * and 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAddressVersion] - * Available from Api-Version 2016-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * - * @param {object} - * [parameters.destinationNetworkInterfaceIPConfiguration.subnet] Subnet bound - * to the IP configuration. - * - * @param {boolean} - * [parameters.destinationNetworkInterfaceIPConfiguration.primary] Gets whether - * this is a primary customer address on the network interface. - * - * @param {object} - * [parameters.destinationNetworkInterfaceIPConfiguration.publicIPAddress] - * Public IP address bound to the IP configuration. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.applicationSecurityGroups] - * Application security groups in which the IP configuration is included. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.provisioningState] - * The provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.id] - * Resource ID. - * - * @param {object} [parameters.destinationLoadBalancerFrontEndIPConfiguration] - * The reference to the private IP address on the internal Load Balancer that - * will receive the tap - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.privateIPAllocationMethod] - * The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet] The - * reference of the subnet resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.tags] - * Resource tags. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * - * @param {boolean} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.tags] - * Resource tags. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.name] The - * name of the resource that is unique within a resource group. This name can - * be used to access the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.etag] A - * unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.id] - * Resource ID. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress] - * The reference of the Public IP resource. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku] - * The public IP address SKU. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku.name] - * Name of a public IP address SKU. Possible values include: 'Basic', - * 'Standard' - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is specified, - * an A DNS record is created for the public IP in the Microsoft Azure DNS - * system. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and the - * regionalized DNS zone. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipTags] - * The list of tags associated with the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipAddress] - * The IP address associated with the public IP address resource. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * - * @param {number} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.tags] - * Resource tags. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix] - * The reference of the Public IP Prefix resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.name] The name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.zones] A list of - * availability zones denoting the IP allocated for the resource needs to come - * from. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.id] Resource ID. - * - * @param {number} [parameters.destinationPort] The VXLAN destination port that - * will receive the tapped traffic. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 VirtualNetworkTap} 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 _beginCreateOrUpdate(resourceGroupName, tapName, parameters, 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-10-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 (tapName === null || tapName === undefined || typeof tapName.valueOf() !== 'string') { - throw new Error('tapName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/virtualNetworkTaps/{tapName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{tapName}', encodeURIComponent(tapName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['VirtualNetworkTap']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['VirtualNetworkTap']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualNetworkTap']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Updates an VirtualNetworkTap tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the tap. - * - * @param {object} tapParameters Parameters supplied to update - * VirtualNetworkTap tags. - * - * @param {object} [tapParameters.tags] Resource tags. - * - * @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 VirtualNetworkTap} 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 _beginUpdateTags(resourceGroupName, tapName, tapParameters, 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-10-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 (tapName === null || tapName === undefined || typeof tapName.valueOf() !== 'string') { - throw new Error('tapName cannot be null or undefined and it must be of type string.'); - } - if (tapParameters === null || tapParameters === undefined) { - throw new Error('tapParameters cannot be null or undefined.'); - } - 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/virtualNetworkTaps/{tapName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{tapName}', encodeURIComponent(tapName)); - 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 = 'PATCH'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (tapParameters !== null && tapParameters !== undefined) { - let requestModelMapper = new client.models['TagsObject']().mapper(); - requestModel = client.serialize(requestModelMapper, tapParameters, 'tapParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(tapParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // 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['VirtualNetworkTap']().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 the VirtualNetworkTaps in a subscription. - * - * @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 VirtualNetworkTapListResult} 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 _listAllNext(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['VirtualNetworkTapListResult']().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 the VirtualNetworkTaps in a subscription. - * - * @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 VirtualNetworkTapListResult} 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 _listByResourceGroupNext(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['VirtualNetworkTapListResult']().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 VirtualNetworkTaps. */ -class VirtualNetworkTaps { - /** - * Create a VirtualNetworkTaps. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._updateTags = _updateTags; - this._listAll = _listAll; - this._listByResourceGroup = _listByResourceGroup; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdateTags = _beginUpdateTags; - this._listAllNext = _listAllNext; - this._listByResourceGroupNext = _listByResourceGroupNext; - } - - /** - * Deletes the specified virtual network tap. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the virtual network tap. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, tapName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, tapName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified virtual network tap. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the virtual network tap. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, tapName, 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._deleteMethod(resourceGroupName, tapName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, tapName, options, optionalCallback); - } - } - - /** - * Gets information about the specified virtual network tap. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of virtual network tap. - * - * @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, tapName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, tapName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets information about the specified virtual network tap. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of virtual network tap. - * - * @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 {VirtualNetworkTap} - 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 VirtualNetworkTap} 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, tapName, 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, tapName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, tapName, options, optionalCallback); - } - } - - /** - * Creates or updates a Virtual Network Tap. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the virtual network tap. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network tap operation. - * - * @param {object} [parameters.destinationNetworkInterfaceIPConfiguration] The - * reference to the private IP Address of the collector nic that will receive - * the tap - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.virtualNetworkTaps] - * The reference to Virtual Network Taps. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.applicationGatewayBackendAddressPools] - * The reference of ApplicationGatewayBackendAddressPool resource. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.loadBalancerBackendAddressPools] - * The reference of LoadBalancerBackendAddressPool resource. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.loadBalancerInboundNatRules] - * A list of references of LoadBalancerInboundNatRules. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAddress] - * Private IP address of the IP configuration. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAllocationMethod] - * Defines how a private IP address is assigned. Possible values are: 'Static' - * and 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAddressVersion] - * Available from Api-Version 2016-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * - * @param {object} - * [parameters.destinationNetworkInterfaceIPConfiguration.subnet] Subnet bound - * to the IP configuration. - * - * @param {boolean} - * [parameters.destinationNetworkInterfaceIPConfiguration.primary] Gets whether - * this is a primary customer address on the network interface. - * - * @param {object} - * [parameters.destinationNetworkInterfaceIPConfiguration.publicIPAddress] - * Public IP address bound to the IP configuration. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.applicationSecurityGroups] - * Application security groups in which the IP configuration is included. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.provisioningState] - * The provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.id] - * Resource ID. - * - * @param {object} [parameters.destinationLoadBalancerFrontEndIPConfiguration] - * The reference to the private IP address on the internal Load Balancer that - * will receive the tap - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.privateIPAllocationMethod] - * The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet] The - * reference of the subnet resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.tags] - * Resource tags. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * - * @param {boolean} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.tags] - * Resource tags. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.name] The - * name of the resource that is unique within a resource group. This name can - * be used to access the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.etag] A - * unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.id] - * Resource ID. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress] - * The reference of the Public IP resource. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku] - * The public IP address SKU. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku.name] - * Name of a public IP address SKU. Possible values include: 'Basic', - * 'Standard' - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is specified, - * an A DNS record is created for the public IP in the Microsoft Azure DNS - * system. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and the - * regionalized DNS zone. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipTags] - * The list of tags associated with the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipAddress] - * The IP address associated with the public IP address resource. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * - * @param {number} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.tags] - * Resource tags. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix] - * The reference of the Public IP Prefix resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.name] The name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.zones] A list of - * availability zones denoting the IP allocated for the resource needs to come - * from. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.id] Resource ID. - * - * @param {number} [parameters.destinationPort] The VXLAN destination port that - * will receive the tapped traffic. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, tapName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, tapName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a Virtual Network Tap. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the virtual network tap. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network tap operation. - * - * @param {object} [parameters.destinationNetworkInterfaceIPConfiguration] The - * reference to the private IP Address of the collector nic that will receive - * the tap - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.virtualNetworkTaps] - * The reference to Virtual Network Taps. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.applicationGatewayBackendAddressPools] - * The reference of ApplicationGatewayBackendAddressPool resource. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.loadBalancerBackendAddressPools] - * The reference of LoadBalancerBackendAddressPool resource. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.loadBalancerInboundNatRules] - * A list of references of LoadBalancerInboundNatRules. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAddress] - * Private IP address of the IP configuration. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAllocationMethod] - * Defines how a private IP address is assigned. Possible values are: 'Static' - * and 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAddressVersion] - * Available from Api-Version 2016-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * - * @param {object} - * [parameters.destinationNetworkInterfaceIPConfiguration.subnet] Subnet bound - * to the IP configuration. - * - * @param {boolean} - * [parameters.destinationNetworkInterfaceIPConfiguration.primary] Gets whether - * this is a primary customer address on the network interface. - * - * @param {object} - * [parameters.destinationNetworkInterfaceIPConfiguration.publicIPAddress] - * Public IP address bound to the IP configuration. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.applicationSecurityGroups] - * Application security groups in which the IP configuration is included. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.provisioningState] - * The provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.id] - * Resource ID. - * - * @param {object} [parameters.destinationLoadBalancerFrontEndIPConfiguration] - * The reference to the private IP address on the internal Load Balancer that - * will receive the tap - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.privateIPAllocationMethod] - * The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet] The - * reference of the subnet resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.tags] - * Resource tags. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * - * @param {boolean} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.tags] - * Resource tags. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.name] The - * name of the resource that is unique within a resource group. This name can - * be used to access the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.etag] A - * unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.id] - * Resource ID. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress] - * The reference of the Public IP resource. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku] - * The public IP address SKU. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku.name] - * Name of a public IP address SKU. Possible values include: 'Basic', - * 'Standard' - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is specified, - * an A DNS record is created for the public IP in the Microsoft Azure DNS - * system. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and the - * regionalized DNS zone. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipTags] - * The list of tags associated with the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipAddress] - * The IP address associated with the public IP address resource. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * - * @param {number} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.tags] - * Resource tags. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix] - * The reference of the Public IP Prefix resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.name] The name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.zones] A list of - * availability zones denoting the IP allocated for the resource needs to come - * from. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.id] Resource ID. - * - * @param {number} [parameters.destinationPort] The VXLAN destination port that - * will receive the tapped traffic. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetworkTap} - 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 VirtualNetworkTap} 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. - */ - createOrUpdate(resourceGroupName, tapName, parameters, 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._createOrUpdate(resourceGroupName, tapName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, tapName, parameters, options, optionalCallback); - } - } - - /** - * Updates an VirtualNetworkTap tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the tap. - * - * @param {object} tapParameters Parameters supplied to update - * VirtualNetworkTap tags. - * - * @param {object} [tapParameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName, tapName, tapParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateTags(resourceGroupName, tapName, tapParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates an VirtualNetworkTap tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the tap. - * - * @param {object} tapParameters Parameters supplied to update - * VirtualNetworkTap tags. - * - * @param {object} [tapParameters.tags] Resource tags. - * - * @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 {VirtualNetworkTap} - 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 VirtualNetworkTap} 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. - */ - updateTags(resourceGroupName, tapName, tapParameters, 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._updateTags(resourceGroupName, tapName, tapParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateTags(resourceGroupName, tapName, tapParameters, options, optionalCallback); - } - } - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAll(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 the VirtualNetworkTaps in a subscription. - * - * @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 {VirtualNetworkTapListResult} - 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 VirtualNetworkTapListResult} 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. - */ - listAll(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._listAll(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAll(options, optionalCallback); - } - } - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, 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 the VirtualNetworkTaps in a subscription. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {VirtualNetworkTapListResult} - 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 VirtualNetworkTapListResult} 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. - */ - listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroup(resourceGroupName, options, optionalCallback); - } - } - - /** - * Deletes the specified virtual network tap. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the virtual network tap. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, tapName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, tapName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified virtual network tap. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the virtual network tap. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, tapName, 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._beginDeleteMethod(resourceGroupName, tapName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, tapName, options, optionalCallback); - } - } - - /** - * Creates or updates a Virtual Network Tap. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the virtual network tap. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network tap operation. - * - * @param {object} [parameters.destinationNetworkInterfaceIPConfiguration] The - * reference to the private IP Address of the collector nic that will receive - * the tap - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.virtualNetworkTaps] - * The reference to Virtual Network Taps. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.applicationGatewayBackendAddressPools] - * The reference of ApplicationGatewayBackendAddressPool resource. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.loadBalancerBackendAddressPools] - * The reference of LoadBalancerBackendAddressPool resource. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.loadBalancerInboundNatRules] - * A list of references of LoadBalancerInboundNatRules. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAddress] - * Private IP address of the IP configuration. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAllocationMethod] - * Defines how a private IP address is assigned. Possible values are: 'Static' - * and 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAddressVersion] - * Available from Api-Version 2016-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * - * @param {object} - * [parameters.destinationNetworkInterfaceIPConfiguration.subnet] Subnet bound - * to the IP configuration. - * - * @param {boolean} - * [parameters.destinationNetworkInterfaceIPConfiguration.primary] Gets whether - * this is a primary customer address on the network interface. - * - * @param {object} - * [parameters.destinationNetworkInterfaceIPConfiguration.publicIPAddress] - * Public IP address bound to the IP configuration. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.applicationSecurityGroups] - * Application security groups in which the IP configuration is included. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.provisioningState] - * The provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.id] - * Resource ID. - * - * @param {object} [parameters.destinationLoadBalancerFrontEndIPConfiguration] - * The reference to the private IP address on the internal Load Balancer that - * will receive the tap - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.privateIPAllocationMethod] - * The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet] The - * reference of the subnet resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.tags] - * Resource tags. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * - * @param {boolean} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.tags] - * Resource tags. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.name] The - * name of the resource that is unique within a resource group. This name can - * be used to access the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.etag] A - * unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.id] - * Resource ID. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress] - * The reference of the Public IP resource. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku] - * The public IP address SKU. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku.name] - * Name of a public IP address SKU. Possible values include: 'Basic', - * 'Standard' - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is specified, - * an A DNS record is created for the public IP in the Microsoft Azure DNS - * system. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and the - * regionalized DNS zone. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipTags] - * The list of tags associated with the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipAddress] - * The IP address associated with the public IP address resource. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * - * @param {number} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.tags] - * Resource tags. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix] - * The reference of the Public IP Prefix resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.name] The name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.zones] A list of - * availability zones denoting the IP allocated for the resource needs to come - * from. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.id] Resource ID. - * - * @param {number} [parameters.destinationPort] The VXLAN destination port that - * will receive the tapped traffic. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, tapName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, tapName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a Virtual Network Tap. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the virtual network tap. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network tap operation. - * - * @param {object} [parameters.destinationNetworkInterfaceIPConfiguration] The - * reference to the private IP Address of the collector nic that will receive - * the tap - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.virtualNetworkTaps] - * The reference to Virtual Network Taps. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.applicationGatewayBackendAddressPools] - * The reference of ApplicationGatewayBackendAddressPool resource. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.loadBalancerBackendAddressPools] - * The reference of LoadBalancerBackendAddressPool resource. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.loadBalancerInboundNatRules] - * A list of references of LoadBalancerInboundNatRules. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAddress] - * Private IP address of the IP configuration. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAllocationMethod] - * Defines how a private IP address is assigned. Possible values are: 'Static' - * and 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.privateIPAddressVersion] - * Available from Api-Version 2016-03-30 onwards, it represents whether the - * specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. - * Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', - * 'IPv6' - * - * @param {object} - * [parameters.destinationNetworkInterfaceIPConfiguration.subnet] Subnet bound - * to the IP configuration. - * - * @param {boolean} - * [parameters.destinationNetworkInterfaceIPConfiguration.primary] Gets whether - * this is a primary customer address on the network interface. - * - * @param {object} - * [parameters.destinationNetworkInterfaceIPConfiguration.publicIPAddress] - * Public IP address bound to the IP configuration. - * - * @param {array} - * [parameters.destinationNetworkInterfaceIPConfiguration.applicationSecurityGroups] - * Application security groups in which the IP configuration is included. - * - * @param {string} - * [parameters.destinationNetworkInterfaceIPConfiguration.provisioningState] - * The provisioning state of the network interface IP configuration. Possible - * values are: 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.name] - * The name of the resource that is unique within a resource group. This name - * can be used to access the resource. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} [parameters.destinationNetworkInterfaceIPConfiguration.id] - * Resource ID. - * - * @param {object} [parameters.destinationLoadBalancerFrontEndIPConfiguration] - * The reference to the private IP address on the internal Load Balancer that - * will receive the tap - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.privateIPAddress] - * The private IP address of the IP configuration. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.privateIPAllocationMethod] - * The Private IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet] The - * reference of the subnet resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefix] - * The address prefix for the subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.addressPrefixes] - * List of address prefixes for the subnet. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup] - * The reference of the NetworkSecurityGroup resource. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.securityRules] - * A collection of security rules of the network security group. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.defaultSecurityRules] - * The default security rules of network security group. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.resourceGuid] - * The resource GUID property of the network security group resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.provisioningState] - * The provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.networkSecurityGroup.tags] - * Resource tags. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable] - * The reference of the RouteTable resource. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.routes] - * Collection of routes contained within a route table. - * - * @param {boolean} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.disableBgpRoutePropagation] - * Gets or sets whether to disable the routes learned by BGP on that route - * table. True means disable. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.provisioningState] - * The provisioning state of the resource. Possible values are: 'Updating', - * 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.etag] - * Gets a unique read-only string that changes whenever the resource is - * updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.routeTable.tags] - * Resource tags. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpoints] - * An array of service endpoints. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceEndpointPolicies] - * An array of service endpoint policies. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.resourceNavigationLinks] - * Gets an array of references to the external resources using subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.serviceAssociationLinks] - * Gets an array of references to services injecting into this subnet. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.delegations] - * Gets an array of references to the delegations on the subnet. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.provisioningState] - * The provisioning state of the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.name] The - * name of the resource that is unique within a resource group. This name can - * be used to access the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.etag] A - * unique read-only string that changes whenever the resource is updated. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.subnet.id] - * Resource ID. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress] - * The reference of the Public IP resource. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku] - * The public IP address SKU. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.sku.name] - * Name of a public IP address SKU. Possible values include: 'Basic', - * 'Standard' - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAllocationMethod] - * The public IP allocation method. Possible values are: 'Static' and - * 'Dynamic'. Possible values include: 'Static', 'Dynamic' - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPAddressVersion] - * The public IP address version. Possible values are: 'IPv4' and 'IPv6'. - * Possible values include: 'IPv4', 'IPv6' - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings] - * The FQDN of the DNS record associated with the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.domainNameLabel] - * Gets or sets the Domain name label.The concatenation of the domain name - * label and the regionalized DNS zone make up the fully qualified domain name - * associated with the public IP address. If a domain name label is specified, - * an A DNS record is created for the public IP in the Microsoft Azure DNS - * system. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.fqdn] - * Gets the FQDN, Fully qualified domain name of the A DNS record associated - * with the public IP. This is the concatenation of the domainNameLabel and the - * regionalized DNS zone. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.dnsSettings.reverseFqdn] - * Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name - * that resolves to this public IP address. If the reverseFqdn is specified, - * then a PTR DNS record is created pointing from the IP address in the - * in-addr.arpa domain to the reverse FQDN. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipTags] - * The list of tags associated with the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.ipAddress] - * The IP address associated with the public IP address resource. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.publicIPPrefix] - * The Public IP Prefix this Public IP Address should be allocated from. - * - * @param {number} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.idleTimeoutInMinutes] - * The idle timeout of the public IP address. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.resourceGuid] - * The resource GUID property of the public IP resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.provisioningState] - * The provisioning state of the PublicIP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.etag] - * A unique read-only string that changes whenever the resource is updated. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.zones] - * A list of availability zones denoting the IP allocated for the resource - * needs to come from. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.location] - * Resource location. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPAddress.tags] - * Resource tags. - * - * @param {object} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix] - * The reference of the Public IP Prefix resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.publicIPPrefix.id] - * Resource ID. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.provisioningState] - * Gets the provisioning state of the public IP resource. Possible values are: - * 'Updating', 'Deleting', and 'Failed'. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.name] The name of - * the resource that is unique within a resource group. This name can be used - * to access the resource. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.etag] A unique - * read-only string that changes whenever the resource is updated. - * - * @param {array} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.zones] A list of - * availability zones denoting the IP allocated for the resource needs to come - * from. - * - * @param {string} - * [parameters.destinationLoadBalancerFrontEndIPConfiguration.id] Resource ID. - * - * @param {number} [parameters.destinationPort] The VXLAN destination port that - * will receive the tapped traffic. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetworkTap} - 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 VirtualNetworkTap} 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. - */ - beginCreateOrUpdate(resourceGroupName, tapName, parameters, 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._beginCreateOrUpdate(resourceGroupName, tapName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, tapName, parameters, options, optionalCallback); - } - } - - /** - * Updates an VirtualNetworkTap tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the tap. - * - * @param {object} tapParameters Parameters supplied to update - * VirtualNetworkTap tags. - * - * @param {object} [tapParameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName, tapName, tapParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginUpdateTags(resourceGroupName, tapName, tapParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates an VirtualNetworkTap tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} tapName The name of the tap. - * - * @param {object} tapParameters Parameters supplied to update - * VirtualNetworkTap tags. - * - * @param {object} [tapParameters.tags] Resource tags. - * - * @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 {VirtualNetworkTap} - 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 VirtualNetworkTap} 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. - */ - beginUpdateTags(resourceGroupName, tapName, tapParameters, 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._beginUpdateTags(resourceGroupName, tapName, tapParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginUpdateTags(resourceGroupName, tapName, tapParameters, options, optionalCallback); - } - } - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAllNext(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 the VirtualNetworkTaps in a subscription. - * - * @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 {VirtualNetworkTapListResult} - 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 VirtualNetworkTapListResult} 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. - */ - listAllNext(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._listAllNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAllNext(nextPageLink, options, optionalCallback); - } - } - - /** - * Gets all the VirtualNetworkTaps in a subscription. - * - * @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. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroupNext(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 the VirtualNetworkTaps in a subscription. - * - * @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 {VirtualNetworkTapListResult} - 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 VirtualNetworkTapListResult} 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. - */ - listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = VirtualNetworkTaps; diff --git a/lib/services/networkManagement2/lib/operations/virtualNetworks.js b/lib/services/networkManagement2/lib/operations/virtualNetworks.js deleted file mode 100644 index 1920e40b2..000000000 --- a/lib/services/networkManagement2/lib/operations/virtualNetworks.js +++ /dev/null @@ -1,3341 +0,0 @@ -/* - * 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; - - -/** - * Deletes the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, virtualNetworkName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, virtualNetworkName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets the specified virtual network by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 VirtualNetwork} 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, virtualNetworkName, 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 expand = (options && options.expand !== undefined) ? options.expand : undefined; - let apiVersion = '2018-10-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 (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { - throw new Error('virtualNetworkName 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 (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand 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/virtualNetworks/{virtualNetworkName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } - 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['VirtualNetwork']().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); - }); -} - - -/** - * Creates or updates a virtual network in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network operation - * - * @param {object} [parameters.addressSpace] The AddressSpace that contains an - * array of IP address ranges that can be used by subnets. - * - * @param {array} [parameters.addressSpace.addressPrefixes] A list of address - * blocks reserved for this virtual network in CIDR notation. - * - * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an - * array of DNS servers available to VMs deployed in the virtual network. - * - * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers - * IP addresses. - * - * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. - * - * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a - * Virtual Network. - * - * @param {string} [parameters.resourceGuid] The resourceGuid property of the - * Virtual Network resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS - * protection is enabled for all the protected resources in the virtual - * network. It requires a DDoS protection plan associated with the resource. - * - * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection - * is enabled for all the subnets in the virtual network. - * - * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan - * associated with the virtual network. - * - * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 VirtualNetwork} 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 _createOrUpdate(resourceGroupName, virtualNetworkName, parameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, virtualNetworkName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualNetwork']().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); - }); - }); -} - - -/** - * Updates a virtual network tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} parameters Parameters supplied to update virtual network - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 VirtualNetwork} 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 _updateTags(resourceGroupName, virtualNetworkName, parameters, 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.'); - } - - // Send request - this.beginUpdateTags(resourceGroupName, virtualNetworkName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualNetwork']().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 virtual networks in a subscription. - * - * @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 VirtualNetworkListResult} 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 _listAll(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/virtualNetworks'; - 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['VirtualNetworkListResult']().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 virtual networks in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 VirtualNetworkListResult} 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, 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-10-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 (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/virtualNetworks'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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['VirtualNetworkListResult']().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); - }); -} - -/** - * Checks whether a private IP address is available for use. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} ipAddress The private IP address to be verified. - * - * @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 IPAddressAvailabilityResult} 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 _checkIPAddressAvailability(resourceGroupName, virtualNetworkName, ipAddress, 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-10-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 (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { - throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); - } - if (ipAddress === null || ipAddress === undefined || typeof ipAddress.valueOf() !== 'string') { - throw new Error('ipAddress 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/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - queryParameters.push('ipAddress=' + encodeURIComponent(ipAddress)); - 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['IPAddressAvailabilityResult']().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); - }); -} - -/** - * Lists usage stats. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @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 VirtualNetworkListUsageResult} 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 _listUsage(resourceGroupName, virtualNetworkName, 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-10-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 (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { - throw new Error('virtualNetworkName 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/virtualNetworks/{virtualNetworkName}/usages'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); - 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['VirtualNetworkListUsageResult']().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); - }); -} - -/** - * Deletes the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, virtualNetworkName, 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-10-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 (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { - throw new Error('virtualNetworkName 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/virtualNetworks/{virtualNetworkName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Creates or updates a virtual network in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network operation - * - * @param {object} [parameters.addressSpace] The AddressSpace that contains an - * array of IP address ranges that can be used by subnets. - * - * @param {array} [parameters.addressSpace.addressPrefixes] A list of address - * blocks reserved for this virtual network in CIDR notation. - * - * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an - * array of DNS servers available to VMs deployed in the virtual network. - * - * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers - * IP addresses. - * - * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. - * - * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a - * Virtual Network. - * - * @param {string} [parameters.resourceGuid] The resourceGuid property of the - * Virtual Network resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS - * protection is enabled for all the protected resources in the virtual - * network. It requires a DDoS protection plan associated with the resource. - * - * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection - * is enabled for all the subnets in the virtual network. - * - * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan - * associated with the virtual network. - * - * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 VirtualNetwork} 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 _beginCreateOrUpdate(resourceGroupName, virtualNetworkName, parameters, 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-10-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 (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { - throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/virtualNetworks/{virtualNetworkName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['VirtualNetwork']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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['VirtualNetwork']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualNetwork']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Updates a virtual network tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} parameters Parameters supplied to update virtual network - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 VirtualNetwork} 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 _beginUpdateTags(resourceGroupName, virtualNetworkName, parameters, 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-10-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 (virtualNetworkName === null || virtualNetworkName === undefined || typeof virtualNetworkName.valueOf() !== 'string') { - throw new Error('virtualNetworkName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } - 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/virtualNetworks/{virtualNetworkName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualNetworkName}', encodeURIComponent(virtualNetworkName)); - 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 = 'PATCH'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['TagsObject']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // 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['VirtualNetwork']().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 virtual networks in a subscription. - * - * @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 VirtualNetworkListResult} 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 _listAllNext(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['VirtualNetworkListResult']().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 virtual networks in a resource group. - * - * @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 VirtualNetworkListResult} 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['VirtualNetworkListResult']().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); - }); -} - -/** - * Lists usage stats. - * - * @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 VirtualNetworkListUsageResult} 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 _listUsageNext(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['VirtualNetworkListUsageResult']().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 VirtualNetworks. */ -class VirtualNetworks { - /** - * Create a VirtualNetworks. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._updateTags = _updateTags; - this._listAll = _listAll; - this._list = _list; - this._checkIPAddressAvailability = _checkIPAddressAvailability; - this._listUsage = _listUsage; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdateTags = _beginUpdateTags; - this._listAllNext = _listAllNext; - this._listNext = _listNext; - this._listUsageNext = _listUsageNext; - } - - /** - * Deletes the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, virtualNetworkName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, virtualNetworkName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, virtualNetworkName, 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._deleteMethod(resourceGroupName, virtualNetworkName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, virtualNetworkName, options, optionalCallback); - } - } - - /** - * Gets the specified virtual network by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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, virtualNetworkName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, virtualNetworkName, 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 virtual network by resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Expands referenced resources. - * - * @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 {VirtualNetwork} - 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 VirtualNetwork} 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, virtualNetworkName, 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, virtualNetworkName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, virtualNetworkName, options, optionalCallback); - } - } - - /** - * Creates or updates a virtual network in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network operation - * - * @param {object} [parameters.addressSpace] The AddressSpace that contains an - * array of IP address ranges that can be used by subnets. - * - * @param {array} [parameters.addressSpace.addressPrefixes] A list of address - * blocks reserved for this virtual network in CIDR notation. - * - * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an - * array of DNS servers available to VMs deployed in the virtual network. - * - * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers - * IP addresses. - * - * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. - * - * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a - * Virtual Network. - * - * @param {string} [parameters.resourceGuid] The resourceGuid property of the - * Virtual Network resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS - * protection is enabled for all the protected resources in the virtual - * network. It requires a DDoS protection plan associated with the resource. - * - * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection - * is enabled for all the subnets in the virtual network. - * - * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan - * associated with the virtual network. - * - * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, virtualNetworkName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, virtualNetworkName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a virtual network in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network operation - * - * @param {object} [parameters.addressSpace] The AddressSpace that contains an - * array of IP address ranges that can be used by subnets. - * - * @param {array} [parameters.addressSpace.addressPrefixes] A list of address - * blocks reserved for this virtual network in CIDR notation. - * - * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an - * array of DNS servers available to VMs deployed in the virtual network. - * - * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers - * IP addresses. - * - * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. - * - * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a - * Virtual Network. - * - * @param {string} [parameters.resourceGuid] The resourceGuid property of the - * Virtual Network resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS - * protection is enabled for all the protected resources in the virtual - * network. It requires a DDoS protection plan associated with the resource. - * - * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection - * is enabled for all the subnets in the virtual network. - * - * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan - * associated with the virtual network. - * - * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetwork} - 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 VirtualNetwork} 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. - */ - createOrUpdate(resourceGroupName, virtualNetworkName, parameters, 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._createOrUpdate(resourceGroupName, virtualNetworkName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, virtualNetworkName, parameters, options, optionalCallback); - } - } - - /** - * Updates a virtual network tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} parameters Parameters supplied to update virtual network - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName, virtualNetworkName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateTags(resourceGroupName, virtualNetworkName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates a virtual network tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} parameters Parameters supplied to update virtual network - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetwork} - 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 VirtualNetwork} 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. - */ - updateTags(resourceGroupName, virtualNetworkName, parameters, 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._updateTags(resourceGroupName, virtualNetworkName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateTags(resourceGroupName, virtualNetworkName, parameters, options, optionalCallback); - } - } - - /** - * Gets all virtual networks in a subscription. - * - * @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. - */ - listAllWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAll(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 virtual networks in a subscription. - * - * @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 {VirtualNetworkListResult} - 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 VirtualNetworkListResult} 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. - */ - listAll(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._listAll(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAll(options, optionalCallback); - } - } - - /** - * Gets all virtual networks in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(resourceGroupName, 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 virtual networks in a resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @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 {VirtualNetworkListResult} - 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 VirtualNetworkListResult} 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, 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, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(resourceGroupName, options, optionalCallback); - } - } - - /** - * Checks whether a private IP address is available for use. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} ipAddress The private IP address to be verified. - * - * @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. - */ - checkIPAddressAvailabilityWithHttpOperationResponse(resourceGroupName, virtualNetworkName, ipAddress, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._checkIPAddressAvailability(resourceGroupName, virtualNetworkName, ipAddress, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Checks whether a private IP address is available for use. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {string} ipAddress The private IP address to be verified. - * - * @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 {IPAddressAvailabilityResult} - 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 IPAddressAvailabilityResult} 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. - */ - checkIPAddressAvailability(resourceGroupName, virtualNetworkName, ipAddress, 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._checkIPAddressAvailability(resourceGroupName, virtualNetworkName, ipAddress, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._checkIPAddressAvailability(resourceGroupName, virtualNetworkName, ipAddress, options, optionalCallback); - } - } - - /** - * Lists usage stats. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @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. - */ - listUsageWithHttpOperationResponse(resourceGroupName, virtualNetworkName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listUsage(resourceGroupName, virtualNetworkName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists usage stats. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @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 {VirtualNetworkListUsageResult} - 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 VirtualNetworkListUsageResult} 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. - */ - listUsage(resourceGroupName, virtualNetworkName, 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._listUsage(resourceGroupName, virtualNetworkName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listUsage(resourceGroupName, virtualNetworkName, options, optionalCallback); - } - } - - /** - * Deletes the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, virtualNetworkName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, virtualNetworkName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the specified virtual network. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, virtualNetworkName, 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._beginDeleteMethod(resourceGroupName, virtualNetworkName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, virtualNetworkName, options, optionalCallback); - } - } - - /** - * Creates or updates a virtual network in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network operation - * - * @param {object} [parameters.addressSpace] The AddressSpace that contains an - * array of IP address ranges that can be used by subnets. - * - * @param {array} [parameters.addressSpace.addressPrefixes] A list of address - * blocks reserved for this virtual network in CIDR notation. - * - * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an - * array of DNS servers available to VMs deployed in the virtual network. - * - * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers - * IP addresses. - * - * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. - * - * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a - * Virtual Network. - * - * @param {string} [parameters.resourceGuid] The resourceGuid property of the - * Virtual Network resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS - * protection is enabled for all the protected resources in the virtual - * network. It requires a DDoS protection plan associated with the resource. - * - * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection - * is enabled for all the subnets in the virtual network. - * - * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan - * associated with the virtual network. - * - * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, virtualNetworkName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, virtualNetworkName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates a virtual network in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} parameters Parameters supplied to the create or update - * virtual network operation - * - * @param {object} [parameters.addressSpace] The AddressSpace that contains an - * array of IP address ranges that can be used by subnets. - * - * @param {array} [parameters.addressSpace.addressPrefixes] A list of address - * blocks reserved for this virtual network in CIDR notation. - * - * @param {object} [parameters.dhcpOptions] The dhcpOptions that contains an - * array of DNS servers available to VMs deployed in the virtual network. - * - * @param {array} [parameters.dhcpOptions.dnsServers] The list of DNS servers - * IP addresses. - * - * @param {array} [parameters.subnets] A list of subnets in a Virtual Network. - * - * @param {array} [parameters.virtualNetworkPeerings] A list of peerings in a - * Virtual Network. - * - * @param {string} [parameters.resourceGuid] The resourceGuid property of the - * Virtual Network resource. - * - * @param {string} [parameters.provisioningState] The provisioning state of the - * PublicIP resource. Possible values are: 'Updating', 'Deleting', and - * 'Failed'. - * - * @param {boolean} [parameters.enableDdosProtection] Indicates if DDoS - * protection is enabled for all the protected resources in the virtual - * network. It requires a DDoS protection plan associated with the resource. - * - * @param {boolean} [parameters.enableVmProtection] Indicates if VM protection - * is enabled for all the subnets in the virtual network. - * - * @param {object} [parameters.ddosProtectionPlan] The DDoS protection plan - * associated with the virtual network. - * - * @param {string} [parameters.ddosProtectionPlan.id] Resource ID. - * - * @param {string} [parameters.etag] Gets a unique read-only string that - * changes whenever the resource is updated. - * - * @param {string} [parameters.id] Resource ID. - * - * @param {string} [parameters.location] Resource location. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetwork} - 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 VirtualNetwork} 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. - */ - beginCreateOrUpdate(resourceGroupName, virtualNetworkName, parameters, 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._beginCreateOrUpdate(resourceGroupName, virtualNetworkName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, virtualNetworkName, parameters, options, optionalCallback); - } - } - - /** - * Updates a virtual network tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} parameters Parameters supplied to update virtual network - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName, virtualNetworkName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginUpdateTags(resourceGroupName, virtualNetworkName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates a virtual network tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} virtualNetworkName The name of the virtual network. - * - * @param {object} parameters Parameters supplied to update virtual network - * tags. - * - * @param {object} [parameters.tags] Resource tags. - * - * @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 {VirtualNetwork} - 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 VirtualNetwork} 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. - */ - beginUpdateTags(resourceGroupName, virtualNetworkName, parameters, 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._beginUpdateTags(resourceGroupName, virtualNetworkName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginUpdateTags(resourceGroupName, virtualNetworkName, parameters, options, optionalCallback); - } - } - - /** - * Gets all virtual networks in a subscription. - * - * @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. - */ - listAllNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listAllNext(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 virtual networks in a subscription. - * - * @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 {VirtualNetworkListResult} - 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 VirtualNetworkListResult} 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. - */ - listAllNext(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._listAllNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listAllNext(nextPageLink, options, optionalCallback); - } - } - - /** - * Gets all virtual networks in a resource group. - * - * @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 virtual networks in a resource group. - * - * @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 {VirtualNetworkListResult} - 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 VirtualNetworkListResult} 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); - } - } - - /** - * Lists usage stats. - * - * @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. - */ - listUsageNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listUsageNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists usage stats. - * - * @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 {VirtualNetworkListUsageResult} - 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 VirtualNetworkListUsageResult} 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. - */ - listUsageNext(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._listUsageNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listUsageNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = VirtualNetworks; diff --git a/lib/services/networkManagement2/lib/operations/virtualWANs.js b/lib/services/networkManagement2/lib/operations/virtualWANs.js deleted file mode 100644 index f0a7956ea..000000000 --- a/lib/services/networkManagement2/lib/operations/virtualWANs.js +++ /dev/null @@ -1,2567 +0,0 @@ -/* - * 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; - -/** - * Retrieves the details of a VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being retrieved. - * - * @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 VirtualWAN} 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, virtualWANName, 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-08-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 (virtualWANName === null || virtualWANName === undefined || typeof virtualWANName.valueOf() !== 'string') { - throw new Error('virtualWANName 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/virtualWans/{VirtualWANName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{VirtualWANName}', encodeURIComponent(virtualWANName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['VirtualWAN']().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); - }); -} - - -/** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing - * VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being created or - * updated. - * - * @param {object} wANParameters Parameters supplied to create or update - * VirtualWAN. - * - * @param {boolean} [wANParameters.disableVpnEncryption] Vpn encryption to be - * disabled or not. - * - * @param {string} [wANParameters.securityProviderName] The Security Provider - * name. - * - * @param {boolean} [wANParameters.allowBranchToBranchTraffic] True if branch - * to branch traffic is allowed. - * - * @param {boolean} [wANParameters.allowVnetToVnetTraffic] True if Vnet to Vnet - * traffic is allowed. - * - * @param {string} [wANParameters.office365LocalBreakoutCategory] The office - * local breakout category. Possible values include: 'Optimize', - * 'OptimizeAndAllow', 'All', 'None' - * - * @param {array} [wANParameters.p2SVpnServerConfigurations] list of all - * P2SVpnServerConfigurations associated with the virtual wan. - * - * @param {string} [wANParameters.provisioningState] The provisioning state of - * the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * - * @param {string} [wANParameters.id] Resource ID. - * - * @param {string} [wANParameters.location] Resource location. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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 VirtualWAN} 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 _createOrUpdate(resourceGroupName, virtualWANName, wANParameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, virtualWANName, wANParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualWAN']().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); - }); - }); -} - - -/** - * Updates a VirtualWAN tags. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being updated. - * - * @param {object} wANParameters Parameters supplied to Update VirtualWAN tags. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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 VirtualWAN} 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 _updateTags(resourceGroupName, virtualWANName, wANParameters, 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.'); - } - - // Send request - this.beginUpdateTags(resourceGroupName, virtualWANName, wANParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualWAN']().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); - }); - }); -} - - -/** - * Deletes a VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being deleted. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, virtualWANName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, virtualWANName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Lists all the VirtualWANs in a resource group. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @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 ListVirtualWANsResult} 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 _listByResourceGroup(resourceGroupName, 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-08-01'; - // Validate - try { - 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 (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 (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/virtualWans'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListVirtualWANsResult']().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); - }); -} - -/** - * Lists all the VirtualWANs in a subscription. - * - * @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 ListVirtualWANsResult} 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(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-08-01'; - // Validate - try { - 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}/providers/Microsoft.Network/virtualWans'; - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListVirtualWANsResult']().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); - }); -} - -/** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing - * VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being created or - * updated. - * - * @param {object} wANParameters Parameters supplied to create or update - * VirtualWAN. - * - * @param {boolean} [wANParameters.disableVpnEncryption] Vpn encryption to be - * disabled or not. - * - * @param {string} [wANParameters.securityProviderName] The Security Provider - * name. - * - * @param {boolean} [wANParameters.allowBranchToBranchTraffic] True if branch - * to branch traffic is allowed. - * - * @param {boolean} [wANParameters.allowVnetToVnetTraffic] True if Vnet to Vnet - * traffic is allowed. - * - * @param {string} [wANParameters.office365LocalBreakoutCategory] The office - * local breakout category. Possible values include: 'Optimize', - * 'OptimizeAndAllow', 'All', 'None' - * - * @param {array} [wANParameters.p2SVpnServerConfigurations] list of all - * P2SVpnServerConfigurations associated with the virtual wan. - * - * @param {string} [wANParameters.provisioningState] The provisioning state of - * the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * - * @param {string} [wANParameters.id] Resource ID. - * - * @param {string} [wANParameters.location] Resource location. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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 VirtualWAN} 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 _beginCreateOrUpdate(resourceGroupName, virtualWANName, wANParameters, 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-08-01'; - // Validate - try { - 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 (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 (virtualWANName === null || virtualWANName === undefined || typeof virtualWANName.valueOf() !== 'string') { - throw new Error('virtualWANName cannot be null or undefined and it must be of type string.'); - } - if (wANParameters === null || wANParameters === undefined) { - throw new Error('wANParameters cannot be null or undefined.'); - } - 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/virtualWans/{VirtualWANName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{VirtualWANName}', encodeURIComponent(virtualWANName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (wANParameters !== null && wANParameters !== undefined) { - let requestModelMapper = new client.models['VirtualWAN']().mapper(); - requestModel = client.serialize(requestModelMapper, wANParameters, 'wANParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(wANParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['VirtualWAN']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualWAN']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Updates a VirtualWAN tags. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being updated. - * - * @param {object} wANParameters Parameters supplied to Update VirtualWAN tags. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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 VirtualWAN} 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 _beginUpdateTags(resourceGroupName, virtualWANName, wANParameters, 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-08-01'; - // Validate - try { - 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 (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 (virtualWANName === null || virtualWANName === undefined || typeof virtualWANName.valueOf() !== 'string') { - throw new Error('virtualWANName cannot be null or undefined and it must be of type string.'); - } - if (wANParameters === null || wANParameters === undefined) { - throw new Error('wANParameters cannot be null or undefined.'); - } - 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/virtualWans/{VirtualWANName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{VirtualWANName}', encodeURIComponent(virtualWANName)); - 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 = 'PATCH'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (wANParameters !== null && wANParameters !== undefined) { - let requestModelMapper = new client.models['TagsObject']().mapper(); - requestModel = client.serialize(requestModelMapper, wANParameters, 'wANParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(wANParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['VirtualWAN']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualWAN']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Deletes a VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being deleted. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, virtualWANName, 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-08-01'; - // Validate - try { - 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 (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 (virtualWANName === null || virtualWANName === undefined || typeof virtualWANName.valueOf() !== 'string') { - throw new Error('virtualWANName 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/virtualWans/{VirtualWANName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{VirtualWANName}', encodeURIComponent(virtualWANName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Lists all the VirtualWANs in a resource group. - * - * @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 ListVirtualWANsResult} 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 _listByResourceGroupNext(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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListVirtualWANsResult']().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); - }); -} - -/** - * Lists all the VirtualWANs in a subscription. - * - * @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 ListVirtualWANsResult} 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListVirtualWANsResult']().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 VirtualWans. */ -class VirtualWans { - /** - * Create a VirtualWans. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._updateTags = _updateTags; - this._deleteMethod = _deleteMethod; - this._listByResourceGroup = _listByResourceGroup; - this._list = _list; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdateTags = _beginUpdateTags; - this._beginDeleteMethod = _beginDeleteMethod; - this._listByResourceGroupNext = _listByResourceGroupNext; - this._listNext = _listNext; - } - - /** - * Retrieves the details of a VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being retrieved. - * - * @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, virtualWANName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, virtualWANName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves the details of a VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being retrieved. - * - * @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 {VirtualWAN} - 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 VirtualWAN} 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, virtualWANName, 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, virtualWANName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, virtualWANName, options, optionalCallback); - } - } - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing - * VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being created or - * updated. - * - * @param {object} wANParameters Parameters supplied to create or update - * VirtualWAN. - * - * @param {boolean} [wANParameters.disableVpnEncryption] Vpn encryption to be - * disabled or not. - * - * @param {string} [wANParameters.securityProviderName] The Security Provider - * name. - * - * @param {boolean} [wANParameters.allowBranchToBranchTraffic] True if branch - * to branch traffic is allowed. - * - * @param {boolean} [wANParameters.allowVnetToVnetTraffic] True if Vnet to Vnet - * traffic is allowed. - * - * @param {string} [wANParameters.office365LocalBreakoutCategory] The office - * local breakout category. Possible values include: 'Optimize', - * 'OptimizeAndAllow', 'All', 'None' - * - * @param {array} [wANParameters.p2SVpnServerConfigurations] list of all - * P2SVpnServerConfigurations associated with the virtual wan. - * - * @param {string} [wANParameters.provisioningState] The provisioning state of - * the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * - * @param {string} [wANParameters.id] Resource ID. - * - * @param {string} [wANParameters.location] Resource location. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, virtualWANName, wANParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, virtualWANName, wANParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing - * VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being created or - * updated. - * - * @param {object} wANParameters Parameters supplied to create or update - * VirtualWAN. - * - * @param {boolean} [wANParameters.disableVpnEncryption] Vpn encryption to be - * disabled or not. - * - * @param {string} [wANParameters.securityProviderName] The Security Provider - * name. - * - * @param {boolean} [wANParameters.allowBranchToBranchTraffic] True if branch - * to branch traffic is allowed. - * - * @param {boolean} [wANParameters.allowVnetToVnetTraffic] True if Vnet to Vnet - * traffic is allowed. - * - * @param {string} [wANParameters.office365LocalBreakoutCategory] The office - * local breakout category. Possible values include: 'Optimize', - * 'OptimizeAndAllow', 'All', 'None' - * - * @param {array} [wANParameters.p2SVpnServerConfigurations] list of all - * P2SVpnServerConfigurations associated with the virtual wan. - * - * @param {string} [wANParameters.provisioningState] The provisioning state of - * the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * - * @param {string} [wANParameters.id] Resource ID. - * - * @param {string} [wANParameters.location] Resource location. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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 {VirtualWAN} - 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 VirtualWAN} 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. - */ - createOrUpdate(resourceGroupName, virtualWANName, wANParameters, 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._createOrUpdate(resourceGroupName, virtualWANName, wANParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, virtualWANName, wANParameters, options, optionalCallback); - } - } - - /** - * Updates a VirtualWAN tags. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being updated. - * - * @param {object} wANParameters Parameters supplied to Update VirtualWAN tags. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName, virtualWANName, wANParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateTags(resourceGroupName, virtualWANName, wANParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates a VirtualWAN tags. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being updated. - * - * @param {object} wANParameters Parameters supplied to Update VirtualWAN tags. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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 {VirtualWAN} - 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 VirtualWAN} 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. - */ - updateTags(resourceGroupName, virtualWANName, wANParameters, 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._updateTags(resourceGroupName, virtualWANName, wANParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateTags(resourceGroupName, virtualWANName, wANParameters, options, optionalCallback); - } - } - - /** - * Deletes a VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being deleted. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, virtualWANName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, virtualWANName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes a VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being deleted. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, virtualWANName, 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._deleteMethod(resourceGroupName, virtualWANName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, virtualWANName, options, optionalCallback); - } - } - - /** - * Lists all the VirtualWANs in a resource group. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all the VirtualWANs in a resource group. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @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 {ListVirtualWANsResult} - 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 ListVirtualWANsResult} 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. - */ - listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroup(resourceGroupName, options, optionalCallback); - } - } - - /** - * Lists all the VirtualWANs in a subscription. - * - * @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(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all the VirtualWANs in a subscription. - * - * @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 {ListVirtualWANsResult} - 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 ListVirtualWANsResult} 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(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(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(options, optionalCallback); - } - } - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing - * VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being created or - * updated. - * - * @param {object} wANParameters Parameters supplied to create or update - * VirtualWAN. - * - * @param {boolean} [wANParameters.disableVpnEncryption] Vpn encryption to be - * disabled or not. - * - * @param {string} [wANParameters.securityProviderName] The Security Provider - * name. - * - * @param {boolean} [wANParameters.allowBranchToBranchTraffic] True if branch - * to branch traffic is allowed. - * - * @param {boolean} [wANParameters.allowVnetToVnetTraffic] True if Vnet to Vnet - * traffic is allowed. - * - * @param {string} [wANParameters.office365LocalBreakoutCategory] The office - * local breakout category. Possible values include: 'Optimize', - * 'OptimizeAndAllow', 'All', 'None' - * - * @param {array} [wANParameters.p2SVpnServerConfigurations] list of all - * P2SVpnServerConfigurations associated with the virtual wan. - * - * @param {string} [wANParameters.provisioningState] The provisioning state of - * the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * - * @param {string} [wANParameters.id] Resource ID. - * - * @param {string} [wANParameters.location] Resource location. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, virtualWANName, wANParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, virtualWANName, wANParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing - * VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being created or - * updated. - * - * @param {object} wANParameters Parameters supplied to create or update - * VirtualWAN. - * - * @param {boolean} [wANParameters.disableVpnEncryption] Vpn encryption to be - * disabled or not. - * - * @param {string} [wANParameters.securityProviderName] The Security Provider - * name. - * - * @param {boolean} [wANParameters.allowBranchToBranchTraffic] True if branch - * to branch traffic is allowed. - * - * @param {boolean} [wANParameters.allowVnetToVnetTraffic] True if Vnet to Vnet - * traffic is allowed. - * - * @param {string} [wANParameters.office365LocalBreakoutCategory] The office - * local breakout category. Possible values include: 'Optimize', - * 'OptimizeAndAllow', 'All', 'None' - * - * @param {array} [wANParameters.p2SVpnServerConfigurations] list of all - * P2SVpnServerConfigurations associated with the virtual wan. - * - * @param {string} [wANParameters.provisioningState] The provisioning state of - * the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * - * @param {string} [wANParameters.id] Resource ID. - * - * @param {string} [wANParameters.location] Resource location. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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 {VirtualWAN} - 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 VirtualWAN} 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. - */ - beginCreateOrUpdate(resourceGroupName, virtualWANName, wANParameters, 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._beginCreateOrUpdate(resourceGroupName, virtualWANName, wANParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, virtualWANName, wANParameters, options, optionalCallback); - } - } - - /** - * Updates a VirtualWAN tags. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being updated. - * - * @param {object} wANParameters Parameters supplied to Update VirtualWAN tags. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName, virtualWANName, wANParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginUpdateTags(resourceGroupName, virtualWANName, wANParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates a VirtualWAN tags. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being updated. - * - * @param {object} wANParameters Parameters supplied to Update VirtualWAN tags. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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 {VirtualWAN} - 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 VirtualWAN} 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. - */ - beginUpdateTags(resourceGroupName, virtualWANName, wANParameters, 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._beginUpdateTags(resourceGroupName, virtualWANName, wANParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginUpdateTags(resourceGroupName, virtualWANName, wANParameters, options, optionalCallback); - } - } - - /** - * Deletes a VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being deleted. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, virtualWANName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, virtualWANName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes a VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being deleted. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, virtualWANName, 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._beginDeleteMethod(resourceGroupName, virtualWANName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, virtualWANName, options, optionalCallback); - } - } - - /** - * Lists all the VirtualWANs in a resource group. - * - * @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. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all the VirtualWANs in a resource group. - * - * @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 {ListVirtualWANsResult} - 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 ListVirtualWANsResult} 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. - */ - listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); - } - } - - /** - * Lists all the VirtualWANs in a subscription. - * - * @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; - }); - }); - } - - /** - * Lists all the VirtualWANs in a subscription. - * - * @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 {ListVirtualWANsResult} - 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 ListVirtualWANsResult} 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 = VirtualWans; diff --git a/lib/services/networkManagement2/lib/operations/virtualWans.js b/lib/services/networkManagement2/lib/operations/virtualWans.js deleted file mode 100644 index be3c50d7e..000000000 --- a/lib/services/networkManagement2/lib/operations/virtualWans.js +++ /dev/null @@ -1,2567 +0,0 @@ -/* - * 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; - -/** - * Retrieves the details of a VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being retrieved. - * - * @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 VirtualWAN} 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, virtualWANName, 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-10-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 (virtualWANName === null || virtualWANName === undefined || typeof virtualWANName.valueOf() !== 'string') { - throw new Error('virtualWANName 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/virtualWans/{VirtualWANName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{VirtualWANName}', encodeURIComponent(virtualWANName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['VirtualWAN']().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); - }); -} - - -/** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing - * VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being created or - * updated. - * - * @param {object} wANParameters Parameters supplied to create or update - * VirtualWAN. - * - * @param {boolean} [wANParameters.disableVpnEncryption] Vpn encryption to be - * disabled or not. - * - * @param {string} [wANParameters.securityProviderName] The Security Provider - * name. - * - * @param {boolean} [wANParameters.allowBranchToBranchTraffic] True if branch - * to branch traffic is allowed. - * - * @param {boolean} [wANParameters.allowVnetToVnetTraffic] True if Vnet to Vnet - * traffic is allowed. - * - * @param {string} [wANParameters.office365LocalBreakoutCategory] The office - * local breakout category. Possible values include: 'Optimize', - * 'OptimizeAndAllow', 'All', 'None' - * - * @param {array} [wANParameters.p2SVpnServerConfigurations] list of all - * P2SVpnServerConfigurations associated with the virtual wan. - * - * @param {string} [wANParameters.provisioningState] The provisioning state of - * the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * - * @param {string} [wANParameters.id] Resource ID. - * - * @param {string} [wANParameters.location] Resource location. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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 VirtualWAN} 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 _createOrUpdate(resourceGroupName, virtualWANName, wANParameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, virtualWANName, wANParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualWAN']().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); - }); - }); -} - - -/** - * Updates a VirtualWAN tags. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being updated. - * - * @param {object} wANParameters Parameters supplied to Update VirtualWAN tags. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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 VirtualWAN} 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 _updateTags(resourceGroupName, virtualWANName, wANParameters, 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.'); - } - - // Send request - this.beginUpdateTags(resourceGroupName, virtualWANName, wANParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualWAN']().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); - }); - }); -} - - -/** - * Deletes a VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being deleted. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, virtualWANName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, virtualWANName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Lists all the VirtualWANs in a resource group. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @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 ListVirtualWANsResult} 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 _listByResourceGroup(resourceGroupName, 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-10-01'; - // Validate - try { - 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 (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 (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/virtualWans'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListVirtualWANsResult']().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); - }); -} - -/** - * Lists all the VirtualWANs in a subscription. - * - * @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 ListVirtualWANsResult} 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(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/virtualWans'; - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListVirtualWANsResult']().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); - }); -} - -/** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing - * VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being created or - * updated. - * - * @param {object} wANParameters Parameters supplied to create or update - * VirtualWAN. - * - * @param {boolean} [wANParameters.disableVpnEncryption] Vpn encryption to be - * disabled or not. - * - * @param {string} [wANParameters.securityProviderName] The Security Provider - * name. - * - * @param {boolean} [wANParameters.allowBranchToBranchTraffic] True if branch - * to branch traffic is allowed. - * - * @param {boolean} [wANParameters.allowVnetToVnetTraffic] True if Vnet to Vnet - * traffic is allowed. - * - * @param {string} [wANParameters.office365LocalBreakoutCategory] The office - * local breakout category. Possible values include: 'Optimize', - * 'OptimizeAndAllow', 'All', 'None' - * - * @param {array} [wANParameters.p2SVpnServerConfigurations] list of all - * P2SVpnServerConfigurations associated with the virtual wan. - * - * @param {string} [wANParameters.provisioningState] The provisioning state of - * the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * - * @param {string} [wANParameters.id] Resource ID. - * - * @param {string} [wANParameters.location] Resource location. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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 VirtualWAN} 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 _beginCreateOrUpdate(resourceGroupName, virtualWANName, wANParameters, 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-10-01'; - // Validate - try { - 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 (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 (virtualWANName === null || virtualWANName === undefined || typeof virtualWANName.valueOf() !== 'string') { - throw new Error('virtualWANName cannot be null or undefined and it must be of type string.'); - } - if (wANParameters === null || wANParameters === undefined) { - throw new Error('wANParameters cannot be null or undefined.'); - } - 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/virtualWans/{VirtualWANName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{VirtualWANName}', encodeURIComponent(virtualWANName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (wANParameters !== null && wANParameters !== undefined) { - let requestModelMapper = new client.models['VirtualWAN']().mapper(); - requestModel = client.serialize(requestModelMapper, wANParameters, 'wANParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(wANParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['VirtualWAN']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualWAN']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Updates a VirtualWAN tags. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being updated. - * - * @param {object} wANParameters Parameters supplied to Update VirtualWAN tags. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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 VirtualWAN} 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 _beginUpdateTags(resourceGroupName, virtualWANName, wANParameters, 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-10-01'; - // Validate - try { - 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 (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 (virtualWANName === null || virtualWANName === undefined || typeof virtualWANName.valueOf() !== 'string') { - throw new Error('virtualWANName cannot be null or undefined and it must be of type string.'); - } - if (wANParameters === null || wANParameters === undefined) { - throw new Error('wANParameters cannot be null or undefined.'); - } - 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/virtualWans/{VirtualWANName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{VirtualWANName}', encodeURIComponent(virtualWANName)); - 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 = 'PATCH'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (wANParameters !== null && wANParameters !== undefined) { - let requestModelMapper = new client.models['TagsObject']().mapper(); - requestModel = client.serialize(requestModelMapper, wANParameters, 'wANParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(wANParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['VirtualWAN']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VirtualWAN']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Deletes a VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being deleted. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, virtualWANName, 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-10-01'; - // Validate - try { - 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 (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 (virtualWANName === null || virtualWANName === undefined || typeof virtualWANName.valueOf() !== 'string') { - throw new Error('virtualWANName 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/virtualWans/{VirtualWANName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{VirtualWANName}', encodeURIComponent(virtualWANName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Lists all the VirtualWANs in a resource group. - * - * @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 ListVirtualWANsResult} 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 _listByResourceGroupNext(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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListVirtualWANsResult']().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); - }); -} - -/** - * Lists all the VirtualWANs in a subscription. - * - * @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 ListVirtualWANsResult} 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListVirtualWANsResult']().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 VirtualWans. */ -class VirtualWans { - /** - * Create a VirtualWans. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._updateTags = _updateTags; - this._deleteMethod = _deleteMethod; - this._listByResourceGroup = _listByResourceGroup; - this._list = _list; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdateTags = _beginUpdateTags; - this._beginDeleteMethod = _beginDeleteMethod; - this._listByResourceGroupNext = _listByResourceGroupNext; - this._listNext = _listNext; - } - - /** - * Retrieves the details of a VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being retrieved. - * - * @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, virtualWANName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, virtualWANName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves the details of a VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being retrieved. - * - * @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 {VirtualWAN} - 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 VirtualWAN} 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, virtualWANName, 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, virtualWANName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, virtualWANName, options, optionalCallback); - } - } - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing - * VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being created or - * updated. - * - * @param {object} wANParameters Parameters supplied to create or update - * VirtualWAN. - * - * @param {boolean} [wANParameters.disableVpnEncryption] Vpn encryption to be - * disabled or not. - * - * @param {string} [wANParameters.securityProviderName] The Security Provider - * name. - * - * @param {boolean} [wANParameters.allowBranchToBranchTraffic] True if branch - * to branch traffic is allowed. - * - * @param {boolean} [wANParameters.allowVnetToVnetTraffic] True if Vnet to Vnet - * traffic is allowed. - * - * @param {string} [wANParameters.office365LocalBreakoutCategory] The office - * local breakout category. Possible values include: 'Optimize', - * 'OptimizeAndAllow', 'All', 'None' - * - * @param {array} [wANParameters.p2SVpnServerConfigurations] list of all - * P2SVpnServerConfigurations associated with the virtual wan. - * - * @param {string} [wANParameters.provisioningState] The provisioning state of - * the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * - * @param {string} [wANParameters.id] Resource ID. - * - * @param {string} [wANParameters.location] Resource location. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, virtualWANName, wANParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, virtualWANName, wANParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing - * VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being created or - * updated. - * - * @param {object} wANParameters Parameters supplied to create or update - * VirtualWAN. - * - * @param {boolean} [wANParameters.disableVpnEncryption] Vpn encryption to be - * disabled or not. - * - * @param {string} [wANParameters.securityProviderName] The Security Provider - * name. - * - * @param {boolean} [wANParameters.allowBranchToBranchTraffic] True if branch - * to branch traffic is allowed. - * - * @param {boolean} [wANParameters.allowVnetToVnetTraffic] True if Vnet to Vnet - * traffic is allowed. - * - * @param {string} [wANParameters.office365LocalBreakoutCategory] The office - * local breakout category. Possible values include: 'Optimize', - * 'OptimizeAndAllow', 'All', 'None' - * - * @param {array} [wANParameters.p2SVpnServerConfigurations] list of all - * P2SVpnServerConfigurations associated with the virtual wan. - * - * @param {string} [wANParameters.provisioningState] The provisioning state of - * the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * - * @param {string} [wANParameters.id] Resource ID. - * - * @param {string} [wANParameters.location] Resource location. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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 {VirtualWAN} - 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 VirtualWAN} 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. - */ - createOrUpdate(resourceGroupName, virtualWANName, wANParameters, 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._createOrUpdate(resourceGroupName, virtualWANName, wANParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, virtualWANName, wANParameters, options, optionalCallback); - } - } - - /** - * Updates a VirtualWAN tags. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being updated. - * - * @param {object} wANParameters Parameters supplied to Update VirtualWAN tags. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName, virtualWANName, wANParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateTags(resourceGroupName, virtualWANName, wANParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates a VirtualWAN tags. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being updated. - * - * @param {object} wANParameters Parameters supplied to Update VirtualWAN tags. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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 {VirtualWAN} - 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 VirtualWAN} 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. - */ - updateTags(resourceGroupName, virtualWANName, wANParameters, 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._updateTags(resourceGroupName, virtualWANName, wANParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateTags(resourceGroupName, virtualWANName, wANParameters, options, optionalCallback); - } - } - - /** - * Deletes a VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being deleted. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, virtualWANName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, virtualWANName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes a VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being deleted. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, virtualWANName, 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._deleteMethod(resourceGroupName, virtualWANName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, virtualWANName, options, optionalCallback); - } - } - - /** - * Lists all the VirtualWANs in a resource group. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all the VirtualWANs in a resource group. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @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 {ListVirtualWANsResult} - 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 ListVirtualWANsResult} 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. - */ - listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroup(resourceGroupName, options, optionalCallback); - } - } - - /** - * Lists all the VirtualWANs in a subscription. - * - * @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(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all the VirtualWANs in a subscription. - * - * @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 {ListVirtualWANsResult} - 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 ListVirtualWANsResult} 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(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(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(options, optionalCallback); - } - } - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing - * VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being created or - * updated. - * - * @param {object} wANParameters Parameters supplied to create or update - * VirtualWAN. - * - * @param {boolean} [wANParameters.disableVpnEncryption] Vpn encryption to be - * disabled or not. - * - * @param {string} [wANParameters.securityProviderName] The Security Provider - * name. - * - * @param {boolean} [wANParameters.allowBranchToBranchTraffic] True if branch - * to branch traffic is allowed. - * - * @param {boolean} [wANParameters.allowVnetToVnetTraffic] True if Vnet to Vnet - * traffic is allowed. - * - * @param {string} [wANParameters.office365LocalBreakoutCategory] The office - * local breakout category. Possible values include: 'Optimize', - * 'OptimizeAndAllow', 'All', 'None' - * - * @param {array} [wANParameters.p2SVpnServerConfigurations] list of all - * P2SVpnServerConfigurations associated with the virtual wan. - * - * @param {string} [wANParameters.provisioningState] The provisioning state of - * the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * - * @param {string} [wANParameters.id] Resource ID. - * - * @param {string} [wANParameters.location] Resource location. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, virtualWANName, wANParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, virtualWANName, wANParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates a VirtualWAN resource if it doesn't exist else updates the existing - * VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being created or - * updated. - * - * @param {object} wANParameters Parameters supplied to create or update - * VirtualWAN. - * - * @param {boolean} [wANParameters.disableVpnEncryption] Vpn encryption to be - * disabled or not. - * - * @param {string} [wANParameters.securityProviderName] The Security Provider - * name. - * - * @param {boolean} [wANParameters.allowBranchToBranchTraffic] True if branch - * to branch traffic is allowed. - * - * @param {boolean} [wANParameters.allowVnetToVnetTraffic] True if Vnet to Vnet - * traffic is allowed. - * - * @param {string} [wANParameters.office365LocalBreakoutCategory] The office - * local breakout category. Possible values include: 'Optimize', - * 'OptimizeAndAllow', 'All', 'None' - * - * @param {array} [wANParameters.p2SVpnServerConfigurations] list of all - * P2SVpnServerConfigurations associated with the virtual wan. - * - * @param {string} [wANParameters.provisioningState] The provisioning state of - * the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', - * 'Failed' - * - * @param {string} [wANParameters.id] Resource ID. - * - * @param {string} [wANParameters.location] Resource location. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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 {VirtualWAN} - 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 VirtualWAN} 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. - */ - beginCreateOrUpdate(resourceGroupName, virtualWANName, wANParameters, 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._beginCreateOrUpdate(resourceGroupName, virtualWANName, wANParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, virtualWANName, wANParameters, options, optionalCallback); - } - } - - /** - * Updates a VirtualWAN tags. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being updated. - * - * @param {object} wANParameters Parameters supplied to Update VirtualWAN tags. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName, virtualWANName, wANParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginUpdateTags(resourceGroupName, virtualWANName, wANParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates a VirtualWAN tags. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being updated. - * - * @param {object} wANParameters Parameters supplied to Update VirtualWAN tags. - * - * @param {object} [wANParameters.tags] Resource tags. - * - * @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 {VirtualWAN} - 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 VirtualWAN} 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. - */ - beginUpdateTags(resourceGroupName, virtualWANName, wANParameters, 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._beginUpdateTags(resourceGroupName, virtualWANName, wANParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginUpdateTags(resourceGroupName, virtualWANName, wANParameters, options, optionalCallback); - } - } - - /** - * Deletes a VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being deleted. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, virtualWANName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, virtualWANName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes a VirtualWAN. - * - * @param {string} resourceGroupName The resource group name of the VirtualWan. - * - * @param {string} virtualWANName The name of the VirtualWAN being deleted. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, virtualWANName, 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._beginDeleteMethod(resourceGroupName, virtualWANName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, virtualWANName, options, optionalCallback); - } - } - - /** - * Lists all the VirtualWANs in a resource group. - * - * @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. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all the VirtualWANs in a resource group. - * - * @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 {ListVirtualWANsResult} - 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 ListVirtualWANsResult} 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. - */ - listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); - } - } - - /** - * Lists all the VirtualWANs in a subscription. - * - * @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; - }); - }); - } - - /** - * Lists all the VirtualWANs in a subscription. - * - * @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 {ListVirtualWANsResult} - 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 ListVirtualWANsResult} 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 = VirtualWans; diff --git a/lib/services/networkManagement2/lib/operations/vpnConnections.js b/lib/services/networkManagement2/lib/operations/vpnConnections.js deleted file mode 100644 index 8a32bac10..000000000 --- a/lib/services/networkManagement2/lib/operations/vpnConnections.js +++ /dev/null @@ -1,1817 +0,0 @@ -/* - * 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; - -/** - * Retrieves the details of a vpn connection. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {string} connectionName The name of the vpn 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 VpnConnection} 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, gatewayName, 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-10-01'; - // Validate - try { - 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 (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 (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { - throw new Error('gatewayName 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.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/vpnGateways/{gatewayName}/vpnConnections/{connectionName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); - requestUrl = requestUrl.replace('{connectionName}', encodeURIComponent(connectionName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['VpnConnection']().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); - }); -} - - -/** - * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else - * updates the existing connection. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {string} connectionName The name of the connection. - * - * @param {object} vpnConnectionParameters Parameters supplied to create or - * Update a VPN Connection. - * - * @param {object} [vpnConnectionParameters.remoteVpnSite] Id of the connected - * vpn site. - * - * @param {string} [vpnConnectionParameters.remoteVpnSite.id] Resource ID. - * - * @param {number} [vpnConnectionParameters.routingWeight] routing weight for - * vpn connection. - * - * @param {string} [vpnConnectionParameters.connectionStatus] The connection - * status. Possible values include: 'Unknown', 'Connecting', 'Connected', - * 'NotConnected' - * - * @param {string} [vpnConnectionParameters.vpnConnectionProtocolType] - * Connection protocol used for this connection. Possible values include: - * 'IKEv2', 'IKEv1' - * - * @param {number} [vpnConnectionParameters.connectionBandwidth] Expected - * bandwidth in MBPS. - * - * @param {string} [vpnConnectionParameters.sharedKey] SharedKey for the vpn - * connection. - * - * @param {boolean} [vpnConnectionParameters.enableBgp] EnableBgp flag - * - * @param {array} [vpnConnectionParameters.ipsecPolicies] The IPSec Policies to - * be considered by this connection. - * - * @param {boolean} [vpnConnectionParameters.enableRateLimiting] EnableBgp flag - * - * @param {boolean} [vpnConnectionParameters.enableInternetSecurity] Enable - * internet security - * - * @param {string} [vpnConnectionParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {string} [vpnConnectionParameters.name] The name of the resource that - * is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [vpnConnectionParameters.id] Resource ID. - * - * @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 VpnConnection} 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 _createOrUpdate(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VpnConnection']().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); - }); - }); -} - - -/** - * Deletes a vpn connection. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {string} connectionName The name of the 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, gatewayName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, gatewayName, connectionName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Retrieves all vpn connections for a particular virtual wan vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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 ListVpnConnectionsResult} 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 _listByVpnGateway(resourceGroupName, gatewayName, 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-10-01'; - // Validate - try { - 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 (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 (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { - throw new Error('gatewayName 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/vpnGateways/{gatewayName}/vpnConnections'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListVpnConnectionsResult']().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); - }); -} - -/** - * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else - * updates the existing connection. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {string} connectionName The name of the connection. - * - * @param {object} vpnConnectionParameters Parameters supplied to create or - * Update a VPN Connection. - * - * @param {object} [vpnConnectionParameters.remoteVpnSite] Id of the connected - * vpn site. - * - * @param {string} [vpnConnectionParameters.remoteVpnSite.id] Resource ID. - * - * @param {number} [vpnConnectionParameters.routingWeight] routing weight for - * vpn connection. - * - * @param {string} [vpnConnectionParameters.connectionStatus] The connection - * status. Possible values include: 'Unknown', 'Connecting', 'Connected', - * 'NotConnected' - * - * @param {string} [vpnConnectionParameters.vpnConnectionProtocolType] - * Connection protocol used for this connection. Possible values include: - * 'IKEv2', 'IKEv1' - * - * @param {number} [vpnConnectionParameters.connectionBandwidth] Expected - * bandwidth in MBPS. - * - * @param {string} [vpnConnectionParameters.sharedKey] SharedKey for the vpn - * connection. - * - * @param {boolean} [vpnConnectionParameters.enableBgp] EnableBgp flag - * - * @param {array} [vpnConnectionParameters.ipsecPolicies] The IPSec Policies to - * be considered by this connection. - * - * @param {boolean} [vpnConnectionParameters.enableRateLimiting] EnableBgp flag - * - * @param {boolean} [vpnConnectionParameters.enableInternetSecurity] Enable - * internet security - * - * @param {string} [vpnConnectionParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {string} [vpnConnectionParameters.name] The name of the resource that - * is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [vpnConnectionParameters.id] Resource ID. - * - * @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 VpnConnection} 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 _beginCreateOrUpdate(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, 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-10-01'; - // Validate - try { - 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 (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 (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { - throw new Error('gatewayName 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 (vpnConnectionParameters === null || vpnConnectionParameters === undefined) { - throw new Error('vpnConnectionParameters cannot be null or undefined.'); - } - 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/vpnGateways/{gatewayName}/vpnConnections/{connectionName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); - requestUrl = requestUrl.replace('{connectionName}', encodeURIComponent(connectionName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (vpnConnectionParameters !== null && vpnConnectionParameters !== undefined) { - let requestModelMapper = new client.models['VpnConnection']().mapper(); - requestModel = client.serialize(requestModelMapper, vpnConnectionParameters, 'vpnConnectionParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(vpnConnectionParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['VpnConnection']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VpnConnection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Deletes a vpn connection. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {string} connectionName The name of the 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, gatewayName, 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-10-01'; - // Validate - try { - 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 (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 (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { - throw new Error('gatewayName 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.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/vpnGateways/{gatewayName}/vpnConnections/{connectionName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); - requestUrl = requestUrl.replace('{connectionName}', encodeURIComponent(connectionName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Retrieves all vpn connections for a particular virtual wan vpn gateway. - * - * @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 ListVpnConnectionsResult} 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 _listByVpnGatewayNext(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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListVpnConnectionsResult']().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 VpnConnections. */ -class VpnConnections { - /** - * Create a VpnConnections. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._deleteMethod = _deleteMethod; - this._listByVpnGateway = _listByVpnGateway; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginDeleteMethod = _beginDeleteMethod; - this._listByVpnGatewayNext = _listByVpnGatewayNext; - } - - /** - * Retrieves the details of a vpn connection. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {string} connectionName The name of the vpn 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, gatewayName, connectionName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, gatewayName, connectionName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves the details of a vpn connection. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {string} connectionName The name of the vpn 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 {VpnConnection} - 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 VpnConnection} 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, gatewayName, 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, gatewayName, connectionName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, gatewayName, connectionName, options, optionalCallback); - } - } - - /** - * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else - * updates the existing connection. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {string} connectionName The name of the connection. - * - * @param {object} vpnConnectionParameters Parameters supplied to create or - * Update a VPN Connection. - * - * @param {object} [vpnConnectionParameters.remoteVpnSite] Id of the connected - * vpn site. - * - * @param {string} [vpnConnectionParameters.remoteVpnSite.id] Resource ID. - * - * @param {number} [vpnConnectionParameters.routingWeight] routing weight for - * vpn connection. - * - * @param {string} [vpnConnectionParameters.connectionStatus] The connection - * status. Possible values include: 'Unknown', 'Connecting', 'Connected', - * 'NotConnected' - * - * @param {string} [vpnConnectionParameters.vpnConnectionProtocolType] - * Connection protocol used for this connection. Possible values include: - * 'IKEv2', 'IKEv1' - * - * @param {number} [vpnConnectionParameters.connectionBandwidth] Expected - * bandwidth in MBPS. - * - * @param {string} [vpnConnectionParameters.sharedKey] SharedKey for the vpn - * connection. - * - * @param {boolean} [vpnConnectionParameters.enableBgp] EnableBgp flag - * - * @param {array} [vpnConnectionParameters.ipsecPolicies] The IPSec Policies to - * be considered by this connection. - * - * @param {boolean} [vpnConnectionParameters.enableRateLimiting] EnableBgp flag - * - * @param {boolean} [vpnConnectionParameters.enableInternetSecurity] Enable - * internet security - * - * @param {string} [vpnConnectionParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {string} [vpnConnectionParameters.name] The name of the resource that - * is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [vpnConnectionParameters.id] Resource ID. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else - * updates the existing connection. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {string} connectionName The name of the connection. - * - * @param {object} vpnConnectionParameters Parameters supplied to create or - * Update a VPN Connection. - * - * @param {object} [vpnConnectionParameters.remoteVpnSite] Id of the connected - * vpn site. - * - * @param {string} [vpnConnectionParameters.remoteVpnSite.id] Resource ID. - * - * @param {number} [vpnConnectionParameters.routingWeight] routing weight for - * vpn connection. - * - * @param {string} [vpnConnectionParameters.connectionStatus] The connection - * status. Possible values include: 'Unknown', 'Connecting', 'Connected', - * 'NotConnected' - * - * @param {string} [vpnConnectionParameters.vpnConnectionProtocolType] - * Connection protocol used for this connection. Possible values include: - * 'IKEv2', 'IKEv1' - * - * @param {number} [vpnConnectionParameters.connectionBandwidth] Expected - * bandwidth in MBPS. - * - * @param {string} [vpnConnectionParameters.sharedKey] SharedKey for the vpn - * connection. - * - * @param {boolean} [vpnConnectionParameters.enableBgp] EnableBgp flag - * - * @param {array} [vpnConnectionParameters.ipsecPolicies] The IPSec Policies to - * be considered by this connection. - * - * @param {boolean} [vpnConnectionParameters.enableRateLimiting] EnableBgp flag - * - * @param {boolean} [vpnConnectionParameters.enableInternetSecurity] Enable - * internet security - * - * @param {string} [vpnConnectionParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {string} [vpnConnectionParameters.name] The name of the resource that - * is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [vpnConnectionParameters.id] Resource ID. - * - * @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 {VpnConnection} - 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 VpnConnection} 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. - */ - createOrUpdate(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, 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._createOrUpdate(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, options, optionalCallback); - } - } - - /** - * Deletes a vpn connection. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {string} connectionName The name of the 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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, gatewayName, connectionName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, gatewayName, connectionName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes a vpn connection. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {string} connectionName The name of the 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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, gatewayName, 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._deleteMethod(resourceGroupName, gatewayName, connectionName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, gatewayName, connectionName, options, optionalCallback); - } - } - - /** - * Retrieves all vpn connections for a particular virtual wan vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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. - */ - listByVpnGatewayWithHttpOperationResponse(resourceGroupName, gatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByVpnGateway(resourceGroupName, gatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all vpn connections for a particular virtual wan vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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 {ListVpnConnectionsResult} - 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 ListVpnConnectionsResult} 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. - */ - listByVpnGateway(resourceGroupName, gatewayName, 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._listByVpnGateway(resourceGroupName, gatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByVpnGateway(resourceGroupName, gatewayName, options, optionalCallback); - } - } - - /** - * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else - * updates the existing connection. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {string} connectionName The name of the connection. - * - * @param {object} vpnConnectionParameters Parameters supplied to create or - * Update a VPN Connection. - * - * @param {object} [vpnConnectionParameters.remoteVpnSite] Id of the connected - * vpn site. - * - * @param {string} [vpnConnectionParameters.remoteVpnSite.id] Resource ID. - * - * @param {number} [vpnConnectionParameters.routingWeight] routing weight for - * vpn connection. - * - * @param {string} [vpnConnectionParameters.connectionStatus] The connection - * status. Possible values include: 'Unknown', 'Connecting', 'Connected', - * 'NotConnected' - * - * @param {string} [vpnConnectionParameters.vpnConnectionProtocolType] - * Connection protocol used for this connection. Possible values include: - * 'IKEv2', 'IKEv1' - * - * @param {number} [vpnConnectionParameters.connectionBandwidth] Expected - * bandwidth in MBPS. - * - * @param {string} [vpnConnectionParameters.sharedKey] SharedKey for the vpn - * connection. - * - * @param {boolean} [vpnConnectionParameters.enableBgp] EnableBgp flag - * - * @param {array} [vpnConnectionParameters.ipsecPolicies] The IPSec Policies to - * be considered by this connection. - * - * @param {boolean} [vpnConnectionParameters.enableRateLimiting] EnableBgp flag - * - * @param {boolean} [vpnConnectionParameters.enableInternetSecurity] Enable - * internet security - * - * @param {string} [vpnConnectionParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {string} [vpnConnectionParameters.name] The name of the resource that - * is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [vpnConnectionParameters.id] Resource ID. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates a vpn connection to a scalable vpn gateway if it doesn't exist else - * updates the existing connection. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {string} connectionName The name of the connection. - * - * @param {object} vpnConnectionParameters Parameters supplied to create or - * Update a VPN Connection. - * - * @param {object} [vpnConnectionParameters.remoteVpnSite] Id of the connected - * vpn site. - * - * @param {string} [vpnConnectionParameters.remoteVpnSite.id] Resource ID. - * - * @param {number} [vpnConnectionParameters.routingWeight] routing weight for - * vpn connection. - * - * @param {string} [vpnConnectionParameters.connectionStatus] The connection - * status. Possible values include: 'Unknown', 'Connecting', 'Connected', - * 'NotConnected' - * - * @param {string} [vpnConnectionParameters.vpnConnectionProtocolType] - * Connection protocol used for this connection. Possible values include: - * 'IKEv2', 'IKEv1' - * - * @param {number} [vpnConnectionParameters.connectionBandwidth] Expected - * bandwidth in MBPS. - * - * @param {string} [vpnConnectionParameters.sharedKey] SharedKey for the vpn - * connection. - * - * @param {boolean} [vpnConnectionParameters.enableBgp] EnableBgp flag - * - * @param {array} [vpnConnectionParameters.ipsecPolicies] The IPSec Policies to - * be considered by this connection. - * - * @param {boolean} [vpnConnectionParameters.enableRateLimiting] EnableBgp flag - * - * @param {boolean} [vpnConnectionParameters.enableInternetSecurity] Enable - * internet security - * - * @param {string} [vpnConnectionParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {string} [vpnConnectionParameters.name] The name of the resource that - * is unique within a resource group. This name can be used to access the - * resource. - * - * @param {string} [vpnConnectionParameters.id] Resource ID. - * - * @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 {VpnConnection} - 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 VpnConnection} 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. - */ - beginCreateOrUpdate(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, 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._beginCreateOrUpdate(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters, options, optionalCallback); - } - } - - /** - * Deletes a vpn connection. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {string} connectionName The name of the 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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, gatewayName, connectionName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, gatewayName, connectionName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes a vpn connection. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {string} connectionName The name of the 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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, gatewayName, 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._beginDeleteMethod(resourceGroupName, gatewayName, connectionName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, gatewayName, connectionName, options, optionalCallback); - } - } - - /** - * Retrieves all vpn connections for a particular virtual wan vpn gateway. - * - * @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. - */ - listByVpnGatewayNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByVpnGatewayNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all vpn connections for a particular virtual wan vpn gateway. - * - * @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 {ListVpnConnectionsResult} - 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 ListVpnConnectionsResult} 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. - */ - listByVpnGatewayNext(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._listByVpnGatewayNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByVpnGatewayNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = VpnConnections; diff --git a/lib/services/networkManagement2/lib/operations/vpnGateways.js b/lib/services/networkManagement2/lib/operations/vpnGateways.js deleted file mode 100644 index 6a9ae378d..000000000 --- a/lib/services/networkManagement2/lib/operations/vpnGateways.js +++ /dev/null @@ -1,2591 +0,0 @@ -/* - * 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; - -/** - * Retrieves the details of a virtual wan vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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 VpnGateway} 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, gatewayName, 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-10-01'; - // Validate - try { - 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 (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 (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { - throw new Error('gatewayName 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/vpnGateways/{gatewayName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['VpnGateway']().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); - }); -} - - -/** - * Creates a virtual wan vpn gateway if it doesn't exist else updates the - * existing gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} vpnGatewayParameters Parameters supplied to create or Update - * a virtual wan vpn gateway. - * - * @param {object} [vpnGatewayParameters.virtualHub] The VirtualHub to which - * the gateway belongs - * - * @param {string} [vpnGatewayParameters.virtualHub.id] Resource ID. - * - * @param {array} [vpnGatewayParameters.connections] list of all vpn - * connections to the gateway. - * - * @param {object} [vpnGatewayParameters.bgpSettings] Local network gateway's - * BGP speaker settings. - * - * @param {number} [vpnGatewayParameters.bgpSettings.asn] The BGP speaker's - * ASN. - * - * @param {string} [vpnGatewayParameters.bgpSettings.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [vpnGatewayParameters.bgpSettings.peerWeight] The weight - * added to routes learned from this BGP speaker. - * - * @param {string} [vpnGatewayParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {number} [vpnGatewayParameters.vpnGatewayScaleUnit] The scale unit - * for this vpn gateway. - * - * @param {string} [vpnGatewayParameters.id] Resource ID. - * - * @param {string} [vpnGatewayParameters.location] Resource location. - * - * @param {object} [vpnGatewayParameters.tags] Resource tags. - * - * @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 VpnGateway} 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 _createOrUpdate(resourceGroupName, gatewayName, vpnGatewayParameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, gatewayName, vpnGatewayParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VpnGateway']().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); - }); - }); -} - - -/** - * Updates virtual wan vpn gateway tags. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} vpnGatewayParameters Parameters supplied to update a virtual - * wan vpn gateway tags. - * - * @param {object} [vpnGatewayParameters.tags] Resource tags. - * - * @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 VpnGateway} 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 _updateTags(resourceGroupName, gatewayName, vpnGatewayParameters, 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.'); - } - - // Send request - this.beginUpdateTags(resourceGroupName, gatewayName, vpnGatewayParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VpnGateway']().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); - }); - }); -} - - -/** - * Deletes a virtual wan vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, gatewayName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, gatewayName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Lists all the VpnGateways in a resource group. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @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 ListVpnGatewaysResult} 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 _listByResourceGroup(resourceGroupName, 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-10-01'; - // Validate - try { - 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 (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 (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/vpnGateways'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListVpnGatewaysResult']().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); - }); -} - -/** - * Lists all the VpnGateways in a subscription. - * - * @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 ListVpnGatewaysResult} 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(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/vpnGateways'; - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListVpnGatewaysResult']().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); - }); -} - -/** - * Creates a virtual wan vpn gateway if it doesn't exist else updates the - * existing gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} vpnGatewayParameters Parameters supplied to create or Update - * a virtual wan vpn gateway. - * - * @param {object} [vpnGatewayParameters.virtualHub] The VirtualHub to which - * the gateway belongs - * - * @param {string} [vpnGatewayParameters.virtualHub.id] Resource ID. - * - * @param {array} [vpnGatewayParameters.connections] list of all vpn - * connections to the gateway. - * - * @param {object} [vpnGatewayParameters.bgpSettings] Local network gateway's - * BGP speaker settings. - * - * @param {number} [vpnGatewayParameters.bgpSettings.asn] The BGP speaker's - * ASN. - * - * @param {string} [vpnGatewayParameters.bgpSettings.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [vpnGatewayParameters.bgpSettings.peerWeight] The weight - * added to routes learned from this BGP speaker. - * - * @param {string} [vpnGatewayParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {number} [vpnGatewayParameters.vpnGatewayScaleUnit] The scale unit - * for this vpn gateway. - * - * @param {string} [vpnGatewayParameters.id] Resource ID. - * - * @param {string} [vpnGatewayParameters.location] Resource location. - * - * @param {object} [vpnGatewayParameters.tags] Resource tags. - * - * @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 VpnGateway} 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 _beginCreateOrUpdate(resourceGroupName, gatewayName, vpnGatewayParameters, 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-10-01'; - // Validate - try { - 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 (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 (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { - throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); - } - if (vpnGatewayParameters === null || vpnGatewayParameters === undefined) { - throw new Error('vpnGatewayParameters cannot be null or undefined.'); - } - 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/vpnGateways/{gatewayName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (vpnGatewayParameters !== null && vpnGatewayParameters !== undefined) { - let requestModelMapper = new client.models['VpnGateway']().mapper(); - requestModel = client.serialize(requestModelMapper, vpnGatewayParameters, 'vpnGatewayParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(vpnGatewayParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['VpnGateway']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VpnGateway']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Updates virtual wan vpn gateway tags. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} vpnGatewayParameters Parameters supplied to update a virtual - * wan vpn gateway tags. - * - * @param {object} [vpnGatewayParameters.tags] Resource tags. - * - * @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 VpnGateway} 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 _beginUpdateTags(resourceGroupName, gatewayName, vpnGatewayParameters, 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-10-01'; - // Validate - try { - 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 (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 (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { - throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); - } - if (vpnGatewayParameters === null || vpnGatewayParameters === undefined) { - throw new Error('vpnGatewayParameters cannot be null or undefined.'); - } - 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/vpnGateways/{gatewayName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); - 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 = 'PATCH'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (vpnGatewayParameters !== null && vpnGatewayParameters !== undefined) { - let requestModelMapper = new client.models['TagsObject']().mapper(); - requestModel = client.serialize(requestModelMapper, vpnGatewayParameters, 'vpnGatewayParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(vpnGatewayParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['VpnGateway']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VpnGateway']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Deletes a virtual wan vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, gatewayName, 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-10-01'; - // Validate - try { - 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 (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 (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { - throw new Error('gatewayName 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/vpnGateways/{gatewayName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Lists all the VpnGateways in a resource group. - * - * @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 ListVpnGatewaysResult} 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 _listByResourceGroupNext(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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListVpnGatewaysResult']().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); - }); -} - -/** - * Lists all the VpnGateways in a subscription. - * - * @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 ListVpnGatewaysResult} 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListVpnGatewaysResult']().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 VpnGateways. */ -class VpnGateways { - /** - * Create a VpnGateways. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._updateTags = _updateTags; - this._deleteMethod = _deleteMethod; - this._listByResourceGroup = _listByResourceGroup; - this._list = _list; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdateTags = _beginUpdateTags; - this._beginDeleteMethod = _beginDeleteMethod; - this._listByResourceGroupNext = _listByResourceGroupNext; - this._listNext = _listNext; - } - - /** - * Retrieves the details of a virtual wan vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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, gatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, gatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves the details of a virtual wan vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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 {VpnGateway} - 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 VpnGateway} 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, gatewayName, 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, gatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, gatewayName, options, optionalCallback); - } - } - - /** - * Creates a virtual wan vpn gateway if it doesn't exist else updates the - * existing gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} vpnGatewayParameters Parameters supplied to create or Update - * a virtual wan vpn gateway. - * - * @param {object} [vpnGatewayParameters.virtualHub] The VirtualHub to which - * the gateway belongs - * - * @param {string} [vpnGatewayParameters.virtualHub.id] Resource ID. - * - * @param {array} [vpnGatewayParameters.connections] list of all vpn - * connections to the gateway. - * - * @param {object} [vpnGatewayParameters.bgpSettings] Local network gateway's - * BGP speaker settings. - * - * @param {number} [vpnGatewayParameters.bgpSettings.asn] The BGP speaker's - * ASN. - * - * @param {string} [vpnGatewayParameters.bgpSettings.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [vpnGatewayParameters.bgpSettings.peerWeight] The weight - * added to routes learned from this BGP speaker. - * - * @param {string} [vpnGatewayParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {number} [vpnGatewayParameters.vpnGatewayScaleUnit] The scale unit - * for this vpn gateway. - * - * @param {string} [vpnGatewayParameters.id] Resource ID. - * - * @param {string} [vpnGatewayParameters.location] Resource location. - * - * @param {object} [vpnGatewayParameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, gatewayName, vpnGatewayParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, gatewayName, vpnGatewayParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates a virtual wan vpn gateway if it doesn't exist else updates the - * existing gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} vpnGatewayParameters Parameters supplied to create or Update - * a virtual wan vpn gateway. - * - * @param {object} [vpnGatewayParameters.virtualHub] The VirtualHub to which - * the gateway belongs - * - * @param {string} [vpnGatewayParameters.virtualHub.id] Resource ID. - * - * @param {array} [vpnGatewayParameters.connections] list of all vpn - * connections to the gateway. - * - * @param {object} [vpnGatewayParameters.bgpSettings] Local network gateway's - * BGP speaker settings. - * - * @param {number} [vpnGatewayParameters.bgpSettings.asn] The BGP speaker's - * ASN. - * - * @param {string} [vpnGatewayParameters.bgpSettings.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [vpnGatewayParameters.bgpSettings.peerWeight] The weight - * added to routes learned from this BGP speaker. - * - * @param {string} [vpnGatewayParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {number} [vpnGatewayParameters.vpnGatewayScaleUnit] The scale unit - * for this vpn gateway. - * - * @param {string} [vpnGatewayParameters.id] Resource ID. - * - * @param {string} [vpnGatewayParameters.location] Resource location. - * - * @param {object} [vpnGatewayParameters.tags] Resource tags. - * - * @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 {VpnGateway} - 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 VpnGateway} 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. - */ - createOrUpdate(resourceGroupName, gatewayName, vpnGatewayParameters, 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._createOrUpdate(resourceGroupName, gatewayName, vpnGatewayParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, gatewayName, vpnGatewayParameters, options, optionalCallback); - } - } - - /** - * Updates virtual wan vpn gateway tags. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} vpnGatewayParameters Parameters supplied to update a virtual - * wan vpn gateway tags. - * - * @param {object} [vpnGatewayParameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName, gatewayName, vpnGatewayParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateTags(resourceGroupName, gatewayName, vpnGatewayParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates virtual wan vpn gateway tags. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} vpnGatewayParameters Parameters supplied to update a virtual - * wan vpn gateway tags. - * - * @param {object} [vpnGatewayParameters.tags] Resource tags. - * - * @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 {VpnGateway} - 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 VpnGateway} 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. - */ - updateTags(resourceGroupName, gatewayName, vpnGatewayParameters, 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._updateTags(resourceGroupName, gatewayName, vpnGatewayParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateTags(resourceGroupName, gatewayName, vpnGatewayParameters, options, optionalCallback); - } - } - - /** - * Deletes a virtual wan vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, gatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, gatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes a virtual wan vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, gatewayName, 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._deleteMethod(resourceGroupName, gatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, gatewayName, options, optionalCallback); - } - } - - /** - * Lists all the VpnGateways in a resource group. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all the VpnGateways in a resource group. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @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 {ListVpnGatewaysResult} - 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 ListVpnGatewaysResult} 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. - */ - listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroup(resourceGroupName, options, optionalCallback); - } - } - - /** - * Lists all the VpnGateways in a subscription. - * - * @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(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all the VpnGateways in a subscription. - * - * @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 {ListVpnGatewaysResult} - 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 ListVpnGatewaysResult} 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(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(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(options, optionalCallback); - } - } - - /** - * Creates a virtual wan vpn gateway if it doesn't exist else updates the - * existing gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} vpnGatewayParameters Parameters supplied to create or Update - * a virtual wan vpn gateway. - * - * @param {object} [vpnGatewayParameters.virtualHub] The VirtualHub to which - * the gateway belongs - * - * @param {string} [vpnGatewayParameters.virtualHub.id] Resource ID. - * - * @param {array} [vpnGatewayParameters.connections] list of all vpn - * connections to the gateway. - * - * @param {object} [vpnGatewayParameters.bgpSettings] Local network gateway's - * BGP speaker settings. - * - * @param {number} [vpnGatewayParameters.bgpSettings.asn] The BGP speaker's - * ASN. - * - * @param {string} [vpnGatewayParameters.bgpSettings.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [vpnGatewayParameters.bgpSettings.peerWeight] The weight - * added to routes learned from this BGP speaker. - * - * @param {string} [vpnGatewayParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {number} [vpnGatewayParameters.vpnGatewayScaleUnit] The scale unit - * for this vpn gateway. - * - * @param {string} [vpnGatewayParameters.id] Resource ID. - * - * @param {string} [vpnGatewayParameters.location] Resource location. - * - * @param {object} [vpnGatewayParameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, gatewayName, vpnGatewayParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, gatewayName, vpnGatewayParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates a virtual wan vpn gateway if it doesn't exist else updates the - * existing gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} vpnGatewayParameters Parameters supplied to create or Update - * a virtual wan vpn gateway. - * - * @param {object} [vpnGatewayParameters.virtualHub] The VirtualHub to which - * the gateway belongs - * - * @param {string} [vpnGatewayParameters.virtualHub.id] Resource ID. - * - * @param {array} [vpnGatewayParameters.connections] list of all vpn - * connections to the gateway. - * - * @param {object} [vpnGatewayParameters.bgpSettings] Local network gateway's - * BGP speaker settings. - * - * @param {number} [vpnGatewayParameters.bgpSettings.asn] The BGP speaker's - * ASN. - * - * @param {string} [vpnGatewayParameters.bgpSettings.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [vpnGatewayParameters.bgpSettings.peerWeight] The weight - * added to routes learned from this BGP speaker. - * - * @param {string} [vpnGatewayParameters.provisioningState] The provisioning - * state of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {number} [vpnGatewayParameters.vpnGatewayScaleUnit] The scale unit - * for this vpn gateway. - * - * @param {string} [vpnGatewayParameters.id] Resource ID. - * - * @param {string} [vpnGatewayParameters.location] Resource location. - * - * @param {object} [vpnGatewayParameters.tags] Resource tags. - * - * @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 {VpnGateway} - 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 VpnGateway} 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. - */ - beginCreateOrUpdate(resourceGroupName, gatewayName, vpnGatewayParameters, 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._beginCreateOrUpdate(resourceGroupName, gatewayName, vpnGatewayParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, gatewayName, vpnGatewayParameters, options, optionalCallback); - } - } - - /** - * Updates virtual wan vpn gateway tags. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} vpnGatewayParameters Parameters supplied to update a virtual - * wan vpn gateway tags. - * - * @param {object} [vpnGatewayParameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName, gatewayName, vpnGatewayParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginUpdateTags(resourceGroupName, gatewayName, vpnGatewayParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates virtual wan vpn gateway tags. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @param {object} vpnGatewayParameters Parameters supplied to update a virtual - * wan vpn gateway tags. - * - * @param {object} [vpnGatewayParameters.tags] Resource tags. - * - * @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 {VpnGateway} - 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 VpnGateway} 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. - */ - beginUpdateTags(resourceGroupName, gatewayName, vpnGatewayParameters, 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._beginUpdateTags(resourceGroupName, gatewayName, vpnGatewayParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginUpdateTags(resourceGroupName, gatewayName, vpnGatewayParameters, options, optionalCallback); - } - } - - /** - * Deletes a virtual wan vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, gatewayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, gatewayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes a virtual wan vpn gateway. - * - * @param {string} resourceGroupName The resource group name of the VpnGateway. - * - * @param {string} gatewayName The name of the gateway. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, gatewayName, 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._beginDeleteMethod(resourceGroupName, gatewayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, gatewayName, options, optionalCallback); - } - } - - /** - * Lists all the VpnGateways in a resource group. - * - * @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. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all the VpnGateways in a resource group. - * - * @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 {ListVpnGatewaysResult} - 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 ListVpnGatewaysResult} 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. - */ - listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); - } - } - - /** - * Lists all the VpnGateways in a subscription. - * - * @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; - }); - }); - } - - /** - * Lists all the VpnGateways in a subscription. - * - * @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 {ListVpnGatewaysResult} - 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 ListVpnGatewaysResult} 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 = VpnGateways; diff --git a/lib/services/networkManagement2/lib/operations/vpnSites.js b/lib/services/networkManagement2/lib/operations/vpnSites.js deleted file mode 100644 index 4d8f48db2..000000000 --- a/lib/services/networkManagement2/lib/operations/vpnSites.js +++ /dev/null @@ -1,2699 +0,0 @@ -/* - * 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; - -/** - * Retrieves the details of a VPNsite. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being retrieved. - * - * @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 VpnSite} 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, vpnSiteName, 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-10-01'; - // Validate - try { - 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 (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 (vpnSiteName === null || vpnSiteName === undefined || typeof vpnSiteName.valueOf() !== 'string') { - throw new Error('vpnSiteName 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/vpnSites/{vpnSiteName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{vpnSiteName}', encodeURIComponent(vpnSiteName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['VpnSite']().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); - }); -} - - -/** - * Creates a VpnSite resource if it doesn't exist else updates the existing - * VpnSite. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being created or - * updated. - * - * @param {object} vpnSiteParameters Parameters supplied to create or update - * VpnSite. - * - * @param {object} [vpnSiteParameters.virtualWan] The VirtualWAN to which the - * vpnSite belongs - * - * @param {string} [vpnSiteParameters.virtualWan.id] Resource ID. - * - * @param {object} [vpnSiteParameters.deviceProperties] The device properties - * - * @param {string} [vpnSiteParameters.deviceProperties.deviceVendor] Name of - * the device Vendor. - * - * @param {string} [vpnSiteParameters.deviceProperties.deviceModel] Model of - * the device. - * - * @param {number} [vpnSiteParameters.deviceProperties.linkSpeedInMbps] Link - * speed. - * - * @param {string} [vpnSiteParameters.ipAddress] The ip-address for the - * vpn-site. - * - * @param {string} [vpnSiteParameters.siteKey] The key for vpn-site that can be - * used for connections. - * - * @param {object} [vpnSiteParameters.addressSpace] The AddressSpace that - * contains an array of IP address ranges. - * - * @param {array} [vpnSiteParameters.addressSpace.addressPrefixes] A list of - * address blocks reserved for this virtual network in CIDR notation. - * - * @param {object} [vpnSiteParameters.bgpProperties] The set of bgp properties. - * - * @param {number} [vpnSiteParameters.bgpProperties.asn] The BGP speaker's ASN. - * - * @param {string} [vpnSiteParameters.bgpProperties.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [vpnSiteParameters.bgpProperties.peerWeight] The weight - * added to routes learned from this BGP speaker. - * - * @param {string} [vpnSiteParameters.provisioningState] The provisioning state - * of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {boolean} [vpnSiteParameters.isSecuritySite] IsSecuritySite flag - * - * @param {string} [vpnSiteParameters.id] Resource ID. - * - * @param {string} [vpnSiteParameters.location] Resource location. - * - * @param {object} [vpnSiteParameters.tags] Resource tags. - * - * @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 VpnSite} 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 _createOrUpdate(resourceGroupName, vpnSiteName, vpnSiteParameters, 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.'); - } - - // Send request - this.beginCreateOrUpdate(resourceGroupName, vpnSiteName, vpnSiteParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VpnSite']().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); - }); - }); -} - - -/** - * Updates VpnSite tags. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being updated. - * - * @param {object} vpnSiteParameters Parameters supplied to update VpnSite - * tags. - * - * @param {object} [vpnSiteParameters.tags] Resource tags. - * - * @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 VpnSite} 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 _updateTags(resourceGroupName, vpnSiteName, vpnSiteParameters, 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.'); - } - - // Send request - this.beginUpdateTags(resourceGroupName, vpnSiteName, vpnSiteParameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VpnSite']().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); - }); - }); -} - - -/** - * Deletes a VpnSite. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being deleted. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _deleteMethod(resourceGroupName, vpnSiteName, 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.'); - } - - // Send request - this.beginDeleteMethod(resourceGroupName, vpnSiteName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Lists all the vpnSites in a resource group. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @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 ListVpnSitesResult} 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 _listByResourceGroup(resourceGroupName, 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-10-01'; - // Validate - try { - 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 (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 (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/vpnSites'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListVpnSitesResult']().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); - }); -} - -/** - * Lists all the VpnSites in a subscription. - * - * @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 ListVpnSitesResult} 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(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-10-01'; - // Validate - try { - 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}/providers/Microsoft.Network/vpnSites'; - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListVpnSitesResult']().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); - }); -} - -/** - * Creates a VpnSite resource if it doesn't exist else updates the existing - * VpnSite. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being created or - * updated. - * - * @param {object} vpnSiteParameters Parameters supplied to create or update - * VpnSite. - * - * @param {object} [vpnSiteParameters.virtualWan] The VirtualWAN to which the - * vpnSite belongs - * - * @param {string} [vpnSiteParameters.virtualWan.id] Resource ID. - * - * @param {object} [vpnSiteParameters.deviceProperties] The device properties - * - * @param {string} [vpnSiteParameters.deviceProperties.deviceVendor] Name of - * the device Vendor. - * - * @param {string} [vpnSiteParameters.deviceProperties.deviceModel] Model of - * the device. - * - * @param {number} [vpnSiteParameters.deviceProperties.linkSpeedInMbps] Link - * speed. - * - * @param {string} [vpnSiteParameters.ipAddress] The ip-address for the - * vpn-site. - * - * @param {string} [vpnSiteParameters.siteKey] The key for vpn-site that can be - * used for connections. - * - * @param {object} [vpnSiteParameters.addressSpace] The AddressSpace that - * contains an array of IP address ranges. - * - * @param {array} [vpnSiteParameters.addressSpace.addressPrefixes] A list of - * address blocks reserved for this virtual network in CIDR notation. - * - * @param {object} [vpnSiteParameters.bgpProperties] The set of bgp properties. - * - * @param {number} [vpnSiteParameters.bgpProperties.asn] The BGP speaker's ASN. - * - * @param {string} [vpnSiteParameters.bgpProperties.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [vpnSiteParameters.bgpProperties.peerWeight] The weight - * added to routes learned from this BGP speaker. - * - * @param {string} [vpnSiteParameters.provisioningState] The provisioning state - * of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {boolean} [vpnSiteParameters.isSecuritySite] IsSecuritySite flag - * - * @param {string} [vpnSiteParameters.id] Resource ID. - * - * @param {string} [vpnSiteParameters.location] Resource location. - * - * @param {object} [vpnSiteParameters.tags] Resource tags. - * - * @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 VpnSite} 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 _beginCreateOrUpdate(resourceGroupName, vpnSiteName, vpnSiteParameters, 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-10-01'; - // Validate - try { - 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 (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 (vpnSiteName === null || vpnSiteName === undefined || typeof vpnSiteName.valueOf() !== 'string') { - throw new Error('vpnSiteName cannot be null or undefined and it must be of type string.'); - } - if (vpnSiteParameters === null || vpnSiteParameters === undefined) { - throw new Error('vpnSiteParameters cannot be null or undefined.'); - } - 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/vpnSites/{vpnSiteName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{vpnSiteName}', encodeURIComponent(vpnSiteName)); - 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 = 'PUT'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (vpnSiteParameters !== null && vpnSiteParameters !== undefined) { - let requestModelMapper = new client.models['VpnSite']().mapper(); - requestModel = client.serialize(requestModelMapper, vpnSiteParameters, 'vpnSiteParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(vpnSiteParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['VpnSite']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VpnSite']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Updates VpnSite tags. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being updated. - * - * @param {object} vpnSiteParameters Parameters supplied to update VpnSite - * tags. - * - * @param {object} [vpnSiteParameters.tags] Resource tags. - * - * @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 VpnSite} 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 _beginUpdateTags(resourceGroupName, vpnSiteName, vpnSiteParameters, 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-10-01'; - // Validate - try { - 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 (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 (vpnSiteName === null || vpnSiteName === undefined || typeof vpnSiteName.valueOf() !== 'string') { - throw new Error('vpnSiteName cannot be null or undefined and it must be of type string.'); - } - if (vpnSiteParameters === null || vpnSiteParameters === undefined) { - throw new Error('vpnSiteParameters cannot be null or undefined.'); - } - 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/vpnSites/{vpnSiteName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{vpnSiteName}', encodeURIComponent(vpnSiteName)); - 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 = 'PATCH'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (vpnSiteParameters !== null && vpnSiteParameters !== undefined) { - let requestModelMapper = new client.models['TagsObject']().mapper(); - requestModel = client.serialize(requestModelMapper, vpnSiteParameters, 'vpnSiteParameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(vpnSiteParameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['VpnSite']().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); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VpnSite']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Deletes a VpnSite. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being deleted. - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDeleteMethod(resourceGroupName, vpnSiteName, 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-10-01'; - // Validate - try { - 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 (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 (vpnSiteName === null || vpnSiteName === undefined || typeof vpnSiteName.valueOf() !== 'string') { - throw new Error('vpnSiteName 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/vpnSites/{vpnSiteName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{vpnSiteName}', encodeURIComponent(vpnSiteName)); - 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 = 'DELETE'; - 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 && statusCode !== 202 && statusCode !== 204) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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; - - return callback(null, result, httpRequest, response); - }); -} - -/** - * Lists all the vpnSites in a resource group. - * - * @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 ListVpnSitesResult} 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 _listByResourceGroupNext(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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListVpnSitesResult']().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); - }); -} - -/** - * Lists all the VpnSites in a subscription. - * - * @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 ListVpnSitesResult} 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ListVpnSitesResult']().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 VpnSites. */ -class VpnSites { - /** - * Create a VpnSites. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._updateTags = _updateTags; - this._deleteMethod = _deleteMethod; - this._listByResourceGroup = _listByResourceGroup; - this._list = _list; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdateTags = _beginUpdateTags; - this._beginDeleteMethod = _beginDeleteMethod; - this._listByResourceGroupNext = _listByResourceGroupNext; - this._listNext = _listNext; - } - - /** - * Retrieves the details of a VPNsite. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being retrieved. - * - * @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, vpnSiteName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, vpnSiteName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves the details of a VPNsite. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being retrieved. - * - * @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 {VpnSite} - 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 VpnSite} 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, vpnSiteName, 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, vpnSiteName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, vpnSiteName, options, optionalCallback); - } - } - - /** - * Creates a VpnSite resource if it doesn't exist else updates the existing - * VpnSite. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being created or - * updated. - * - * @param {object} vpnSiteParameters Parameters supplied to create or update - * VpnSite. - * - * @param {object} [vpnSiteParameters.virtualWan] The VirtualWAN to which the - * vpnSite belongs - * - * @param {string} [vpnSiteParameters.virtualWan.id] Resource ID. - * - * @param {object} [vpnSiteParameters.deviceProperties] The device properties - * - * @param {string} [vpnSiteParameters.deviceProperties.deviceVendor] Name of - * the device Vendor. - * - * @param {string} [vpnSiteParameters.deviceProperties.deviceModel] Model of - * the device. - * - * @param {number} [vpnSiteParameters.deviceProperties.linkSpeedInMbps] Link - * speed. - * - * @param {string} [vpnSiteParameters.ipAddress] The ip-address for the - * vpn-site. - * - * @param {string} [vpnSiteParameters.siteKey] The key for vpn-site that can be - * used for connections. - * - * @param {object} [vpnSiteParameters.addressSpace] The AddressSpace that - * contains an array of IP address ranges. - * - * @param {array} [vpnSiteParameters.addressSpace.addressPrefixes] A list of - * address blocks reserved for this virtual network in CIDR notation. - * - * @param {object} [vpnSiteParameters.bgpProperties] The set of bgp properties. - * - * @param {number} [vpnSiteParameters.bgpProperties.asn] The BGP speaker's ASN. - * - * @param {string} [vpnSiteParameters.bgpProperties.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [vpnSiteParameters.bgpProperties.peerWeight] The weight - * added to routes learned from this BGP speaker. - * - * @param {string} [vpnSiteParameters.provisioningState] The provisioning state - * of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {boolean} [vpnSiteParameters.isSecuritySite] IsSecuritySite flag - * - * @param {string} [vpnSiteParameters.id] Resource ID. - * - * @param {string} [vpnSiteParameters.location] Resource location. - * - * @param {object} [vpnSiteParameters.tags] Resource tags. - * - * @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. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, vpnSiteName, vpnSiteParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, vpnSiteName, vpnSiteParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates a VpnSite resource if it doesn't exist else updates the existing - * VpnSite. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being created or - * updated. - * - * @param {object} vpnSiteParameters Parameters supplied to create or update - * VpnSite. - * - * @param {object} [vpnSiteParameters.virtualWan] The VirtualWAN to which the - * vpnSite belongs - * - * @param {string} [vpnSiteParameters.virtualWan.id] Resource ID. - * - * @param {object} [vpnSiteParameters.deviceProperties] The device properties - * - * @param {string} [vpnSiteParameters.deviceProperties.deviceVendor] Name of - * the device Vendor. - * - * @param {string} [vpnSiteParameters.deviceProperties.deviceModel] Model of - * the device. - * - * @param {number} [vpnSiteParameters.deviceProperties.linkSpeedInMbps] Link - * speed. - * - * @param {string} [vpnSiteParameters.ipAddress] The ip-address for the - * vpn-site. - * - * @param {string} [vpnSiteParameters.siteKey] The key for vpn-site that can be - * used for connections. - * - * @param {object} [vpnSiteParameters.addressSpace] The AddressSpace that - * contains an array of IP address ranges. - * - * @param {array} [vpnSiteParameters.addressSpace.addressPrefixes] A list of - * address blocks reserved for this virtual network in CIDR notation. - * - * @param {object} [vpnSiteParameters.bgpProperties] The set of bgp properties. - * - * @param {number} [vpnSiteParameters.bgpProperties.asn] The BGP speaker's ASN. - * - * @param {string} [vpnSiteParameters.bgpProperties.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [vpnSiteParameters.bgpProperties.peerWeight] The weight - * added to routes learned from this BGP speaker. - * - * @param {string} [vpnSiteParameters.provisioningState] The provisioning state - * of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {boolean} [vpnSiteParameters.isSecuritySite] IsSecuritySite flag - * - * @param {string} [vpnSiteParameters.id] Resource ID. - * - * @param {string} [vpnSiteParameters.location] Resource location. - * - * @param {object} [vpnSiteParameters.tags] Resource tags. - * - * @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 {VpnSite} - 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 VpnSite} 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. - */ - createOrUpdate(resourceGroupName, vpnSiteName, vpnSiteParameters, 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._createOrUpdate(resourceGroupName, vpnSiteName, vpnSiteParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(resourceGroupName, vpnSiteName, vpnSiteParameters, options, optionalCallback); - } - } - - /** - * Updates VpnSite tags. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being updated. - * - * @param {object} vpnSiteParameters Parameters supplied to update VpnSite - * tags. - * - * @param {object} [vpnSiteParameters.tags] Resource tags. - * - * @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. - */ - updateTagsWithHttpOperationResponse(resourceGroupName, vpnSiteName, vpnSiteParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateTags(resourceGroupName, vpnSiteName, vpnSiteParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates VpnSite tags. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being updated. - * - * @param {object} vpnSiteParameters Parameters supplied to update VpnSite - * tags. - * - * @param {object} [vpnSiteParameters.tags] Resource tags. - * - * @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 {VpnSite} - 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 VpnSite} 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. - */ - updateTags(resourceGroupName, vpnSiteName, vpnSiteParameters, 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._updateTags(resourceGroupName, vpnSiteName, vpnSiteParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateTags(resourceGroupName, vpnSiteName, vpnSiteParameters, options, optionalCallback); - } - } - - /** - * Deletes a VpnSite. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being deleted. - * - * @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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName, vpnSiteName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, vpnSiteName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes a VpnSite. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being deleted. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName, vpnSiteName, 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._deleteMethod(resourceGroupName, vpnSiteName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, vpnSiteName, options, optionalCallback); - } - } - - /** - * Lists all the vpnSites in a resource group. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all the vpnSites in a resource group. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @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 {ListVpnSitesResult} - 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 ListVpnSitesResult} 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. - */ - listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroup(resourceGroupName, options, optionalCallback); - } - } - - /** - * Lists all the VpnSites in a subscription. - * - * @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(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all the VpnSites in a subscription. - * - * @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 {ListVpnSitesResult} - 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 ListVpnSitesResult} 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(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(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(options, optionalCallback); - } - } - - /** - * Creates a VpnSite resource if it doesn't exist else updates the existing - * VpnSite. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being created or - * updated. - * - * @param {object} vpnSiteParameters Parameters supplied to create or update - * VpnSite. - * - * @param {object} [vpnSiteParameters.virtualWan] The VirtualWAN to which the - * vpnSite belongs - * - * @param {string} [vpnSiteParameters.virtualWan.id] Resource ID. - * - * @param {object} [vpnSiteParameters.deviceProperties] The device properties - * - * @param {string} [vpnSiteParameters.deviceProperties.deviceVendor] Name of - * the device Vendor. - * - * @param {string} [vpnSiteParameters.deviceProperties.deviceModel] Model of - * the device. - * - * @param {number} [vpnSiteParameters.deviceProperties.linkSpeedInMbps] Link - * speed. - * - * @param {string} [vpnSiteParameters.ipAddress] The ip-address for the - * vpn-site. - * - * @param {string} [vpnSiteParameters.siteKey] The key for vpn-site that can be - * used for connections. - * - * @param {object} [vpnSiteParameters.addressSpace] The AddressSpace that - * contains an array of IP address ranges. - * - * @param {array} [vpnSiteParameters.addressSpace.addressPrefixes] A list of - * address blocks reserved for this virtual network in CIDR notation. - * - * @param {object} [vpnSiteParameters.bgpProperties] The set of bgp properties. - * - * @param {number} [vpnSiteParameters.bgpProperties.asn] The BGP speaker's ASN. - * - * @param {string} [vpnSiteParameters.bgpProperties.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [vpnSiteParameters.bgpProperties.peerWeight] The weight - * added to routes learned from this BGP speaker. - * - * @param {string} [vpnSiteParameters.provisioningState] The provisioning state - * of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {boolean} [vpnSiteParameters.isSecuritySite] IsSecuritySite flag - * - * @param {string} [vpnSiteParameters.id] Resource ID. - * - * @param {string} [vpnSiteParameters.location] Resource location. - * - * @param {object} [vpnSiteParameters.tags] Resource tags. - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, vpnSiteName, vpnSiteParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, vpnSiteName, vpnSiteParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates a VpnSite resource if it doesn't exist else updates the existing - * VpnSite. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being created or - * updated. - * - * @param {object} vpnSiteParameters Parameters supplied to create or update - * VpnSite. - * - * @param {object} [vpnSiteParameters.virtualWan] The VirtualWAN to which the - * vpnSite belongs - * - * @param {string} [vpnSiteParameters.virtualWan.id] Resource ID. - * - * @param {object} [vpnSiteParameters.deviceProperties] The device properties - * - * @param {string} [vpnSiteParameters.deviceProperties.deviceVendor] Name of - * the device Vendor. - * - * @param {string} [vpnSiteParameters.deviceProperties.deviceModel] Model of - * the device. - * - * @param {number} [vpnSiteParameters.deviceProperties.linkSpeedInMbps] Link - * speed. - * - * @param {string} [vpnSiteParameters.ipAddress] The ip-address for the - * vpn-site. - * - * @param {string} [vpnSiteParameters.siteKey] The key for vpn-site that can be - * used for connections. - * - * @param {object} [vpnSiteParameters.addressSpace] The AddressSpace that - * contains an array of IP address ranges. - * - * @param {array} [vpnSiteParameters.addressSpace.addressPrefixes] A list of - * address blocks reserved for this virtual network in CIDR notation. - * - * @param {object} [vpnSiteParameters.bgpProperties] The set of bgp properties. - * - * @param {number} [vpnSiteParameters.bgpProperties.asn] The BGP speaker's ASN. - * - * @param {string} [vpnSiteParameters.bgpProperties.bgpPeeringAddress] The BGP - * peering address and BGP identifier of this BGP speaker. - * - * @param {number} [vpnSiteParameters.bgpProperties.peerWeight] The weight - * added to routes learned from this BGP speaker. - * - * @param {string} [vpnSiteParameters.provisioningState] The provisioning state - * of the resource. Possible values include: 'Succeeded', 'Updating', - * 'Deleting', 'Failed' - * - * @param {boolean} [vpnSiteParameters.isSecuritySite] IsSecuritySite flag - * - * @param {string} [vpnSiteParameters.id] Resource ID. - * - * @param {string} [vpnSiteParameters.location] Resource location. - * - * @param {object} [vpnSiteParameters.tags] Resource tags. - * - * @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 {VpnSite} - 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 VpnSite} 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. - */ - beginCreateOrUpdate(resourceGroupName, vpnSiteName, vpnSiteParameters, 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._beginCreateOrUpdate(resourceGroupName, vpnSiteName, vpnSiteParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(resourceGroupName, vpnSiteName, vpnSiteParameters, options, optionalCallback); - } - } - - /** - * Updates VpnSite tags. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being updated. - * - * @param {object} vpnSiteParameters Parameters supplied to update VpnSite - * tags. - * - * @param {object} [vpnSiteParameters.tags] Resource tags. - * - * @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. - */ - beginUpdateTagsWithHttpOperationResponse(resourceGroupName, vpnSiteName, vpnSiteParameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginUpdateTags(resourceGroupName, vpnSiteName, vpnSiteParameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates VpnSite tags. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being updated. - * - * @param {object} vpnSiteParameters Parameters supplied to update VpnSite - * tags. - * - * @param {object} [vpnSiteParameters.tags] Resource tags. - * - * @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 {VpnSite} - 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 VpnSite} 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. - */ - beginUpdateTags(resourceGroupName, vpnSiteName, vpnSiteParameters, 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._beginUpdateTags(resourceGroupName, vpnSiteName, vpnSiteParameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginUpdateTags(resourceGroupName, vpnSiteName, vpnSiteParameters, options, optionalCallback); - } - } - - /** - * Deletes a VpnSite. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being deleted. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, vpnSiteName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, vpnSiteName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes a VpnSite. - * - * @param {string} resourceGroupName The resource group name of the VpnSite. - * - * @param {string} vpnSiteName The name of the VpnSite being deleted. - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName, vpnSiteName, 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._beginDeleteMethod(resourceGroupName, vpnSiteName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(resourceGroupName, vpnSiteName, options, optionalCallback); - } - } - - /** - * Lists all the vpnSites in a resource group. - * - * @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. - */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Lists all the vpnSites in a resource group. - * - * @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 {ListVpnSitesResult} - 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 ListVpnSitesResult} 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. - */ - listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); - } - } - - /** - * Lists all the VpnSites in a subscription. - * - * @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; - }); - }); - } - - /** - * Lists all the VpnSites in a subscription. - * - * @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 {ListVpnSitesResult} - 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 ListVpnSitesResult} 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 = VpnSites; diff --git a/lib/services/networkManagement2/lib/operations/vpnSitesConfiguration.js b/lib/services/networkManagement2/lib/operations/vpnSitesConfiguration.js deleted file mode 100644 index a992dff91..000000000 --- a/lib/services/networkManagement2/lib/operations/vpnSitesConfiguration.js +++ /dev/null @@ -1,473 +0,0 @@ -/* - * 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; - - -/** - * Gives the sas-url to download the configurations for vpn-sites in a resource - * group. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} virtualWANName The name of the VirtualWAN for which - * configuration of all vpn-sites is needed. - * - * @param {object} request Parameters supplied to download vpn-sites - * configuration. - * - * @param {array} [request.vpnSites] List of resource-ids of the vpn-sites for - * which config is to be downloaded. - * - * @param {string} [request.outputBlobSasUrl] The sas-url to download the - * configurations for vpn-sites - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _download(resourceGroupName, virtualWANName, request, 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.'); - } - - // Send request - this.beginDownload(resourceGroupName, virtualWANName, request, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gives the sas-url to download the configurations for vpn-sites in a resource - * group. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} virtualWANName The name of the VirtualWAN for which - * configuration of all vpn-sites is needed. - * - * @param {object} request Parameters supplied to download vpn-sites - * configuration. - * - * @param {array} [request.vpnSites] List of resource-ids of the vpn-sites for - * which config is to be downloaded. - * - * @param {string} [request.outputBlobSasUrl] The sas-url to download the - * configurations for vpn-sites - * - * @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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 _beginDownload(resourceGroupName, virtualWANName, request, 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-10-01'; - // Validate - try { - 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 (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 (virtualWANName === null || virtualWANName === undefined || typeof virtualWANName.valueOf() !== 'string') { - throw new Error('virtualWANName cannot be null or undefined and it must be of type string.'); - } - if (request === null || request === undefined) { - throw new Error('request cannot be null or undefined.'); - } - 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/virtualWans/{virtualWANName}/vpnConfiguration'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{virtualWANName}', encodeURIComponent(virtualWANName)); - 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 = 'POST'; - 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]; - } - } - } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (request !== null && request !== undefined) { - let requestModelMapper = new client.models['GetVpnSitesConfigurationRequest']().mapper(); - requestModel = client.serialize(requestModelMapper, request, 'request'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(request, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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; - - return callback(null, result, httpRequest, response); - }); -} - -/** Class representing a VpnSitesConfiguration. */ -class VpnSitesConfiguration { - /** - * Create a VpnSitesConfiguration. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._download = _download; - this._beginDownload = _beginDownload; - } - - /** - * Gives the sas-url to download the configurations for vpn-sites in a resource - * group. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} virtualWANName The name of the VirtualWAN for which - * configuration of all vpn-sites is needed. - * - * @param {object} request Parameters supplied to download vpn-sites - * configuration. - * - * @param {array} [request.vpnSites] List of resource-ids of the vpn-sites for - * which config is to be downloaded. - * - * @param {string} [request.outputBlobSasUrl] The sas-url to download the - * configurations for vpn-sites - * - * @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. - */ - downloadWithHttpOperationResponse(resourceGroupName, virtualWANName, request, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._download(resourceGroupName, virtualWANName, request, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gives the sas-url to download the configurations for vpn-sites in a resource - * group. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} virtualWANName The name of the VirtualWAN for which - * configuration of all vpn-sites is needed. - * - * @param {object} request Parameters supplied to download vpn-sites - * configuration. - * - * @param {array} [request.vpnSites] List of resource-ids of the vpn-sites for - * which config is to be downloaded. - * - * @param {string} [request.outputBlobSasUrl] The sas-url to download the - * configurations for vpn-sites - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - download(resourceGroupName, virtualWANName, request, 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._download(resourceGroupName, virtualWANName, request, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._download(resourceGroupName, virtualWANName, request, options, optionalCallback); - } - } - - /** - * Gives the sas-url to download the configurations for vpn-sites in a resource - * group. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} virtualWANName The name of the VirtualWAN for which - * configuration of all vpn-sites is needed. - * - * @param {object} request Parameters supplied to download vpn-sites - * configuration. - * - * @param {array} [request.vpnSites] List of resource-ids of the vpn-sites for - * which config is to be downloaded. - * - * @param {string} [request.outputBlobSasUrl] The sas-url to download the - * configurations for vpn-sites - * - * @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. - */ - beginDownloadWithHttpOperationResponse(resourceGroupName, virtualWANName, request, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDownload(resourceGroupName, virtualWANName, request, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gives the sas-url to download the configurations for vpn-sites in a resource - * group. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} virtualWANName The name of the VirtualWAN for which - * configuration of all vpn-sites is needed. - * - * @param {object} request Parameters supplied to download vpn-sites - * configuration. - * - * @param {array} [request.vpnSites] List of resource-ids of the vpn-sites for - * which config is to be downloaded. - * - * @param {string} [request.outputBlobSasUrl] The sas-url to download the - * configurations for vpn-sites - * - * @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 {null} - 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. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - beginDownload(resourceGroupName, virtualWANName, request, 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._beginDownload(resourceGroupName, virtualWANName, request, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDownload(resourceGroupName, virtualWANName, request, options, optionalCallback); - } - } - -} - -module.exports = VpnSitesConfiguration;